Skip to content

Unable to use ESLint flat config for linting JavaScript #3570

@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

Labels

bugSomething isn't workingnostaleThis issue or pull request is not stale, keep it open

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions