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 {
70
70
return this . factory . getConfigArrayForFile ( fileName ) . extractConfig ( fileName ) ;
71
71
}
72
72
73
- private resolveESLintIntrinsicConfigPath ( name : "eslint-all" | "eslint-recommended" ) {
74
- let ret : string | undefined = undefined ;
73
+ private resolveESLintIntrinsicConfigPath ( name : "eslint-all" | "eslint-recommended" ) : string | undefined {
75
74
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
+ }
80
86
}
81
- return ret ;
87
+ return undefined ;
82
88
}
83
89
}
You can’t perform that action at this time.
0 commit comments