Comments (8)
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.
from eslint.
Update: it looks like I had to install eslint-plugin-vue
manually
from eslint.
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',
},
}
from eslint.
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
from eslint.
( 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"
}
from eslint.
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...
};
from eslint.
Feel like .eslintcache
may have something to do with this issue also.
from eslint.
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.
from eslint.
Related Issues (20)
- Include `eslint-plugin-regexp` in `tooling` preset HOT 2
- ConfigError: Key "plugins": Cannot redefine plugin "import" in Nuxt ESLint configuration HOT 2
- Constant Error: Cannot find module 'typescript' HOT 14
- Cannot find package 'vite-plugin-eslint2' HOT 5
- feat(config): add `no-import-type-side-effects` rule of `@typescript-eslint` HOT 1
- docs: add how to use composer HOT 3
- Add Tailwindcss class sorter HOT 8
- eslint/config-inspector custom host/port when using @nuxt/eslit HOT 1
- Question: Unexpected key "typescript" found HOT 4
- Nuxt Deployment on DigitalOcean // ERROR Cannot find module '/workspace/@nuxt/eslint' HOT 1
- Allow `no-undef` also on plain JavaScript files, not just Typescript HOT 12
- Add `public` folder to the ignore list
- `vue/no-ref-as-operand` does not trigger on `useState`
- Upgrade to typescript-eslint v8 HOT 3
- Not allow multiple root elements in server component
- Request for support on failOnError Overlay when applying nuxt/eslint HOT 3
- Several built-in Nuxt globals are not defined in ESLint config, causing linter to error in JS files HOT 6
- Documentation request: Config recipes for minimal config setup HOT 5
- Using @nuxt/eslint installs eslint version 9.6.0, causing the peer dependency warnings. HOT 4
- Add rule(s) to sort keys in `nuxt.config.ts` to keep everything in order HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint.