Skip to content

Commit 562fde1

Browse files
adi518michalsnik
authored andcommitted
Update Readme with Vetur information (#559)
* Update "Why doesn't it work on .vue file?" I had an issue where the plugin works, but red markings of errors remained. So I found out the instructions for this section are missing a note regarding Vetur. You need the following setting to complete the setup: ``` "vetur.validation.template": false ``` Note: While it solved my issue, there is something to consider with how it's applied. Eslint is mostly used in a per-project manner. This means, if you apply the rule above to `settings.json`, it is global a rule and Vue projects that do not use this plugin will not show template errors. So to solve this, you need to apply the setting locally. In the context of VS Code, it's easy. You just save a "workspace" to your project root and that creates a file, where you can apply the settings, thus locally. See [here](microsoft/vscode#37519) for details. * Update README.md
1 parent f0c8b37 commit 562fde1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` t
284284
```
285285

286286
2. Make sure your tool is set to lint `.vue` files.
287-
- CLI targets only `.js` files by default. You have to specify additional extensions by `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`.
287+
- CLI targets only `.js` files by default. You have to specify additional extensions by `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`. If you use `@vue/cli-plugin-eslint` and the `vue-cli-service lint` command - you don't have to worry about it.
288288
- VSCode targets only JavaScript or HTML files by default. You have to add `"vue"` to the `"eslint.validate"` array in vscode settings. e.g. `"eslint.validate": [ "javascript", "javascriptreact", "vue" ]`
289+
- If you use `Vetur` plugin in VSCode - set `"vetur.validation.template": false` to avoid default Vetur template validation. Check out [vetur documentation](https://github.com/vuejs/vetur/blob/master/docs/linting-error.md) for more info.
289290

290291
## :anchor: Semantic Versioning Policy
291292

0 commit comments

Comments
 (0)