Skip to content

Unable to use ESLint flat config for linting JavaScript #3570

Closed as not planned
@theetrain

Description

@theetrain

Describe the bug

I tried pointing MegaLinter to my eslint.config.js, but it yielded the error:

❌ Linted [JAVASCRIPT] files with [eslint]: Found 1 error(s) - (1.49s)
- Using [eslint v8.57.0] https://megalinter.io/7.11.1/descriptors/javascript_eslint
- MegaLinter key: [JAVASCRIPT_ES]
- Rules config: [/eslint.config.js]
- Number of files analyzed: [20]
--Error detail:
Invalid option '--eslintrc' - perhaps you meant '--ignore'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.

To Reproduce

  1. Add these settings to .mega-linter.yml
JAVASCRIPT_ES_CONFIG_FILE: ./eslint.config.js
  1. Run megalinter

Expected behavior

Flat ESLint config file is picked up, and runs without error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O: stale 🤖This issue or pull request is stale, it will be closed if there is no activitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions