I'll use xo to lint *.vue files by bable-eslint and eslint-plugin-vue.
So, I need to override parserOptions like this.
https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error
Please tell me how to do it.
You can set the option directly under the xo property in your package.json or you can create a shareable config and set it there, similarly to https://github.com/xojs/eslint-config-xo-react/blob/master/index.js#L3
@sindresorhus should we create a eslint-config-xo-vue repo similar to eslint-config-xo-react?
Maybe we could start with the plugin:vue/recommended preset and parserOptions.
We would also need to add .vue files support to XO, similarly to the way we added .ts.
@pvdlg
You can set the option directly under the xo property in your package.json
Thanks, I worked as I was told and it worked fine.
should we create a eslint-config-xo-vue repo similar to eslint-config-xo-react?
I think that it would be very useful.
You can set the option directly under the
xoproperty in yourpackage.json
鈿狅笍 This isn't documented in the readme and placing it under settings doesn't work
I am trying to use xo to lint a monorepo with some vue projects. I have the following in my root package,json but it doesn't appear to be linting the vue files, any advice?
json
"xo": {
"prettier": "true",
"extends": [
"plugin:vue/recommended"
],
"extensions": [
".js",
".vue"
],
"ignores": [
"reports/**/*",
".nyc_output/**/*"
]
}
I have of course set xo: false in all the other package.json
This way of overriding parserOptions seems to work:
{
"xo": {
"envs": [ /* examples */
"browser",
"webextensions"
],
"parserOptions": {
"ecmaScript": 3 /* `3` is just for testing, you'll see weird new errors pop up */
}
}
}
Most helpful comment
鈿狅笍 This isn't documented in the readme and placing it under
settingsdoesn't work