@@ -34,7 +34,7 @@ let namingPath: string | undefined = undefined;
34
34
let eslintFolder : string | undefined = undefined ;
35
35
36
36
// Probe for the ESLint >=8.0.0 layout:
37
- for ( let currentModule : NodeModule = module ; ; ) {
37
+ for ( let currentModule : NodeModule = module ; ; ) {
38
38
if ( ! eslintrcBundlePath ) {
39
39
if ( currentModule . filename . endsWith ( 'eslintrc.cjs' ) ) {
40
40
// For ESLint >=8.0.0, all @eslint/eslintrc code is bundled at this path:
@@ -93,7 +93,7 @@ for (let currentModule: NodeModule = module; ; ) {
93
93
94
94
if ( ! eslintFolder ) {
95
95
// Probe for the ESLint >=7.12.0 layout:
96
- for ( let currentModule : NodeModule = module ; ; ) {
96
+ for ( let currentModule : NodeModule = module ; ; ) {
97
97
if ( ! configArrayFactoryPath ) {
98
98
// For ESLint >=7.12.0, config-array-factory.js is at this path:
99
99
// .../@eslint /eslintrc/lib/config-array-factory.js
@@ -154,7 +154,7 @@ if (!eslintFolder) {
154
154
155
155
if ( ! eslintFolder ) {
156
156
// Probe for the <7.12.0 layout:
157
- for ( let currentModule : NodeModule = module ; ; ) {
157
+ for ( let currentModule : NodeModule = module ; ; ) {
158
158
// For ESLint <7.12.0, config-array-factory.js was at this path:
159
159
// .../eslint/lib/cli-engine/config-array-factory.js
160
160
if ( / [ \\ / ] e s l i n t [ \\ / ] l i b [ \\ / ] c l i - e n g i n e [ \\ / ] c o n f i g - a r r a y - f a c t o r y \. j s $ / i. test ( currentModule . filename ) ) {
@@ -185,8 +185,8 @@ if (!eslintFolder) {
185
185
// This was tested with ESLint 6.1.0 .. 7.12.1.
186
186
throw new Error (
187
187
'Failed to patch ESLint because the calling module was not recognized.\n' +
188
- 'If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:\n' +
189
- 'https://github.com/microsoft/rushstack/issues'
188
+ 'If you are using a newer ESLint version that may be unsupported, please create a GitHub issue:\n' +
189
+ 'https://github.com/microsoft/rushstack/issues'
190
190
) ;
191
191
}
192
192
currentModule = currentModule . parent ;
@@ -204,18 +204,18 @@ if (isNaN(ESLINT_MAJOR_VERSION)) {
204
204
) ;
205
205
}
206
206
207
- if ( ! ( ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 8 ) ) {
207
+ if ( ! ( ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 9 ) ) {
208
208
throw new Error (
209
- 'The ESLint patch script has only been tested with ESLint version 6.x, 7.x, and 8 .x.' +
210
- ` (Your version: ${ eslintPackageVersion } )\n` +
211
- 'Consider reporting a GitHub issue:\n' +
212
- 'https://github.com/microsoft/rushstack/issues'
209
+ 'The ESLint patch script has only been tested with ESLint version 6.x, 7.x, 8.x, and 9 .x.' +
210
+ ` (Your version: ${ eslintPackageVersion } )\n` +
211
+ 'Consider reporting a GitHub issue:\n' +
212
+ 'https://github.com/microsoft/rushstack/issues'
213
213
) ;
214
214
}
215
215
216
216
// eslint-disable-next-line @typescript-eslint/no-explicit-any
217
217
let configArrayFactory : any ;
218
- if ( ESLINT_MAJOR_VERSION == = 8 ) {
218
+ if ( ESLINT_MAJOR_VERSION > = 8 ) {
219
219
configArrayFactory = require ( eslintrcBundlePath ! ) . Legacy . ConfigArrayFactory ;
220
220
} else {
221
221
configArrayFactory = require ( configArrayFactoryPath ! ) . ConfigArrayFactory ;
@@ -225,7 +225,7 @@ if (ESLINT_MAJOR_VERSION === 8) {
225
225
let ModuleResolver : { resolve : any } ;
226
226
// eslint-disable-next-line @typescript-eslint/no-explicit-any
227
227
let Naming : { normalizePackageName : any } ;
228
- if ( ESLINT_MAJOR_VERSION == = 8 ) {
228
+ if ( ESLINT_MAJOR_VERSION > = 8 ) {
229
229
ModuleResolver = require ( eslintrcBundlePath ! ) . Legacy . ModuleResolver ;
230
230
Naming = require ( eslintrcBundlePath ! ) . Legacy . naming ;
231
231
} else {
0 commit comments