@@ -34,7 +34,7 @@ let namingPath: string | undefined = undefined;
3434let eslintFolder : string | undefined = undefined ;
3535
3636// Probe for the ESLint >=8.0.0 layout:
37- for ( let currentModule : NodeModule = module ; ; ) {
37+ for ( let currentModule : NodeModule = module ; ; ) {
3838 if ( ! eslintrcBundlePath ) {
3939 if ( currentModule . filename . endsWith ( 'eslintrc.cjs' ) ) {
4040 // For ESLint >=8.0.0, all @eslint/eslintrc code is bundled at this path:
@@ -93,7 +93,7 @@ for (let currentModule: NodeModule = module; ; ) {
9393
9494if ( ! eslintFolder ) {
9595 // Probe for the ESLint >=7.12.0 layout:
96- for ( let currentModule : NodeModule = module ; ; ) {
96+ for ( let currentModule : NodeModule = module ; ; ) {
9797 if ( ! configArrayFactoryPath ) {
9898 // For ESLint >=7.12.0, config-array-factory.js is at this path:
9999 // .../@eslint /eslintrc/lib/config-array-factory.js
@@ -154,7 +154,7 @@ if (!eslintFolder) {
154154
155155if ( ! eslintFolder ) {
156156 // Probe for the <7.12.0 layout:
157- for ( let currentModule : NodeModule = module ; ; ) {
157+ for ( let currentModule : NodeModule = module ; ; ) {
158158 // For ESLint <7.12.0, config-array-factory.js was at this path:
159159 // .../eslint/lib/cli-engine/config-array-factory.js
160160 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) {
185185 // This was tested with ESLint 6.1.0 .. 7.12.1.
186186 throw new Error (
187187 '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'
190190 ) ;
191191 }
192192 currentModule = currentModule . parent ;
@@ -204,18 +204,18 @@ if (isNaN(ESLINT_MAJOR_VERSION)) {
204204 ) ;
205205}
206206
207- if ( ! ( ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 8 ) ) {
207+ if ( ! ( ESLINT_MAJOR_VERSION >= 6 && ESLINT_MAJOR_VERSION <= 9 ) ) {
208208 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'
213213 ) ;
214214}
215215
216216// eslint-disable-next-line @typescript-eslint/no-explicit-any
217217let configArrayFactory : any ;
218- if ( ESLINT_MAJOR_VERSION == = 8 ) {
218+ if ( ESLINT_MAJOR_VERSION > = 8 ) {
219219 configArrayFactory = require ( eslintrcBundlePath ! ) . Legacy . ConfigArrayFactory ;
220220} else {
221221 configArrayFactory = require ( configArrayFactoryPath ! ) . ConfigArrayFactory ;
@@ -225,7 +225,7 @@ if (ESLINT_MAJOR_VERSION === 8) {
225225let ModuleResolver : { resolve : any } ;
226226// eslint-disable-next-line @typescript-eslint/no-explicit-any
227227let Naming : { normalizePackageName : any } ;
228- if ( ESLINT_MAJOR_VERSION == = 8 ) {
228+ if ( ESLINT_MAJOR_VERSION > = 8 ) {
229229 ModuleResolver = require ( eslintrcBundlePath ! ) . Legacy . ModuleResolver ;
230230 Naming = require ( eslintrcBundlePath ! ) . Legacy . naming ;
231231} else {
0 commit comments