-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overrides
from npm pkg throws due to basePath
inconsistent
#12032
overrides
from npm pkg throws due to basePath
inconsistent
#12032
Comments
overrides
from npm pkg throws due basePath
inconsistentoverrides
from npm pkg throws due to basePath
inconsistent
Hi @JounQin, thanks for the issue and sorry for letting this slide. Could you please try running ESLint with the |
Debug Infoin eslint on master [ ] ➜ yarn lint --debug 20:05:23 •52%
yarn run v1.17.3
$ eslint . --ext .js,.jsx --debug
eslint:cli CLI args: [ '.', '--ext', '.js,.jsx', '--debug' ] 0ms
eslint:cli Running on files 10ms
eslint:ignored-paths baseDir = "/Users/JounQin/Workspaces/GitHub/eslint" 0ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = "/node_modules/*"
eslint:ignored-paths cooked = "/node_modules/*" 1ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = "/bower_components/*"
eslint:ignored-paths cooked = "/bower_components/*" 0ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = ".*"
eslint:ignored-paths cooked = ".*" 1ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = "!../"
eslint:ignored-paths cooked = "!../" 0ms
eslint:ignored-paths Looking for ignore file in /Users/JounQin/Workspaces/GitHub/eslint 0ms
eslint:ignored-paths Could not find ignore file in cwd 0ms
eslint:ignored-paths baseDir = "/Users/JounQin/Workspaces/GitHub/eslint" 5ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = "/node_modules/*"
eslint:ignored-paths cooked = "/node_modules/*" 1ms
eslint:ignored-paths addPatternRelativeToCwd:
eslint:ignored-paths original = "/bower_components/*"
eslint:ignored-paths cooked = "/bower_components/*" 0ms
eslint:ignored-paths Looking for ignore file in /Users/JounQin/Workspaces/GitHub/eslint 0ms
eslint:ignored-paths Could not find ignore file in cwd 0ms
eslint:file-enumerator Start to iterate files: [ '.' ] 0ms
eslint:file-enumerator Directory: /Users/JounQin/Workspaces/GitHub/eslint 2ms
eslint:ignored-paths contains: 3ms
eslint:ignored-paths target = "/Users/JounQin/Workspaces/GitHub/eslint/" 0ms
eslint:ignored-paths base = "/Users/JounQin/Workspaces/GitHub/eslint" 0ms
eslint:ignored-paths relative = "" 0ms
eslint:ignored-paths result = false 0ms
eslint:file-enumerator Enter the directory: /Users/JounQin/Workspaces/GitHub/eslint 0ms
eslint:cascading-config-array-factory Load config files for /Users/JounQin/Workspaces/GitHub/eslint. 0ms
eslint:cascading-config-array-factory No cache found: /Users/JounQin/Workspaces/GitHub/eslint. 0ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/.eslintrc.js 0ms
eslint:config-array-factory Config file found: /Users/JounQin/Workspaces/GitHub/eslint/.eslintrc.js 2ms
eslint:config-array-factory Loading {extends:"1stg"} relative to /Users/JounQin/Workspaces/GitHub/eslint/.eslintrc.js 56ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js) 23ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loading {extends:"eslint:recommended"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 5ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/conf/eslint-recommended.js 0ms
eslint:config-array-factory Loading {extends:"plugin:import/recommended"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loading plugin "import" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-import/lib/index.js) 6ms
eslint:config-array-factory Loading plugin "import" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-import/lib/index.js 382ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-import/lib/index.js) 0ms
eslint:config-array-factory Loading {extends:"plugin:import/typescript"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loading plugin "import" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 0ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-import/lib/index.js) 0ms
eslint:config-array-factory Loading {extends:"standard"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js) 2ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js 0ms
eslint:config-array-factory Loading plugin "import" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js 2ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-import/lib/index.js) 0ms
eslint:config-array-factory Loading plugin "node" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js 0ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-node/lib/index.js) 1ms
eslint:config-array-factory Loading plugin "promise" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js 178ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-promise/index.js) 2ms
eslint:config-array-factory Loading plugin "standard" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-standard/index.js 19ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-standard/index.js) 0ms
eslint:config-array-factory Loading {extends:"plugin:prettier/recommended"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 3ms
eslint:config-array-factory Loading plugin "prettier" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js) 3ms
eslint:config-array-factory Loading {extends:"prettier"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js 3ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-prettier/index.js) 12ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-prettier/index.js 0ms
eslint:config-array-factory Loading plugin "prettier" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js 7ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js) 0ms
eslint:config-array-factory Loading {extends:"prettier/standard"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 0ms
eslint:config-array-factory package.json was not found: Cannot find module 'eslint-config-prettier/standard/package.json'
Require stack:
- /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 2ms
eslint:config-array-factory Loaded: eslint-config-prettier/standard (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-prettier/standard.js) 1ms
eslint:config-array-factory Loading JS config file: /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-prettier/standard.js 0ms
eslint:config-array-factory Loading plugin "standard" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 1ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-standard/index.js) 1ms
eslint:config-array-factory Loading plugin "prettier" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 0ms
eslint:config-array-factory Loaded: [email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js) 0ms
eslint:config-array-factory Loading parser "babel-eslint" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 2ms
eslint:config-array-factory Failed to load parser 'babel-eslint' declared in '.eslintrc.js » eslint-config-1stg#overrides[0]'. 0ms
eslint:config-array-factory Loading plugin "babel" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 2ms
eslint:config-array-factory Failed to load plugin 'babel' declared in '.eslintrc.js » eslint-config-1stg#overrides[0]'. 1ms
eslint:config-array-factory Loading {extends:"plugin:@typescript-eslint/eslint-recommended"} relative to /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 0ms
eslint:config-array-factory Loading plugin "@typescript-eslint" from /Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg/index.js 0ms
eslint:config-array-factory Loaded: @typescript-eslint/[email protected] (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/@typescript-eslint/eslint-plugin/dist/index.js) 4ms
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
actual - expected
'/Users/JounQin/Workspaces/GitHub/eslint'
- '/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint-config-1stg'
^
at Function.and (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array/override-tester.js:134:16)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js:502:47)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js:581:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js:545:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/JounQin/Workspaces/GitHub/eslint/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
📦 v1.0.0 via ⬢ v12.7.0 at ☸️ standard (alauda-system) took 4s
in eslint on master [ ] ➜ 20:05:40 •51% @platinumazure Sorry for delay. // .eslintrc.js
module.exports = {
extends: '1stg',
} // package.json
{
"name": "eslint-test",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"lint": "eslint . --ext .js,.jsx"
},
"devDependencies": {
"eslint": "^6.1.0",
"eslint-config-1stg": "~5.5.0",
"prettier": "^1.18.2",
"prettier-config-1stg": "^0.2.0",
"typescript": "^3.5.3"
},
"prettier": "prettier-config-1stg"
}
|
I get a similar error when using The error is:
It can be reproduced in https://github.com/unional/eslint-plugin-harmony You can observe it in IDE or by running |
Here is the result for
|
I have figured out the cause of this bug. It is because Here is an example:
{
"extends": "eslint:recommended",
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["@typescript-eslint/recommended"]
}
}
{
"extends": "./style-guide.json"
}
|
This reverts commit 11726e6. The functionality that enables this consolidation seems to be broken. See eslint/eslint#12032
seems like a bug to me. thoughts? @mysticatea |
I think I run into a similar issue when trying to use I was able to track it down to the following line in code: eslint/lib/cli-engine/config-array-factory.js Line 485 in 00d2c5b
I also added a comment in the PR where this feature was added: #11554 (comment). |
labelled accepted, as I was able to repro it. please feel free to re-label if needed. |
I'm sorry for my late response. I have confirmed it. I will work on this. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
My base config:
https://github.com/JounQin/eslint-config-1stg/blob/typescript/config.js
eslint . --ext ts,tsx
What did you expect to happen?
No error
What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
Not sure how to fix it.
The text was updated successfully, but these errors were encountered: