Skip to content

Commit fb05639

Browse files
mysticateamichalsnik
authored andcommittedJul 16, 2017
Docs: add FAQ about vue-eslint-parser (#82)
1 parent 90fa79d commit fb05639

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
 

‎README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,30 @@ The `--fix` option on the command line automatically fixes problems reported by
113113

114114
<!--RULES_TABLE_END-->
115115

116+
## :couple: FAQ
117+
118+
### What is the "Use the latest vue-eslint-parser" error?
119+
120+
The most rules of `eslint-plugin-vue` require `vue-eslint-parser` to check `<template>` ASTs.
121+
122+
Make sure you have one of the following settings in your **.eslintrc**:
123+
124+
- `"extends": ["plugin:vue/recommended"]`
125+
- `"extends": ["plugin:vue/base"]`
126+
127+
If you already use other parser (e.g. `"parser": "babel-eslint"`), please move it into `parserOptions`, so it doesn't collide with the `vue-eslint-parser` used by this plugin's configuration:
128+
129+
```diff
130+
- "parser": "babel-eslint",
131+
"parserOptions": {
132+
+ "parser": "babel-eslint",
133+
"ecmaVersion": 2017,
134+
"sourceType": "module"
135+
}
136+
```
137+
138+
The `vue-eslint-parser` uses the parser which is set by `parserOptions.parser` to parse scripts.
139+
116140
## :anchor: Semantic Versioning Policy
117141

118142
This plugin follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).

‎lib/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
if (context.parserServices.registerTemplateBodyVisitor == null) {
3333
context.report({
3434
loc: { line: 1, column: 0 },
35-
message: 'Use the latest vue-eslint-parser.'
35+
message: 'Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error'
3636
})
3737
return
3838
}

0 commit comments

Comments
 (0)