Skip to content

Commit 3fea816

Browse files
authored
Merge pull request #3057 from D4N14L/user/danade/eslint8
[eslint-plugin] Support ESLint 8
2 parents 7ae231e + 57dc5fd commit 3fea816

File tree

69 files changed

+1204
-645
lines changed

Some content is hidden

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

69 files changed

+1204
-645
lines changed

apps/heft/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@rushstack/heft": "0.42.3",
5454
"@rushstack/heft-node-rig": "1.2.32",
5555
"@types/argparse": "1.0.38",
56-
"@types/eslint": "7.2.0",
56+
"@types/eslint": "8.2.0",
5757
"@types/glob": "7.1.1",
5858
"@types/heft-jest": "1.0.1",
5959
"@types/node": "12.20.24",

apps/heft/src/plugins/TypeScriptPlugin/Eslint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class Eslint extends LinterBase<TEslint.ESLint.LintResult> {
5252
'Heft requires ESLint 7 or newer. Your ESLint version is too old:\n' + this._eslintPackagePath
5353
);
5454
}
55-
if (majorVersion > 7) {
55+
if (majorVersion > 8) {
5656
// We don't use writeWarningLine() here because, if the person wants to take their chances with
5757
// a newer ESLint release, their build should be allowed to succeed.
5858
this._terminal.writeLine(

apps/rush-lib/src/logic/taskRunner/BaseBuilder.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ export abstract class BaseBuilder {
2424
/**
2525
* Name of the task definition.
2626
*/
27-
abstract readonly name: string;
27+
public abstract readonly name: string;
2828

2929
/**
3030
* This flag determines if the task is allowed to be skipped if up to date.
3131
*/
32-
abstract isSkipAllowed: boolean;
32+
public abstract isSkipAllowed: boolean;
3333

3434
/**
3535
* Assigned by execute(). True if the build script was an empty string. Operationally an empty string is
3636
* like a shell command that succeeds instantly, but e.g. it would be odd to report build time statistics for it.
3737
*/
38-
abstract hadEmptyScript: boolean;
38+
public abstract hadEmptyScript: boolean;
3939

4040
/**
4141
* Method to be executed for the task.
4242
*/
43-
abstract executeAsync(context: IBuilderContext): Promise<TaskStatus>;
43+
public abstract executeAsync(context: IBuilderContext): Promise<TaskStatus>;
4444
}

build-tests-samples/heft-node-basic-tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@rushstack/heft-jest-plugin": "workspace:*",
1515
"@types/heft-jest": "1.0.1",
1616
"@types/node": "12.20.24",
17-
"eslint": "~7.30.0",
17+
"eslint": "~8.3.0",
1818
"typescript": "~4.4.2"
1919
}
2020
}

build-tests-samples/heft-node-jest-tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@rushstack/heft-jest-plugin": "workspace:*",
1414
"@types/heft-jest": "1.0.1",
1515
"@types/node": "12.20.24",
16-
"eslint": "~7.30.0",
16+
"eslint": "~8.3.0",
1717
"typescript": "~4.4.2"
1818
}
1919
}

build-tests-samples/heft-storybook-react-tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@types/react": "16.9.45",
1919
"@types/webpack-env": "1.13.0",
2020
"css-loader": "~4.2.1",
21-
"eslint": "~7.30.0",
21+
"eslint": "~8.3.0",
2222
"heft-storybook-react-tutorial-storykit": "workspace:*",
2323
"html-webpack-plugin": "~5.5.0",
2424
"react-dom": "~16.13.1",

build-tests-samples/heft-webpack-basic-tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/react-dom": "16.9.8",
1818
"@types/webpack-env": "1.13.0",
1919
"css-loader": "~4.2.1",
20-
"eslint": "~7.30.0",
20+
"eslint": "~8.3.0",
2121
"html-webpack-plugin": "~5.5.0",
2222
"react": "~16.13.1",
2323
"react-dom": "~16.13.1",

build-tests-samples/packlets-tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@rushstack/eslint-config": "workspace:*",
1313
"@rushstack/heft": "workspace:*",
1414
"@types/node": "12.20.24",
15-
"eslint": "~7.30.0",
15+
"eslint": "~8.3.0",
1616
"typescript": "~4.4.2"
1717
}
1818
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require('@rushstack/eslint-config/patch/modern-module-resolution');
3+
4+
module.exports = {
5+
extends: [
6+
'@rushstack/eslint-config/profile/node-trusted-tool',
7+
'@rushstack/eslint-config/mixins/friendly-locals'
8+
],
9+
parserOptions: { tsconfigRootDir: __dirname },
10+
11+
overrides: [
12+
/**
13+
* Override the parser from @rushstack/eslint-config. Since the config is coming
14+
* from the workspace instead of the external NPM package, the versions of ESLint
15+
* and TypeScript that the config consumes will be resolved from the devDependencies
16+
* of the config instead of from the eslint-7-test package. Overriding the parser
17+
* ensures that the these dependencies come from the eslint-7-test package. See:
18+
* https://github.com/microsoft/rushstack/issues/3021
19+
*/
20+
{
21+
files: ['*.ts', '*.tsx'],
22+
parser: '@typescript-eslint/parser'
23+
}
24+
]
25+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# eslint-7-test
2+
3+
This project folder is one of the **build-tests** for the Rushstack [ESLint configuration](https://www.npmjs.com/package/@rushstack/eslint-config) (and by extension, the [ESLint plugin](https://www.npmjs.com/package/@rushstack/eslint-plugin))
4+
package. This project builds using ESLint v7 and contains a simple index file to ensure that the build runs ESLint successfully against source code.
5+
6+
Please see the [ESLint Heft task documentation](https://rushstack.io/pages/heft_tasks/eslint/) for documentation and tutorials.

0 commit comments

Comments
 (0)