Skip to content

Commit 549b5e2

Browse files
authored
[heft-lint-plugin] Add support for ESLint 9 (#5219)
* Remove old eslint build tests * Remove unnecessary local-eslint-config dependencies * Fix dependencies in various projects * remove unused rules package * Update lockfile * Fix eslint configs for eslint 9 * Update eslint plugin for eslint 9 * Add eslint 9 test project * Fix hashing for ESLint 9 * Fix typings and comments * Re-introduce the previous eslint version tests * Pull more things back in from main * Update flat configs for new paths * Add support for previous eslint versions back to lint plugin * Fix eslint config for eslint 9 test * Rush update * Rush change * Update a bunch of packages to the new eslint * Fix a rule disablement * Simplify linter * Update projects that consume local-eslint-config * Undo changes to web rig * Add flat config versions to the web rig * Update consumers of local-web-rig * Convert rigs * Convert more projects * Remove unused eslint ignores * Fix file matcher for test files * Fix file matcher for test files * Allow fix command to be passed to rush build * Update more projects * Update the remaining projects, except for the eslint bulk suppressions * Remove usage of defineConfig * Remove the local rig non-flat equivalents * Fix build * Add patch dependency back to local rigs * Add dedicated flat config test * Update patch file generation to be compatible with flat config * Fix standard bulk suppressions test * Update eslint patch to add support for eslint 9 * Update suppressions * Rush change * Update bulk and patch for eslint 9 support * Add a patch file to the eslint config * Fix references * Simplify build * Fix snapshots * Fix patch handling of renaming of private methods * Update bulk suppressions * Update readme * Rush update * Merge changes to lint plugin * PR feedback * Re-add the legacy configs to heft-node-rig and heft-web-rig * PR feedback * PR feedback * Update the sarif formatter to generate code snippets based on location * Rush update * Update new projects to use eslint 9 * Rush change
1 parent 56ec720 commit 549b5e2

File tree

536 files changed

+8550
-3029
lines changed

Some content is hidden

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

536 files changed

+8550
-3029
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ These GitHub repositories provide supplementary resources for Rush Stack:
163163
| [/build-tests/eslint-7-7-test](./build-tests/eslint-7-7-test/) | This project contains a build test to validate ESLint 7.7.0 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin) |
164164
| [/build-tests/eslint-7-test](./build-tests/eslint-7-test/) | This project contains a build test to validate ESLint 7 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin) |
165165
| [/build-tests/eslint-8-test](./build-tests/eslint-8-test/) | This project contains a build test to validate ESLint 8 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin) |
166+
| [/build-tests/eslint-9-test](./build-tests/eslint-9-test/) | This project contains a build test to validate ESLint 9 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin) |
166167
| [/build-tests/eslint-bulk-suppressions-test](./build-tests/eslint-bulk-suppressions-test/) | Sample code to test eslint bulk suppressions |
168+
| [/build-tests/eslint-bulk-suppressions-test-flat](./build-tests/eslint-bulk-suppressions-test-flat/) | Sample code to test eslint bulk suppressions with flat configs |
167169
| [/build-tests/eslint-bulk-suppressions-test-legacy](./build-tests/eslint-bulk-suppressions-test-legacy/) | Sample code to test eslint bulk suppressions for versions of eslint < 8.57.0 |
168170
| [/build-tests/hashed-folder-copy-plugin-webpack5-test](./build-tests/hashed-folder-copy-plugin-webpack5-test/) | Building this project exercises @rushstack/hashed-folder-copy-plugin with Webpack 5. NOTE - THIS TEST IS CURRENTLY EXPECTED TO BE BROKEN |
169171
| [/build-tests/heft-copy-files-test](./build-tests/heft-copy-files-test/) | Building this project tests copying files with Heft |

apps/api-documenter/.eslintrc.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/api-documenter/eslint.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
5+
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');
6+
7+
module.exports = [
8+
...nodeTrustedToolProfile,
9+
...friendlyLocalsMixin,
10+
{
11+
files: ['**/*.ts', '**/*.tsx'],
12+
languageOptions: {
13+
parserOptions: {
14+
tsconfigRootDir: __dirname
15+
}
16+
},
17+
rules: {
18+
'no-console': 'off'
19+
}
20+
}
21+
];

apps/api-documenter/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@rushstack/heft": "workspace:*",
3333
"@types/js-yaml": "3.12.1",
3434
"@types/resolve": "1.20.2",
35+
"eslint": "~9.25.1",
3536
"local-node-rig": "workspace:*"
3637
}
3738
}

apps/api-documenter/src/markdown/test/CustomMarkdownEmitter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ test('render Markdown from TSDoc', () => {
174174
output.appendNodes([
175175
new DocHeading({ configuration, title: 'After a table' }),
176176
new DocParagraph({ configuration }, [
177-
new DocPlainText({ configuration, text: 'just checking lines after a table' }),
177+
new DocPlainText({ configuration, text: 'just checking lines after a table' })
178178
])
179179
]);
180180

apps/cpu-profile-summarizer/.eslintrc.js

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
5+
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');
6+
7+
module.exports = [
8+
...nodeTrustedToolProfile,
9+
...friendlyLocalsMixin,
10+
{
11+
files: ['**/*.ts', '**/*.tsx'],
12+
languageOptions: {
13+
parserOptions: {
14+
tsconfigRootDir: __dirname
15+
}
16+
},
17+
rules: {
18+
'no-console': 'off'
19+
}
20+
}
21+
];

apps/cpu-profile-summarizer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"devDependencies": {
2525
"@rushstack/heft": "workspace:*",
26+
"eslint": "~9.25.1",
2627
"local-node-rig": "workspace:*"
2728
}
2829
}

apps/heft/.eslintrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2-
require('local-eslint-config/patch/modern-module-resolution');
2+
require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
33
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4-
require('local-eslint-config/patch/custom-config-package-names');
4+
require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
55

66
module.exports = {
7-
extends: ['local-eslint-config/profile/node-trusted-tool', 'local-eslint-config/mixins/friendly-locals'],
7+
extends: [
8+
'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
9+
'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
10+
],
811
parserOptions: { tsconfigRootDir: __dirname }
912
};

apps/heft/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@microsoft/api-extractor": "workspace:*",
5252
"@rushstack/heft": "0.73.2",
5353
"@types/watchpack": "2.4.0",
54-
"decoupled-local-node-rig": "workspace:*",
55-
"local-eslint-config": "workspace:*"
54+
"decoupled-local-node-rig": "workspace:*"
5655
}
5756
}

0 commit comments

Comments
 (0)