File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,20 @@ export class ESLintConfigProvider implements ConfigProvider {
7070 return this . factory . getConfigArrayForFile ( fileName ) . extractConfig ( fileName ) ;
7171 }
7272
73- private resolveESLintIntrinsicConfigPath ( name : "eslint-all" | "eslint-recommended" ) {
74- let ret : string | undefined = undefined ;
73+ private resolveESLintIntrinsicConfigPath ( name : "eslint-all" | "eslint-recommended" ) : string | undefined {
7574 try {
76- const fragments = require . resolve ( "eslint" ) . split ( "node_modules/eslint" ) ;
77- ret = [ ...fragments . slice ( 0 , fragments . length - 1 ) , `/conf/${ name } .js` ] . join ( "node_modules/eslint" ) ;
78- } catch ( e : any ) {
79- this . log ( e ) ;
75+ // Config js files move to @eslint /js package sinse ESLint v8.35.
76+ // https://github.com/eslint/eslint/pull/16844
77+ return require . resolve ( `@eslint/js/src/configs/${ name } ` ) ;
78+ } catch {
79+ try {
80+ // For legacy ESLint < v8.35
81+ const fragments = require . resolve ( "eslint" ) . split ( "node_modules/eslint" ) ;
82+ return [ ...fragments . slice ( 0 , fragments . length - 1 ) , `/conf/${ name } .js` ] . join ( "node_modules/eslint" ) ;
83+ } catch ( e ) {
84+ this . log ( String ( e ) ) ;
85+ }
8086 }
81- return ret ;
87+ return undefined ;
8288 }
8389}
You can’t perform that action at this time.
0 commit comments