Giter VIP home page Giter VIP logo

eslint-config-standard's Introduction

eslint-config-standard's People

Contributors

ashleylamont avatar charles-allen avatar sodatea avatar st-sloth avatar visualfanatic avatar yyx990803 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eslint-config-standard's Issues

Causing svg/json "import/extensions" error with v8.0.0

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.

Error using eslint-plugin-promise 5.1.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.

5.0版本安装后缺少eslint-config-standard所需依赖

该版本使用peerDependencies依赖
eslint-plugin-standard
eslint-plugin-promise
eslint-plugin-import
eslint-plugin-node
导致手动升级至5.0版本后需要手动安装这几个依赖,这是该插件开发时预期的行为吗?

Yarn: webpack dependency not provided

❯ 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
    }
  }

Workaround

Users can work around this by adding this to their yarnrc.yml:

packageExtensions:
  "@vue/eslint-config-standard@^6.0.0":
    peerDependenciesMeta:
      webpack:
        optional: true

Performance difference when using different parserOptions on with-typescript

Hi,
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:

  • With the parserOptions: 47s
  • Without the parserOptions: 98s

My eslint run was twice as fast. Not sure if this is suitable for everyone.

Edit

What could be also interesting Glob pattern in parser's option "project" slows down linting (typescript-eslint/typescript-eslint#2611)

Peer dependency conflict when creating projects using NPM 8

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.

Step to Reproduce

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)

Unable to use Node.js 17.x

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?

eslint-config-standard peer conflict when use eslint-plugin-vue@8

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.

Module build failed (from ./node_modules/eslint-loader/index.js)

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

Conflicting with ESLint 8.16

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.

Error installing eslint-plugin-promise 6.0.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.

Update eslint dep to v8

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

Error: Cannot find module '@vue/cli-service/webpack.config.js'

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.