Open leetdavid opened 3 months ago
Next.js currently uses an ESLint version that predates v9.0.0, which does not recognize the eslint.config.js configuration file. This file format was introduced in ESLint v9.0.0. To support eslint.config.js, an update to ESLint v9.0.0 or newer is required. I think this change is a feature update rather than a bug fix, as it involves adopting a new major version of ESLint that includes enhancements and new configuration capabilities.
Ok, that explains a lot. Thanks for the insight!
Next.js currently uses an ESLint version that predates v9.0.0, which does not recognize the eslint.config.js configuration file. This file format was introduced in ESLint v9.0.0. To support eslint.config.js, an update to ESLint v9.0.0 or newer is required. I think this change is a feature update rather than a bug fix, as it involves adopting a new major version of ESLint that includes enhancements and new configuration capabilities.
Actually ESLint v8 introduced the flat config format; v9 made it the default config format (that you have to opt out of if you want to continue the legacy format). So the flat config should still work with ESLint V8.
Link to the code that reproduces this issue
https://github.com/leetdavid/nextjstest
To Reproduce
pnpm create next-app
with ESLint Enabled.eslintrc.json
toeslint.config.js
pnpm lint
and it will create yet another.eslintrc.json
after prompting.Current vs. Expected behavior
I expect
next lint
to recognize theeslint.config.js
file, but it does not.Provide environment information
Which area(s) are affected? (Select all that apply)
ESLint (eslint-config-next)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I renamed the
.eslintrc.json
file toeslint.config.js
and the above happens.I am using turborepo. Renaming my eslint file to
.eslintrc.json
file results in another error:pnpm lint
apps/web/.eslintrc.json
(my next.js project path's .eslintrc.json, after renaming fromeslint.config.js
)tools/eslint-config/base.js
tools/eslint-config/nextjs.js
NEXT-3316