Skip to content

Error: Failed to load config "standard" to extend from. #27

Open

Description

What version of this package are you using?

5.0.0 (standard 14.3.1)

What operating system, Node.js, and npm version?

Manjaro KDE, Node v13.5.0, npm v6.13.4

What happened?

  1. Installed standardx with sudo npm install standardx --global
  2. Executed standardx --fix in my local project folder.
  3. The program terminated with this error:
standardx: Unexpected linter output:

Error: Failed to load config "standard" to extend from.
Referenced from: BaseConfig
    at configMissingError (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:233:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:712:23)
    at ConfigArrayFactory._loadExtends (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:617:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:547:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:307:25)
    at ConfigArrayFactory.create (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/config-array-factory.js:362:16)
    at createBaseConfigArray (/usr/lib/node_modules/standardx/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:84:48)

If you think this is a bug in `standardx`, open an issue: https://github.com/standard/standardx/issues

What did you expect to happen?

To run the autofixer.

Are you willing to submit a pull request to fix this bug?

I'm not familiar with the code, so I don't think I could.

Activity

  1. indigoviolet commented on Jan 19, 2020

    @indigoviolet

    ping? I'm also seeing this, with a similar setup.

    The standard tool itself works without such an error.

  2. Jero786 commented on Mar 1, 2020

    @Jero786

    @ManuelFte @indigoviolet In the meantime of that wrong configuration of eslint, I could resolve fallback of version 3.0.0 of standardx.

    yarn add standardx@3.0.0 @typescript-eslint/parser @typescript-eslint/eslint-plugin -D
    

    That's all

    Extra tip:

    I was having some problems with paths, etc.. so I ended to add a script to my package.json file.

    scripts: {
      "fix-lints" : "standardx src/**/*.ts src/**/*.tsx --fix",
       ...
    }
    

    and finally, just be sure that you are importing the rest of configurations that are described here

    That's it, then It's working as I expected. :)

  3. Raynos commented on May 21, 2020

    @Raynos

    This is still an issue, we should look into fixing this with the eslint @ 7 upgrade. I think eslint @ 7 is supposed to fix this,

    cc @LinusU who's got the eslint7 PR.

  4. JeffSpies commented on May 26, 2020

    @JeffSpies

    Still an issue for me:

    "@typescript-eslint/eslint-plugin": "^3.0.1",
    "@typescript-eslint/parser": "^3.0.1",
    "eslint": "^7.1.0",
    "standardx": "^5.0.0"
    
  5. Raynos commented on May 26, 2020

    @Raynos

    I think resolve plugins relative to is supposed to help with this maybe :(

  6. JeffSpies commented on Jul 5, 2020

    @JeffSpies

    I tried with another a new project and am hitting the same problem. So is it the case that no one is using latest standardx to add typescript support to standard?

  7. Raynos commented on Jul 6, 2020

    @Raynos

    I used standardx 3.0.0 because reasons :(

  8. UrzaUrza commented on Aug 14, 2020

    @UrzaUrza

    I got this issue today and solved it by installing the following packages:

    npm install eslint --save-dev
    npm install eslint-config-standard --save-dev
    npm install eslint-config-standard-jsx --save-dev
    npm install eslint-plugin-react --save-dev
    npm install eslint-plugin-import --save-dev
    npm install eslint-plugin-node --save-dev
    npm install eslint-plugin-promise --save-dev
    npm install eslint-plugin-standard --save-dev

  9. APWHY commented on Aug 31, 2020

    @APWHY

    I got this issue today and solved it by installing the following packages:
    ...

    This worked for me, but I didn't need all these packages (it's dependent on your setup). Running
    ./node_modules/.bin/eslint <SOME_FILE>
    will cause it to tell you what libraries you are missing (although you will have to do this multiple times.

  10. zunpitchk commented on Nov 4, 2020

    @zunpitchk

    I got this issue today and solved it by installing the following packages:

    npm install eslint --save-dev
    npm install eslint-config-standard --save-dev
    npm install eslint-config-standard-jsx --save-dev
    npm install eslint-plugin-react --save-dev
    npm install eslint-plugin-import --save-dev
    npm install eslint-plugin-node --save-dev
    npm install eslint-plugin-promise --save-dev
    npm install eslint-plugin-standard --save-dev

    In my case, it was resolved by removing all these packages and restart VSCode.
    The problem was from 'eslint' package itself. Probably collided with 'standardx' because both are linters.

  11. 7 remaining items

  12. feross commented on Nov 4, 2020

    @feross
    Member

    Thanks for checking, @Raynos. I can't reproduce this issue on my machine. A PR that fixes this would be really helpful to get this resolved.

  13. tcurdt commented on May 17, 2021

    @tcurdt

    Also ended up installing thse packages that made it work (although I don't need most of them - in theory)

    npm install eslint-config-standard --save-dev
    npm install eslint-config-standard-jsx --save-dev
    npm install eslint-plugin-react --save-dev
    npm install eslint-plugin-import --save-dev
    npm install eslint-plugin-node --save-dev
    npm install eslint-plugin-promise --save-dev
    npm install eslint-plugin-standard --save-dev
    
  14. tcurdt commented on May 19, 2021

    @tcurdt

    Any suggestion how to fix this without installing all those eslint packages manually?
    Happy to help debugging this.

  15. tcurdt commented on May 19, 2021

    @tcurdt

    I can't reproduce this issue on my machine. A PR that fixes this would be really helpful to get this resolved.

    I am running out of ideas so I've created a testcase to reproduce it.

    $ yarn -v
    1.22.10
    $ node -v
    v14.17.0
    $ yarn run lint:fix
    yarn run v1.22.10
    $ standardx --fix
    standardx: Unexpected linter output:
    
    Error: Failed to load config "standard" to extend from.
    Referenced from: BaseConfig
    ...
    

    testcase.zip

  16. added a commit that references this issue on Jun 15, 2021
    a261ab8
  17. Flet commented on Jun 15, 2021

    @Flet
    Member

    Hello! 👋

    I was able to get something working that resolves this issue in PR #38.

    Sanity checks by interested folks here would be cool!

  18. KnifeFed commented on Oct 25, 2021

    @KnifeFed

    Any news on this? Is it at all possible to have a working global installation of standardx?

  19. fviazzi commented on Jan 17, 2022

    @fviazzi

    In my case, using PR #38 and removing the setting standard.workingDirectories from my vsCode config file did the trick

  20. thorger commented on Jul 7, 2023

    @thorger

    Any news on it? I just installed 7.0.0 and I'm getting:

    npx standardx
    standardx: Unexpected linter output:

    Error: Failed to load config "standard" to extend from.
    Referenced from: BaseConfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions