Skip to content

Commit b9c0e3d

Browse files
authored
feat(eslint): rename eslint.config.js to eslint.config.cjs to resolve them as CommonJS (#29334)
This PR updates our generators to use `eslint.config.cjs` instead of `eslint.config.js` so that Node resolution will treat it as CommonJS. This solves an issue where having `"type": "module"` in `package.json` will result in an error when Node tries to resolve the config file as ESM. Also allows us to clean up out Remix generators to not have to rename to `eslint.config.cjs` to solve the same issue. <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent a675bd2 commit b9c0e3d

File tree

58 files changed

+774
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+774
-336
lines changed

docs/generated/packages/eslint-plugin/documents/dependency-checks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Sometimes we intentionally want to add or remove a dependency from our `package.
6969
"checkObsoleteDependencies": true, // toggle to disable
7070
"checkVersionMismatches": true, // toggle to disable
7171
"ignoredDependencies": ["lodash"], // these libs will be omitted from checks
72-
"ignoredFiles": ["webpack.config.js", "eslint.config.js"], // list of files that should be skipped for check
72+
"ignoredFiles": ["webpack.config.js", "eslint.config.cjs"], // list of files that should be skipped for check
7373
"includeTransitiveDependencies": true, // collect dependencies transitively from children
7474
"useLocalPathsForWorkspaceDependencies": true // toggle to disable
7575
}

docs/generated/packages/eslint/executors/lint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"default": true
141141
}
142142
},
143-
"examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Flat Config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag. The new `Flat Config` is now also supported:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \"eslint.config.js\"\n }\n}\n```\n\n**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.js`. Built-in migrations and generators support only `.eslintrc.json` at the moment.\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
143+
"examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Flat Config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag. The new `Flat Config` is now also supported:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \"eslint.config.cjs\"\n }\n}\n```\n\n**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.cjs`. Built-in migrations and generators support only `.eslintrc.json` at the moment.\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
144144
"presets": []
145145
},
146146
"hasher": "./src/executors/lint/hasher",

docs/shared/packages/eslint/dependency-checks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Sometimes we intentionally want to add or remove a dependency from our `package.
6969
"checkObsoleteDependencies": true, // toggle to disable
7070
"checkVersionMismatches": true, // toggle to disable
7171
"ignoredDependencies": ["lodash"], // these libs will be omitted from checks
72-
"ignoredFiles": ["webpack.config.js", "eslint.config.js"], // list of files that should be skipped for check
72+
"ignoredFiles": ["webpack.config.js", "eslint.config.cjs"], // list of files that should be skipped for check
7373
"includeTransitiveDependencies": true, // collect dependencies transitively from children
7474
"useLocalPathsForWorkspaceDependencies": true // toggle to disable
7575
}

docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ See below a direct comparison between `JSON`, `JS` and `Flat` config:
1010
{% tabs %}
1111
{% tab label="Flat" %}
1212

13-
```js {% fileName="eslint.config.js" %}
13+
```js {% fileName="eslint.config.cjs" %}
1414
// the older versions were magically interpreting all the imports
1515
// in flat config we do it explicitly
1616
const nxPlugin = require('@nx/eslint-plugin');
1717
const js = require('@eslint/js');
18-
const baseConfig = require('./eslint.base.config.js');
18+
const baseConfig = require('./eslint.base.config.cjs');
1919
const globals = require('globals');
2020
const jsoncParser = require('jsonc-eslint-parser');
2121
const tsParser = require('@typescript-eslint/parser');

e2e/angular/src/misc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('Move Angular Project', () => {
3939
expect(moveOutput).toContain(`CREATE ${newPath}/tsconfig.app.json`);
4040
expect(moveOutput).toContain(`CREATE ${newPath}/tsconfig.json`);
4141
expect(moveOutput).toContain(`CREATE ${newPath}/tsconfig.spec.json`);
42-
expect(moveOutput).toContain(`CREATE ${newPath}/eslint.config.js`);
42+
expect(moveOutput).toContain(`CREATE ${newPath}/eslint.config.cjs`);
4343
expect(moveOutput).toContain(`CREATE ${newPath}/public/favicon.ico`);
4444
expect(moveOutput).toContain(`CREATE ${newPath}/src/index.html`);
4545
expect(moveOutput).toContain(`CREATE ${newPath}/src/main.ts`);

e2e/angular/src/projects.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ describe('Angular Projects', () => {
164164

165165
it('should lint correctly with eslint and handle external HTML files and inline templates', async () => {
166166
// disable the prefer-standalone rule for app1 which is not standalone
167-
let app1EslintConfig = readFile(`${app1}/eslint.config.js`);
167+
let app1EslintConfig = readFile(`${app1}/eslint.config.cjs`);
168168
app1EslintConfig = app1EslintConfig.replace(
169169
`'@angular-eslint/directive-selector': [`,
170170
`'@angular-eslint/prefer-standalone': 'off',
171171
'@angular-eslint/directive-selector': [`
172172
);
173-
updateFile(`${app1}/eslint.config.js`, app1EslintConfig);
173+
updateFile(`${app1}/eslint.config.cjs`, app1EslintConfig);
174174

175175
// check apps and lib pass linting for initial generated code
176176
runCLI(`run-many --target lint --projects=${app1},${lib1} --parallel`);

e2e/eslint/src/linter-legacy.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ describe('Linter (legacy)', () => {
150150
env: { NX_ADD_PLUGINS: 'false' },
151151
});
152152
checkFilesExist(
153-
'eslint.config.js',
154-
`apps/${myapp}/eslint.config.js`,
155-
`libs/${mylib}/eslint.config.js`,
156-
`libs/${mylib2}/eslint.config.js`
153+
'eslint.config.cjs',
154+
`apps/${myapp}/eslint.config.cjs`,
155+
`libs/${mylib}/eslint.config.cjs`,
156+
`libs/${mylib2}/eslint.config.cjs`
157157
);
158158
checkFilesDoNotExist(
159159
'.eslintrc.json',
@@ -164,12 +164,12 @@ describe('Linter (legacy)', () => {
164164

165165
// move eslint.config one step up
166166
// to test the absence of the flat eslint config in the project root folder
167-
renameFile(`libs/${mylib2}/eslint.config.js`, `libs/eslint.config.js`);
167+
renameFile(`libs/${mylib2}/eslint.config.cjs`, `libs/eslint.config.cjs`);
168168
updateFile(
169-
`libs/eslint.config.js`,
170-
readFile(`libs/eslint.config.js`).replace(
171-
`../../eslint.config.js`,
172-
`../eslint.config.js`
169+
`libs/eslint.config.cjs`,
170+
readFile(`libs/eslint.config.cjs`).replace(
171+
`../../eslint.config.cjs`,
172+
`../eslint.config.cjs`
173173
)
174174
);
175175

@@ -202,9 +202,9 @@ describe('Linter (legacy)', () => {
202202
env: { NX_ADD_PLUGINS: 'false' },
203203
});
204204
checkFilesExist(
205-
'eslint.config.js',
206-
`${mylib}/eslint.config.js`,
207-
'eslint.base.config.js'
205+
'eslint.config.cjs',
206+
`${mylib}/eslint.config.cjs`,
207+
'eslint.base.config.cjs'
208208
);
209209
checkFilesDoNotExist(
210210
'.eslintrc.json',

e2e/eslint/src/linter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ describe('Linter', () => {
615615
runCLI(`generate @nx/js:lib ${jsLib} --linter eslint`);
616616

617617
checkFilesExist(
618-
`${reactLib}/eslint.config.js`,
619-
`${jsLib}/eslint.config.js`
618+
`${reactLib}/eslint.config.cjs`,
619+
`${jsLib}/eslint.config.cjs`
620620
);
621621
checkFilesDoNotExist(
622622
`${reactLib}/.eslintrc.json`,

e2e/js/src/js-packaging.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,6 @@ describe('packaging libs', () => {
178178
`libs/${swcEsmLib}/src/index.ts`,
179179
`export * from './lib/${swcEsmLib}.js';`
180180
);
181-
// We also need to update the eslint config file extensions to be explicitly commonjs
182-
// TODO: re-evaluate this once we support ESM eslint configs
183-
renameFile(
184-
`libs/${tscEsmLib}/eslint.config.js`,
185-
`libs/${tscEsmLib}/eslint.config.cjs`
186-
);
187-
renameFile(
188-
`libs/${swcEsmLib}/eslint.config.js`,
189-
`libs/${swcEsmLib}/eslint.config.cjs`
190-
);
191181

192182
// Add additional entry points for `exports` field
193183
updateJson(join('libs', tscLib, 'project.json'), (json) => {

e2e/nx/src/__snapshots__/extras.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports[`Extra Nx Misc Tests task graph inputs should correctly expand dependent
2626
],
2727
"lib-base-123": [
2828
"libs/lib-base-123/README.md",
29-
"libs/lib-base-123/eslint.config.js",
29+
"libs/lib-base-123/eslint.config.cjs",
3030
"libs/lib-base-123/jest.config.ts",
3131
"libs/lib-base-123/package.json",
3232
"libs/lib-base-123/project.json",
@@ -39,7 +39,7 @@ exports[`Extra Nx Misc Tests task graph inputs should correctly expand dependent
3939
],
4040
"lib-dependent-123": [
4141
"libs/lib-dependent-123/README.md",
42-
"libs/lib-dependent-123/eslint.config.js",
42+
"libs/lib-dependent-123/eslint.config.cjs",
4343
"libs/lib-dependent-123/jest.config.ts",
4444
"libs/lib-dependent-123/package.json",
4545
"libs/lib-dependent-123/project.json",

packages/angular/src/generators/library/library.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,14 +1204,14 @@ describe('lib', () => {
12041204
describe('--linter', () => {
12051205
describe('eslint', () => {
12061206
it('should add valid eslint JSON configuration which extends from Nx presets (flat config)', async () => {
1207-
tree.write('eslint.config.js', '');
1207+
tree.write('eslint.config.cjs', '');
12081208

12091209
await runLibraryGeneratorWithOpts({ linter: Linter.EsLint });
12101210

1211-
const eslintConfig = tree.read('my-lib/eslint.config.js', 'utf-8');
1211+
const eslintConfig = tree.read('my-lib/eslint.config.cjs', 'utf-8');
12121212
expect(eslintConfig).toMatchInlineSnapshot(`
12131213
"const nx = require("@nx/eslint-plugin");
1214-
const baseConfig = require("../eslint.config.js");
1214+
const baseConfig = require("../eslint.config.cjs");
12151215
12161216
module.exports = [
12171217
...baseConfig,

packages/angular/src/generators/ng-add/__snapshots__/migrate-from-angular-cli.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ exports[`workspace move to nx layout should create nx.json 1`] = `
9393
"!{projectRoot}/**/*.spec.[jt]s",
9494
"!{projectRoot}/karma.conf.js",
9595
"!{projectRoot}/.eslintrc.json",
96-
"!{projectRoot}/eslint.config.js",
96+
"!{projectRoot}/eslint.config.cjs",
9797
],
9898
"sharedGlobals": [],
9999
},
@@ -104,7 +104,7 @@ exports[`workspace move to nx layout should create nx.json 1`] = `
104104
"default",
105105
"{workspaceRoot}/.eslintrc.json",
106106
"{workspaceRoot}/.eslintignore",
107-
"{workspaceRoot}/eslint.config.js",
107+
"{workspaceRoot}/eslint.config.cjs",
108108
],
109109
},
110110
"build": {
@@ -129,7 +129,7 @@ exports[`workspace move to nx layout should create nx.json 1`] = `
129129
"inputs": [
130130
"default",
131131
"{workspaceRoot}/.eslintrc.json",
132-
"{workspaceRoot}/eslint.config.js",
132+
"{workspaceRoot}/eslint.config.cjs",
133133
],
134134
},
135135
"test": {

packages/angular/src/generators/ng-add/utilities/workspace.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export function createNxJson(
6464
]
6565
: []),
6666
...(targets.lint
67-
? ['!{projectRoot}/.eslintrc.json', '!{projectRoot}/eslint.config.js']
67+
? [
68+
'!{projectRoot}/.eslintrc.json',
69+
'!{projectRoot}/eslint.config.cjs',
70+
]
6871
: []),
6972
].filter(Boolean),
7073
},
@@ -85,7 +88,7 @@ export function createNxJson(
8588
inputs: [
8689
'default',
8790
'{workspaceRoot}/.eslintrc.json',
88-
'{workspaceRoot}/eslint.config.js',
91+
'{workspaceRoot}/eslint.config.cjs',
8992
],
9093
cache: true,
9194
}

packages/cypress/src/generators/base-setup/files/tsconfig/ts-solution/__directory__/tsconfig.json__ext__

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
<%_ if (jsx) { _%>"<%= offsetFromProjectRoot %>**/*.cy.jsx",<%_ } _%>
1717
"<%= offsetFromProjectRoot %>**/*.d.ts"
1818
],
19-
"exclude": ["out-tsc", "test-output"<% if (linter === 'eslint') { %>, "eslint.config.js"<% } %>]
19+
"exclude": ["out-tsc", "test-output"<% if (linter === 'eslint') { %>, "eslint.config.js", "eslint.config.cjs", "eslint.config.mjs"<% } %>]
2020
}

packages/eslint-plugin/src/flat-configs/javascript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const isPrettierAvailable =
2424
*/
2525
export default tseslint.config(
2626
{
27-
files: ['**/*.js', '**/*.jsx'],
27+
files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
2828
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
2929
},
3030
{
@@ -40,7 +40,7 @@ export default tseslint.config(
4040
plugins: { '@typescript-eslint': tseslint.plugin },
4141
},
4242
{
43-
files: ['**/*.js', '**/*.jsx'],
43+
files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
4444
rules: {
4545
'@typescript-eslint/explicit-member-accessibility': 'off',
4646
'@typescript-eslint/explicit-module-boundary-types': 'off',

packages/eslint-plugin/src/flat-configs/typescript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const isPrettierAvailable =
1515
*/
1616
export default tseslint.config(
1717
{
18-
files: ['**/*.ts', '**/*.tsx'],
18+
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
1919
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
2020
},
2121
{
@@ -30,7 +30,7 @@ export default tseslint.config(
3030
},
3131
},
3232
{
33-
files: ['**/*.ts', '**/*.tsx'],
33+
files: ['**/*.ts', '**/*.tsx', , '**/*.cts', '**/*.mts'],
3434
rules: {
3535
'@typescript-eslint/explicit-member-accessibility': 'off',
3636
'@typescript-eslint/explicit-module-boundary-types': 'off',

packages/eslint/docs/eslint-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ We can also set this via project configuration as a default option.
9696
"outputs": ["{options.outputFile}"],
9797
"options": {
9898
"lintFilePatterns": ["apps/frontend/**/*.ts"],
99-
"eslintConfig": "eslint.config.js"
99+
"eslintConfig": "eslint.config.cjs"
100100
}
101101
}
102102
```
103103

104-
**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.js`. Built-in migrations and generators support only `.eslintrc.json` at the moment.
104+
**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.cjs`. Built-in migrations and generators support only `.eslintrc.json` at the moment.
105105

106106
{% /tab %}
107107
{% /tabs %}

packages/eslint/migrations.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"version": "20.2.0-beta.5",
2525
"description": "Update TypeScript ESLint packages to v8.13.0 if they are already on v8",
2626
"implementation": "./src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0"
27+
},
28+
"add-file-extensions-to-overrides": {
29+
"version": "20.3.0-beta.1",
30+
"description": "Update ESLint flat config to include .cjs, .mjs, .cts, and .mts files in overrides (if needed)",
31+
"implementation": "./src/migrations/update-20-3-0/add-file-extensions-to-overrides"
2732
}
2833
},
2934
"packageJsonUpdates": {

0 commit comments

Comments
 (0)