Skip to content

Bug: sharable configs not loaded through CLI #15697

@fedeci

Description

@fedeci

Environment

Node version: v16.13.1
npm version: v8.4.1
Local ESLint version: v8.11.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 21.2.0

What parser are you using?

@typescript-eslint/parser

What did you do?

Run:
npm i @fig/eslint-config-autocomplete
npx eslint -c @fig/autocomplete --fix ..

What did you expect to happen?

I expect to correctly load the sharable config using the --config (-c) flag from the CLI.

What actually happened?

Error: Cannot read config file: /Users/federico/Documents/withfig.nosync/autocomplete/@fig/autocomplete
Error: ENOENT: no such file or directory, open '/Users/federico/Documents/withfig.nosync/autocomplete/@fig/autocomplete'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at readFile (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2476:35)
    at loadLegacyConfigFile (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2541:60)
    at loadConfigFile (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2656:20)
    at ConfigArrayFactory._loadConfigData (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2947:42)
    at ConfigArrayFactory.loadFile (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2813:40)
    at createCLIConfigArray (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3621:35)
    at new CascadingConfigArrayFactory (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3697:29)
    at new CLIEngine (/Users/federico/Documents/withfig.nosync/autocomplete/node_modules/eslint/lib/cli-engine/cli-engine.js:607:36)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Also npx eslint -c "@fig/autocomplete" --fix . and npx eslint -c @fig/eslint-config-autocomplete --fix . don't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionworks as intendedThe behavior described in this issue is working correctly

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions