Closed dgautsch closed 4 years ago
I solved the issue with this config
{
"extends": [
"standard",
"plugin:jest/recommended"
],
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"overrides":[{
"extends": ["plugin:vue/recommended"],
"files": ["*.vue"],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"plugins": [
"vue",
"html"
]
}],
"plugins": [
"jest"
]
}
The codebase I'm working on uses Vue single file components (SFC).
I'm using modern-standard to lint and format my files and it has been working out great. I had to add
eslint-vue-plugin
to my codebase so eslint is able to read the SFC format. Unfortunately the plugin requires this format in your eslintrc files.When prettier-standard generates its eslint configuration it has the parser set to
babel-eslint
. This causes the following errors:My theory is that the generated config from prettier-standard is defaulting the parser to
babel-eslint
but Vue requires that to be set in theparserOptions
.It's possible I could solve this via the overrides in eslint or maybe there's a code change that can happen here to facilitate the plugin. Open to ideas.
Here is my eslintrc file
When I run
npx eslint --ext .js,.vue .
The linter works fine. It's only an issue when runningmodern lint