File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/next/src/lib/eslint Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,14 @@ async function lint(
135
135
136
136
const mod = await Promise . resolve ( require ( deps . resolved . get ( 'eslint' ) ! ) )
137
137
138
- const { ESLint } = mod
138
+ const { loadESLint } = mod
139
+ const ESLint = await loadESLint ( {
140
+ // To use legacy configs (.eslintrc*), user has to pass `ESLINT_USE_FLAT_CONFIG=false`.
141
+ // https://eslint.org/blog/2024/04/eslint-v9.0.0-released/#flat-config-is-now-the-default-and-has-some-changes
142
+ // The return value is `LegacyESLint`.
143
+ // https://github.com/eslint/eslint/blob/1def4cdfab1f067c5089df8b36242cdf912b0eb6/lib/types/index.d.ts#L1609-L1613
144
+ useFlatConfig : process . env . ESLINT_USE_FLAT_CONFIG !== 'false' ,
145
+ } )
139
146
let eslintVersion = ESLint ?. version ?? mod . CLIEngine ?. version
140
147
141
148
if ( ! eslintVersion || semver . lt ( eslintVersion , '7.0.0' ) ) {
You can’t perform that action at this time.
0 commit comments