Vue-cli: ESLint lint while typing not working in vue-cli 3.x / VSCode

Created on 13 Jul 2018  路  2Comments  路  Source: vuejs/vue-cli

Version

3.0.0-rc.3

Reproduction link

https://github.com/nickforddesign/vue-cli-3

Steps to reproduce

Set up new project with linting airbnb or standard config, choose lint on save? Then open project in VSCode and remove semicolons or something that linter will complain about.

What is expected?

Should see the linting errors in editor, and ideally in the browser overlay as with vue-cli 2.x, though that's a separate issue.

What is actually happening?

Only see linting errors and warnings in the Terminal window.


I have eslint for vscode installed. I know it's possible that this is a problem with that plugin and not vue-cli, but I am opening it because it works just fine with 2.x, but not 3.x

Most helpful comment

@nickforddesign In regards to the part about the linting not showing in VSCode, I needed to add this to my workspace settings and remove all of my VScode linting extensions except for ESLint:

{ "eslint.validate": [ { "language": "vue", "autoFix": true }, { "language": "html", "autoFix": true }, { "language": "javascript", "autoFix": true }, { "language": "typescript", "autoFix": true } ] }

Drove me mad for awhile trying to figure out how to get the linting errors to show in VSCode.

All 2 comments

This is intentional to prevent lint errors interrupting the dev experience. If you do want them to pop up in the overlay, set lintOnSave to "error": https://cli.vuejs.org/config/#lintonsave

@nickforddesign In regards to the part about the linting not showing in VSCode, I needed to add this to my workspace settings and remove all of my VScode linting extensions except for ESLint:

{ "eslint.validate": [ { "language": "vue", "autoFix": true }, { "language": "html", "autoFix": true }, { "language": "javascript", "autoFix": true }, { "language": "typescript", "autoFix": true } ] }

Drove me mad for awhile trying to figure out how to get the linting errors to show in VSCode.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

eladcandroid picture eladcandroid  路  3Comments

chasegiunta picture chasegiunta  路  3Comments

joshuajohnson814 picture joshuajohnson814  路  3Comments

brandon93s picture brandon93s  路  3Comments