Skip to content

[heft-lint-plugin] Add support for ESLint 9 #5219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
85d3a0e
Remove old eslint build tests
D4N14L Apr 25, 2025
25bf4b6
Remove unnecessary local-eslint-config dependencies
D4N14L Apr 25, 2025
d929a0c
Fix dependencies in various projects
D4N14L Apr 25, 2025
4ee992e
remove unused rules package
D4N14L Apr 25, 2025
76916de
Update lockfile
D4N14L Apr 25, 2025
b30b955
Fix eslint configs for eslint 9
D4N14L May 2, 2025
7d2428e
Update eslint plugin for eslint 9
D4N14L May 2, 2025
510cdb3
Add eslint 9 test project
D4N14L May 2, 2025
bfb324d
Fix hashing for ESLint 9
D4N14L May 2, 2025
8533235
Fix typings and comments
D4N14L May 2, 2025
5948b29
Re-introduce the previous eslint version tests
D4N14L May 2, 2025
dc7b734
Pull more things back in from main
D4N14L May 3, 2025
20ca637
Update flat configs for new paths
D4N14L May 3, 2025
a532f59
Add support for previous eslint versions back to lint plugin
D4N14L May 3, 2025
2220db3
Fix eslint config for eslint 9 test
D4N14L May 3, 2025
0275b74
Merge branch 'main' of https://github.com/microsoft/rushstack into us…
D4N14L May 3, 2025
9623362
Rush update
D4N14L May 3, 2025
4e0d5ac
Rush change
D4N14L May 3, 2025
64d7ef8
Update a bunch of packages to the new eslint
D4N14L May 6, 2025
e89d121
Fix a rule disablement
D4N14L May 6, 2025
89d6979
Simplify linter
D4N14L May 6, 2025
953e09b
Update projects that consume local-eslint-config
D4N14L May 6, 2025
0095e28
Merge branch 'main' of https://github.com/microsoft/rushstack into us…
D4N14L May 6, 2025
55af9c1
Undo changes to web rig
D4N14L May 6, 2025
3ec636a
Add flat config versions to the web rig
D4N14L May 6, 2025
6fea2e0
Update consumers of local-web-rig
D4N14L May 6, 2025
d90a0cf
Convert rigs
D4N14L May 6, 2025
0083919
Convert more projects
D4N14L May 7, 2025
3e4776e
Remove unused eslint ignores
D4N14L May 7, 2025
892f1d9
Fix file matcher for test files
D4N14L May 7, 2025
a244d4e
Fix file matcher for test files
D4N14L May 7, 2025
1012b1c
Allow fix command to be passed to rush build
D4N14L May 7, 2025
b069e39
Update more projects
D4N14L May 7, 2025
d9a6bc6
Update the remaining projects, except for the eslint bulk suppressions
D4N14L May 7, 2025
bb878d2
Remove usage of defineConfig
D4N14L May 8, 2025
9eca36a
Remove the local rig non-flat equivalents
D4N14L May 22, 2025
72177be
Merge branch 'main' of https://github.com/microsoft/rushstack into us…
D4N14L May 22, 2025
d10ab8a
Fix build
D4N14L May 23, 2025
20255fb
Add patch dependency back to local rigs
D4N14L May 23, 2025
1e64ae1
Add dedicated flat config test
D4N14L May 24, 2025
f1e702a
Update patch file generation to be compatible with flat config
D4N14L May 24, 2025
d23b863
Fix standard bulk suppressions test
D4N14L Jun 3, 2025
057ebe4
Update eslint patch to add support for eslint 9
D4N14L Jun 3, 2025
27332f7
Update suppressions
D4N14L Jun 3, 2025
92fba16
Merge branch 'main' of https://github.com/microsoft/rushstack into us…
D4N14L Jun 3, 2025
3658650
Rush change
D4N14L Jun 3, 2025
7edace0
Update bulk and patch for eslint 9 support
D4N14L Jun 3, 2025
1a2c628
Add a patch file to the eslint config
D4N14L Jun 3, 2025
735b2fa
Fix references
D4N14L Jun 3, 2025
686bf55
Simplify build
D4N14L Jun 4, 2025
572a58c
Fix snapshots
D4N14L Jun 4, 2025
bf62d22
Fix patch handling of renaming of private methods
D4N14L Jun 4, 2025
3b18dec
Update bulk suppressions
D4N14L Jun 4, 2025
8a6079f
Update readme
D4N14L Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ These GitHub repositories provide supplementary resources for Rush Stack:
| [/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) |
| [/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) |
| [/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) |
| [/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) |
| [/build-tests/eslint-bulk-suppressions-test](./build-tests/eslint-bulk-suppressions-test/) | Sample code to test eslint bulk suppressions |
| [/build-tests/eslint-bulk-suppressions-test-flat](./build-tests/eslint-bulk-suppressions-test-flat/) | Sample code to test eslint bulk suppressions with flat configs |
| [/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 |
| [/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 |
| [/build-tests/heft-copy-files-test](./build-tests/heft-copy-files-test/) | Building this project tests copying files with Heft |
Expand Down
21 changes: 0 additions & 21 deletions apps/api-documenter/.eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions apps/api-documenter/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
},
rules: {
'no-console': 'off'
}
}
];
1 change: 1 addition & 0 deletions apps/api-documenter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@rushstack/heft": "workspace:*",
"@types/js-yaml": "3.12.1",
"@types/resolve": "1.20.2",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*"
}
}
21 changes: 0 additions & 21 deletions apps/cpu-profile-summarizer/.eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions apps/cpu-profile-summarizer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
},
rules: {
'no-console': 'off'
}
}
];
1 change: 1 addition & 0 deletions apps/cpu-profile-summarizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*"
}
}
9 changes: 6 additions & 3 deletions apps/heft/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('local-eslint-config/patch/modern-module-resolution');
require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
require('local-eslint-config/patch/custom-config-package-names');
require('decoupled-local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');

module.exports = {
extends: ['local-eslint-config/profile/node-trusted-tool', 'local-eslint-config/mixins/friendly-locals'],
extends: [
'decoupled-local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
'decoupled-local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
],
parserOptions: { tsconfigRootDir: __dirname }
};
3 changes: 1 addition & 2 deletions apps/heft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@microsoft/api-extractor": "workspace:*",
"@rushstack/heft": "0.73.2",
"@types/watchpack": "2.4.0",
"decoupled-local-node-rig": "workspace:*",
"local-eslint-config": "workspace:*"
"decoupled-local-node-rig": "workspace:*"
}
}
12 changes: 0 additions & 12 deletions apps/lockfile-explorer-web/.eslintrc.js

This file was deleted.

18 changes: 18 additions & 0 deletions apps/lockfile-explorer-web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const webAppProfile = require('local-web-rig/profiles/app/includes/eslint/flat/profile/web-app');
const reactMixin = require('local-web-rig/profiles/app/includes/eslint/flat/mixins/react');

module.exports = [
...webAppProfile,
...reactMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
}
}
];
3 changes: 2 additions & 1 deletion apps/lockfile-explorer-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"@types/react-dom": "17.0.25",
"@types/react": "17.0.74",
"@types/react-dom": "17.0.25",
"eslint": "~9.25.1",
"local-web-rig": "workspace:*"
}
}
1 change: 0 additions & 1 deletion apps/lockfile-explorer-web/src/start.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { App } from './App';
Expand Down
18 changes: 0 additions & 18 deletions apps/lockfile-explorer/.eslintrc.js

This file was deleted.

19 changes: 19 additions & 0 deletions apps/lockfile-explorer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node');

module.exports = [
...nodeProfile,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
},
rules: {
'no-console': 'off'
}
}
];
1 change: 1 addition & 0 deletions apps/lockfile-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@types/express": "4.17.21",
"@types/js-yaml": "3.12.1",
"@types/update-notifier": "~6.0.1",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*",
"@pnpm/lockfile-types": "^5.1.5",
"@types/semver": "7.5.0"
Expand Down
21 changes: 0 additions & 21 deletions apps/rundown/.eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions apps/rundown/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
},
rules: {
'no-console': 'off'
}
}
];
1 change: 1 addition & 0 deletions apps/rundown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*"
}
}
12 changes: 0 additions & 12 deletions apps/rush-mcp-server/.eslintrc.js

This file was deleted.

18 changes: 18 additions & 0 deletions apps/rush-mcp-server/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
}
}
];
1 change: 1 addition & 0 deletions apps/rush-mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*",
"typescript": "~5.8.2",
"@types/node": "20.17.19"
Expand Down
21 changes: 0 additions & 21 deletions apps/rush/.eslintrc.js

This file was deleted.

21 changes: 21 additions & 0 deletions apps/rush/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
tsconfigRootDir: __dirname
}
},
rules: {
'no-console': 'off'
}
}
];
1 change: 1 addition & 0 deletions apps/rush/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"devDependencies": {
"@rushstack/heft": "workspace:*",
"eslint": "~9.25.1",
"local-node-rig": "workspace:*",
"@rushstack/rush-amazon-s3-build-cache-plugin": "workspace:*",
"@rushstack/rush-azure-storage-build-cache-plugin": "workspace:*",
Expand Down
Loading