Skip to content
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

Labels

Comments

@JounQin
Copy link

@JounQin JounQin commented Jul 28, 2019

Tell us about your environment

  • ESLint Version: v6.1.0
  • Node Version: v12.7.0
  • npm Version: 6.10.0

What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser

Please show your full configuration:

Configuration
{
  "eslintConfig": {
    "root": true,
    "extends": "1stg/react",
    "rules": {
      "@typescript-eslint/no-explicit-any": 0,
      "react/prop-types": 0
    }
  }
}

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.

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
+ actual - expected

+ '/Users/JounQin/Workspaces/GitHub/Slides'
- '/Users/JounQin/Workspaces/GitHub/Slides/node_modules/eslint-config-1stg'

Are you willing to submit a pull request to fix this bug?
Not sure how to fix it.

@JounQin JounQin changed the title `overrides` from npm pkg throws due `basePath` inconsistent `overrides` from npm pkg throws due to `basePath` inconsistent Jul 28, 2019
@aladdin-add aladdin-add added core evaluating and removed triage labels Jul 28, 2019
@platinumazure

This comment has been minimized.

Copy link
Member

@platinumazure platinumazure commented Aug 8, 2019

Hi @JounQin, thanks for the issue and sorry for letting this slide.

Could you please try running ESLint with the --debug command, and paste the output here?

@JounQin

This comment has been minimized.

Copy link
Author

@JounQin JounQin commented Aug 13, 2019

Debug Info
in 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: eslint-config-1stg@5.5.1 (/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: eslint-plugin-import@2.18.2 (/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: eslint-plugin-import@2.18.2 (/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: eslint-plugin-import@2.18.2 (/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: eslint-config-standard@13.0.1 (/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: eslint-plugin-import@2.18.2 (/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: eslint-plugin-node@9.1.0 (/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: eslint-plugin-promise@4.2.1 (/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: eslint-plugin-standard@4.0.0 (/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: eslint-plugin-prettier@3.1.0 (/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: eslint-config-prettier@6.0.0 (/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: eslint-plugin-prettier@3.1.0 (/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: eslint-plugin-standard@4.0.0 (/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: eslint-plugin-prettier@3.1.0 (/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/eslint-plugin@2.0.0-alpha.5 (/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"
}

eslint-config-1stg@~5.5.0 detail: https://unpkg.com/eslint-config-1stg@5.5.1/config.js

@unional

This comment has been minimized.

Copy link

@unional unional commented Aug 16, 2019

I get a similar error when using overrides.extends.

The error is:

[Error - 1:43:19 AM] ESLint stack trace:
[Error - 1:43:19 AM] AssertionError [ERR_ASSERTION]: Input A expected to strictly equal input B:
+ expected - actual

- '/Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended'
+ '/Users/hwong/code/unional/eslint-plugin-harmony/lib'
    at Function.and (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array/override-tester.js:134:16)
    at ConfigArrayFactory._normalizeObjectConfigData (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array-factory.js:502:47)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array-factory.js:581:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array-factory.js:545:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)

It can be reproduced in https://github.com/unional/eslint-plugin-harmony

You can observe it in IDE or by running yarn test

@unional

This comment has been minimized.

Copy link

@unional unional commented Aug 16, 2019

Here is the result for npx eslint spec/recommended --debug:

npx eslint spec/recommended --debug
  eslint:cli CLI args: [ 'spec/recommended', '--debug' ] +0ms
  eslint:cli Running on files +5ms
  eslint:ignored-paths baseDir = "/Users/hwong/code/unional/eslint-plugin-harmony" +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   = ".*" +0ms
  eslint:ignored-paths addPatternRelativeToCwd:
  eslint:ignored-paths   original = "!../"
  eslint:ignored-paths   cooked   = "!../" +0ms
  eslint:ignored-paths Looking for ignore file in /Users/hwong/code/unional/eslint-plugin-harmony +0ms
  eslint:ignored-paths Could not find ignore file in cwd +2ms
  eslint:ignored-paths baseDir = "/Users/hwong/code/unional/eslint-plugin-harmony" +1ms
  eslint:ignored-paths addPatternRelativeToCwd:
  eslint:ignored-paths   original = "/node_modules/*"
  eslint:ignored-paths   cooked   = "/node_modules/*" +0ms
  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/hwong/code/unional/eslint-plugin-harmony +0ms
  eslint:ignored-paths Could not find ignore file in cwd +0ms
  eslint:file-enumerator Start to iterate files: [ 'spec/recommended' ] +0ms
  eslint:file-enumerator Directory: /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended +0ms
  eslint:ignored-paths contains: +3ms
  eslint:ignored-paths   target   = "/Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended/" +0ms
  eslint:ignored-paths   base     = "/Users/hwong/code/unional/eslint-plugin-harmony" +1ms
  eslint:ignored-paths   relative = "spec/recommended/" +0ms
  eslint:ignored-paths   result   = false +0ms
  eslint:file-enumerator Enter the directory: /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended +2ms
  eslint:cascading-config-array-factory Load config files for /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended. +0ms
  eslint:cascading-config-array-factory No cache found: /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended. +0ms
  eslint:config-array-factory Loading legacy config file: /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended/.eslintrc +0ms
  eslint:config-array-factory Config file found: /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended/.eslintrc +49ms
  eslint:config-array-factory Loading {extends:"../../lib/recommended"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended/.eslintrc +12ms
  eslint:config-array-factory package.json was not found: Cannot find module '../../lib/recommended/package.json'
Require stack:
- /Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended/.eslintrc +2ms
  eslint:config-array-factory Loaded: ../../lib/recommended (/Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json) +0ms
  eslint:config-array-factory Loading JSON config file: /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +0ms
  eslint:config-array-factory Loading {extends:"./latest.json"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +2ms
  eslint:config-array-factory package.json was not found: Cannot find module './latest.json/package.json'
Require stack:
- /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +1ms
  eslint:config-array-factory Loaded: ./latest.json (/Users/hwong/code/unional/eslint-plugin-harmony/lib/latest.json) +0ms
  eslint:config-array-factory Loading JSON config file: /Users/hwong/code/unional/eslint-plugin-harmony/lib/latest.json +0ms
  eslint:config-array-factory Loading {extends:"eslint:recommended"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/latest.json +0ms
  eslint:config-array-factory Loading JS config file: /Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/conf/eslint-recommended.js +0ms
  eslint:config-array-factory Loading {extends:"./style-parts/es2017.json"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/latest.json +2ms
  eslint:config-array-factory package.json was not found: Cannot find module './style-parts/es2017.json/package.json'
Require stack:
- /Users/hwong/code/unional/eslint-plugin-harmony/lib/latest.json +0ms
  eslint:config-array-factory Loaded: ./style-parts/es2017.json (/Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/es2017.json) +0ms
  eslint:config-array-factory Loading JSON config file: /Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/es2017.json +0ms
  eslint:config-array-factory Loading {extends:"./common.json"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/es2017.json +1ms
  eslint:config-array-factory package.json was not found: Cannot find module './common.json/package.json'
Require stack:
- /Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/es2017.json +0ms
  eslint:config-array-factory Loaded: ./common.json (/Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/common.json) +0ms
  eslint:config-array-factory Loading JSON config file: /Users/hwong/code/unional/eslint-plugin-harmony/lib/style-parts/common.json +0ms
  eslint:config-array-factory Loading {extends:"eslint:recommended"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +2ms
  eslint:config-array-factory Loading JS config file: /Users/hwong/code/unional/eslint-plugin-harmony/node_modules/eslint/conf/eslint-recommended.js +0ms
  eslint:config-array-factory Loading {extends:"plugin:@typescript-eslint/eslint-recommended"} relative to /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +17ms
  eslint:config-array-factory Loading plugin "@typescript-eslint" from /Users/hwong/code/unional/eslint-plugin-harmony/lib/recommended.json +0ms
  eslint:config-array-factory Loaded: @typescript-eslint/eslint-plugin@2.0.0 (/Users/hwong/code/unional/eslint-plugin-harmony/node_modules/@typescript-eslint/eslint-plugin/dist/index.js) +2ms
Input A expected to strictly equal input B:
+ expected - actual

- '/Users/hwong/code/unional/eslint-plugin-harmony/spec/recommended'
+ '/Users/hwong/code/unional/eslint-plugin-harmony/lib'
@unional

This comment has been minimized.

Copy link

@unional unional commented Aug 16, 2019

I have figured out the cause of this bug.

It is because overrides.extends does not get merged property when the config is being extended.

Here is an example:

style-guide.json:

{
  "extends": "eslint:recommended",
  "overrides": [
    {
      "files": ["*.ts", "*.tsx"],
       "extends": ["@typescript-eslint/recommended"]
    }
}

.eslintrc:

{
  "extends": "./style-guide.json"
}

eslint can't handle the extends when the style-guide contains overrides.

billyjanitsch added a commit to kensho-technologies/eslint-config-kensho that referenced this issue Aug 17, 2019
This reverts commit 11726e6.

The functionality that enables this consolidation seems to be
broken. See eslint/eslint#12032
@aladdin-add

This comment has been minimized.

Copy link
Member

@aladdin-add aladdin-add commented Aug 25, 2019

seems like a bug to me. thoughts? @mysticatea

@gziolo

This comment has been minimized.

Copy link

@gziolo gziolo commented Aug 29, 2019

I think I run into a similar issue when trying to use overrides with extends for the package published to npm. Related PR: WordPress/gutenberg-examples#87 (comment)

I was able to track it down to the following line in code:

const basePath = filePath ? path.dirname(filePath) : cwd;

I also added a comment in the PR where this feature was added: #11554 (comment).

@aladdin-add

This comment has been minimized.

Copy link
Member

@aladdin-add aladdin-add commented Aug 30, 2019

labelled accepted, as I was able to repro it. please feel free to re-label if needed.

@mysticatea

This comment has been minimized.

Copy link
Member

@mysticatea mysticatea commented Sep 3, 2019

I'm sorry for my late response. I have confirmed it. I will work on this.

mysticatea added a commit that referenced this issue Sep 3, 2019
mysticatea added a commit that referenced this issue Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.