Closed timfee closed 6 months ago
Update: it looks like I had to install eslint-plugin-vue
manually
Facing the same problem
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'@nuxtjs/eslint-config-typescript',
'plugin:nuxt/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/vue',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
},
}
MEMO: @nuxtjs/eslint-config
(load from @nuxtjs/eslint-config-typescript
) is using eslint-plugin-vue
https://github.com/nuxt/eslint-config/blob/master/packages/eslint-config/package.json
( Google Translate )
The cause is unknown, but once I specified v3.0.0 and reinstalled it, and then updated to v5.0.0, the error no longer occurred (I'm not sure if it's working properly).
.eslintrc.json
{
"root": true,
"env": {
"browser": true,
"node": true
},
"extends": ["@nuxtjs/eslint-config-typescript", "prettier", "prettier/vue"],
"rules": {}
}
package.json The package configuration has changed from before, but the error disappeared when I changed to v3.0.0
"dependencies": {
"@aspida/axios": "^1.1.1",
"@nuxt/typescript-runtime": "^2.0.0",
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/dayjs": "^1.3.0",
"@nuxtjs/markdownit": "^1.2.10",
"@nuxtjs/proxy": "^2.1.0",
"@nuxtjs/pwa": "^3.0.2",
"chart.js": "^2.9.4",
"core-js": "^3.6.5",
"nuxt": "^2.14.6",
"vue-chartjs": "^3.5.1"
},
"devDependencies": {
"@nuxt/types": "^2.14.6",
"@nuxt/typescript-build": "^2.0.3",
"@nuxtjs/eslint-config-typescript": "^5.0.0",
"@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/storybook": "^3.3.0",
"@nuxtjs/stylelint-module": "^4.0.0",
"@storybook/addon-a11y": "^6.1.11",
"@storybook/addon-actions": "^6.1.11",
"@storybook/addon-docs": "^6.1.11",
"@storybook/addon-knobs": "^6.1.11",
"@storybook/addon-viewport": "^6.1.11",
"eslint": "^7.10.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-nuxt": "^2.0.0",
"fibers": "^5.0.0",
"npm-run-all": "^4.1.5",
"pathpida": "^0.10.2",
"prettier": "^2.1.2",
"sass": "^1.32.0",
"sass-loader": "^10.1.0",
"storybook-addon-designs": "^5.4.2",
"stylelint": "^13.8.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-recess-order": "^2.3.0",
"stylelint-config-recommended-scss": "^4.2.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-prettier": "^1.1.2",
"stylelint-scss": "^3.18.0"
}
I had the same issue, but I managed to get it sorted after a little playing around. Not sure how necessary a couple of the steps were, but it's working fine now :) There should be no need to install eslint-plugin-vue
manually, because it's already included in this package.
I updated eslint to the latest version (I believe it needs to be anything > 7.13.0).
I stripped down my .eslintrc.js
because some properties (e.g parser
) are already included in the configs and overriding them could be causing issues.
I deleted yarn.lock
and the node_modules
folder, ran yarn cache clean
then reinstalled.
I restarted VSCode. This is when the error disappeared, and strangely enough I've had similar issues before that have eventually been fixed this way.
My .eslintrc.js
ended up like this.
module.exports = {
root: true,
extends: [
'@nuxtjs',
'airbnb-base',
'plugin:nuxt/recommended',
],
plugins: [
'prettier',
],
globals: {
$nuxt: true,
},
// ... settings, rules etc...
};
Feel like .eslintcache
may have something to do with this issue also.
This may also be related to npm/yarn hoisting or vscode cache, I suggest reinstalling dependencies and reload vscode window, if it's still now working, let's add eslint-plugin-vue
explicitly which can make it be installed at root node_modules.
We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info. Please provide a minimal reproduction to reopen the issue. Thanks.
With a vanilla eslint config (below),
As long as
'@nuxtjs/eslint-config-typescript'
is included, VS Code shows a bunch of Vue errors:My
package.json
is:I'm not sure this is the right project, but as it seemed to be the one that impacted the results, I figured I'd start here :) Apologies if I got something basic wrong!