vuejs / eslint-config-standard Goto Github PK
View Code? Open in Web Editor NEWESLint Shareable Configs for JavaScript Standard Style in Vue.js Projects
License: MIT License
ESLint Shareable Configs for JavaScript Standard Style in Vue.js Projects
License: MIT License
latest version is 5.0.2 (https://www.npmjs.com/package/@vue/eslint-config-airbnb)
该版本使用peerDependencies依赖
eslint-plugin-standard
eslint-plugin-promise
eslint-plugin-import
eslint-plugin-node
导致手动升级至5.0版本后需要手动安装这几个依赖,这是该插件开发时预期的行为吗?
$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-promise
npm ERR! dev eslint-plugin-promise@"5.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-promise@"^4.2.1" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"6.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2022-03-24T08_57_37_606Z-debug.log
PS F:\project\thtf-template> npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.5.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
The package requires 22.0, but current version is 34.
In reference to the following issue:
vuejs/vue-cli#7189
It looks like this library at the default install of version 6.1.0
when using the Vue CLI has incompatible peer dependencies with the eslint-plugin-vue
module installed as part of the Vue CLI setup.
This is broken out the box on Vue CLI version 5.x on NPM 8
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Vue CLI v5.0.8
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Linter
? Choose a version of Vue.js that you want to start the project with 3.x
? Pick a linter / formatter config: Standard
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? (y/N)
Could we update the eslint dep to either v8 or v7 | v8?
npm errors over this when eslint 8 is being used as the peer dep is tied to v7
eslint-plugin-vue
, like in the airbnb config: https://github.com/vuejs/eslint-config-airbnb/blob/a991fe3b328112ae43e49bede760806d2c89cbf1/packages/eslint-config-airbnb/rules/template.js#L3-L57Hi,
I'm migrating one of my projects to a fresh create-vue
. I have notice a big performance difference when using @vue/eslint-config-standard-with-typescript
and following config changes of parserOptions
:
overrides: [
{
files: [
'**/*.ts',
'**/*.vue'
],
extends: [
'@vue/eslint-config-standard-with-typescript'
],
parser: 'vue-eslint-parser',
parserOptions: {
tsconfigRootDir: __dirname,
parser: {
'<template>': 'espree',
js: '@typescript-eslint/parser',
ts: '@typescript-eslint/parser'
},
project: ['./tsconfig.json']
}
}
]
Performance test:
parserOptions
: 47sparserOptions
: 98sMy eslint
run was twice as fast. Not sure if this is suitable for everyone.
What could be also interesting Glob pattern in parser's option "project" slows down linting
(typescript-eslint/typescript-eslint#2611)
The package.json currently has a non-existent peer dependency which causes build warnings because the package doesn't exist.
https://github.com/vuejs/eslint-config-standard/blob/main/package.json
See line 32: "eslint-plugin-n": "^15.0.0",
Should be: "eslint-plugin-node": "^15.0.0",
❯ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @vue/eslint-config-standard@npm:6.0.0 [4ab08] doesn't provide webpack (p0da10), requested by eslint-import-resolver-webpack
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 359ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 347ms
➤ YN0000: Done with warnings in 0s 926ms
❯ yarn explain peer-requirements p0da10
➤ YN0000: @vue/eslint-config-standard@npm:6.0.0 [4ab08] doesn't provide webpack, breaking the following requirements:
➤ YN0000: eslint-import-resolver-webpack@npm:0.13.0 [93f0f] → >=1.11.0 ✘
Since webpack
is provided by @vue/cli-service
should the following be added to this package's config?:
"peerDependenciesMeta": {
"webpack": {
"optional": true
}
}
Users can work around this by adding this to their yarnrc.yml
:
packageExtensions:
"@vue/eslint-config-standard@^6.0.0":
peerDependenciesMeta:
webpack:
optional: true
I just updated all the dependencies for my project created with Vue CLI. The build is successful after updating all dependencies except one: @vue/eslint-config-standard
. I'm updating from v4.0.0
to v5.0.0
. The error stack looks like this:
ERROR Failed to compile with 1 errors
error in ./src/main.js
Module build failed (from ./node_modules/eslint-loader/index.js):
Error: Failed to load plugin 'import' declared in 'package.json » @vue/eslint-config-standard » /Users/dakshshah/Documents/fakePath/node_modules/eslint-config-standard/index.js': Cannot find module 'eslint-plugin-import'
Require stack:
- /Users/dakshshah/Documents/fakePath/__placeholder__.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.resolve (internal/modules/cjs/helpers.js:30:19)
at Object.resolve (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/shared/relative-module-resolver.js:44:50)
at ConfigArrayFactory._loadPlugin (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:957:39)
at names.reduce (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:846:33)
at Array.reduce (<anonymous>)
at ConfigArrayFactory._loadPlugins (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:842:22)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:665:32)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:594:20)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:658:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:594:20)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/dakshshah/Documents/fakePath/node_modules/eslint/lib/cli-engine/config-array-factory.js:658:25)
@ multi (webpack)-dev-server/client?https://192.168.1.210:8083/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
upgrade eslint-config-standart
to v16, then eslint-plugin-standard
can be removed
Currently @vue/[email protected]
has a dependency on [email protected]
which prevents the usage of Node.js 17.x for us.
"@vue/[email protected]":
version "6.1.0"
resolved "https://registry.yarnpkg.com/@vue/eslint-config-standard/-/eslint-config-standard-6.1.0.tgz#b362ba67c86caa4e7b44481c2303c9dccc2dc037"
integrity sha512-9+hrEyflDzsGdlBDl9jPV5DIYUx1TOU5OSQqRDKCrNumrxRj5HRWKuk+ocXWnha6uoNRtLC24mY7d/MwqvBCNw==
dependencies:
eslint-config-standard "^16.0.3"
eslint-import-resolver-node "^0.3.4"
>> eslint-import-resolver-webpack "^0.13.1"
yarn install v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^16 || ^15 || ^14 || ^13 || ^12 || ^11 || ^10 || ^9 || ^8 || ^7 || ^6". Got "17.0.1"
error Found incompatible module.
There is already [email protected]
which may fix this.
Any plans on updating the dependency to this (the latest) version?
Great work for v8 resolving all the dependency issues, however this had leaded to another issue, that all the imported svg/json files now reported as errors.
error Unexpected use of file extension "svg" for "@/assets/icon/refresh.svg" import/extensions
error Unexpected use of file extension "json" for "./locale/en-US.json" import/extensions
I have to fallback to v7 to make it work again.
BTW, adding @rushstack/eslint-patch
is not helping either.
Is there are reason ESLint 8.0.1
is enforced?
It's 8 months old, but the release enforcing it came 20 days ago when ESLint 8.15.0
was the current version.
Standard
also wants ESLint 8.13.0
.
And please update it to eslint-plugin-vue 9.1.0
.
While resolving: [email protected]
Found: [email protected]
node_modules/eslint-plugin-promise
dev eslint-plugin-promise@"^6.0.0" from the root project
Could not resolve dependency:
peer eslint-plugin-promise@"^4.2.1 || ^5.0.0" from [email protected]
node_modules/eslint-config-standard
dev eslint-config-standard@"^16.0.3" from the root project
Conflicting peer dependency: [email protected]
node_modules/eslint-plugin-promise
peer eslint-plugin-promise@"^4.2.1 || ^5.0.0" from [email protected]
node_modules/eslint-config-standard
dev eslint-config-standard@"^16.0.3" from the root project
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
What version of this package are you using?
v5.1.1
What operating system, Node.js, and npm version?
Ubuntu v18.04
Node v12.16.0
Yarn 1.21.1
What happened?
Updated packages and get the following when eslint is run:
Module Warning (from ./node_modules/eslint-loader/dist/cjs.js):
Cannot read config file: /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/@vue/eslint-config-standard/index.js
Error: Cannot find module '@vue/cli-service/webpack.config.js'
Require stack:
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/@vue/eslint-config-standard/index.js
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/eslint/lib/cli-engine/config-array-factory.js
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/eslint/lib/cli-engine/cli-engine.js
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/eslint/lib/cli-engine/index.js
- /home/intelliview/git/projects/NewCode/System_Console/projects/web/src/client/node_modules/eslint/lib/api.js
What did you expect to happen?
No issues for lack of finding a config file. It appears to be looking for '@vue/cli-service/webpack.config.js'
. Was this always the case or a breaking change?? We are trying to get a build done at work and now cannot.
We tried installing:
yarn add -D @vue/cli-service
As much as we'd like Vue eslinting, it appears we'll be forced to remove.
I believe this line:
f78b634#diff-168726dbe96b3ce427e7fedce31bb0bcR10
Assumes that all Vue projects are using the Vue CLI. I believe you have broken all the Quasar Framework projects out there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.