Skip to content

Commit 2968e3a

Browse files
committed
Add new test case scenarios
1 parent 336b528 commit 2968e3a

File tree

14 files changed

+196
-2
lines changed

14 files changed

+196
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
3+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4+
require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
5+
6+
module.exports = {
7+
extends: [
8+
'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
9+
'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
10+
],
11+
parserOptions: { tsconfigRootDir: __dirname },
12+
13+
overrides: [
14+
/**
15+
* Override the parser from local-eslint-config. Since the config is coming
16+
* from the workspace instead of the external NPM package, the versions of ESLint
17+
* and TypeScript that the config consumes will be resolved from the devDependencies
18+
* of the config instead of from the eslint-7-test package. Overriding the parser
19+
* ensures that the these dependencies come from the eslint-7-test package. See:
20+
* https://github.com/microsoft/rushstack/issues/3021
21+
*/
22+
{
23+
files: ['*.ts', '*.tsx'],
24+
parser: '@typescript-eslint/parser'
25+
}
26+
]
27+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# eslint-7-11-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.11.0 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.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// The "rig.json" file directs tools to look for their config files in an external package.
3+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
4+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5+
6+
"rigPackageName": "local-node-rig"
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "eslint-7-11-test",
3+
"description": "This project contains a build test to validate ESLint 7.11.0 compatibility with the latest version of @rushstack/eslint-config (and by extension, the ESLint plugin)",
4+
"version": "1.0.0",
5+
"private": true,
6+
"main": "lib/index.js",
7+
"license": "MIT",
8+
"scripts": {
9+
"build": "heft build --clean",
10+
"_phase:build": "heft run --only build -- --clean"
11+
},
12+
"devDependencies": {
13+
"@rushstack/heft": "workspace:*",
14+
"local-node-rig": "workspace:*",
15+
"@types/node": "18.17.15",
16+
"@typescript-eslint/parser": "~5.59.2",
17+
"eslint": "7.11.0",
18+
"typescript": "~5.0.4"
19+
}
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
export class Foo {
5+
private _bar: string = 'bar';
6+
public baz: string = this._bar;
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json.schemastore.org/tsconfig",
3+
4+
"compilerOptions": {
5+
"outDir": "lib",
6+
"rootDir": "src",
7+
8+
"forceConsistentCasingInFileNames": true,
9+
"declaration": true,
10+
"sourceMap": true,
11+
"declarationMap": true,
12+
"inlineSources": true,
13+
"experimentalDecorators": true,
14+
"strictNullChecks": true,
15+
"noUnusedLocals": true,
16+
17+
"module": "esnext",
18+
"moduleResolution": "node",
19+
"target": "es5",
20+
"lib": ["es5"]
21+
},
22+
"include": ["src/**/*.ts", "src/**/*.tsx"],
23+
"exclude": ["node_modules", "lib"]
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require('local-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
3+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4+
require('local-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
5+
6+
module.exports = {
7+
extends: [
8+
'local-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool',
9+
'local-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
10+
],
11+
parserOptions: { tsconfigRootDir: __dirname },
12+
13+
overrides: [
14+
/**
15+
* Override the parser from local-eslint-config. Since the config is coming
16+
* from the workspace instead of the external NPM package, the versions of ESLint
17+
* and TypeScript that the config consumes will be resolved from the devDependencies
18+
* of the config instead of from the eslint-7-test package. Overriding the parser
19+
* ensures that the these dependencies come from the eslint-7-test package. See:
20+
* https://github.com/microsoft/rushstack/issues/3021
21+
*/
22+
{
23+
files: ['*.ts', '*.tsx'],
24+
parser: '@typescript-eslint/parser'
25+
}
26+
]
27+
};

build-tests/eslint-7-7-test/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# eslint-7-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.7.0 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.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// The "rig.json" file directs tools to look for their config files in an external package.
3+
// Documentation for this system: https://www.npmjs.com/package/@rushstack/rig-package
4+
"$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json",
5+
6+
"rigPackageName": "local-node-rig"
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "eslint-7-7-test",
3+
"description": "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)",
4+
"version": "1.0.0",
5+
"private": true,
6+
"main": "lib/index.js",
7+
"license": "MIT",
8+
"scripts": {
9+
"build": "heft build --clean",
10+
"_phase:build": "heft run --only build -- --clean"
11+
},
12+
"devDependencies": {
13+
"@rushstack/heft": "workspace:*",
14+
"local-node-rig": "workspace:*",
15+
"@types/node": "18.17.15",
16+
"@typescript-eslint/parser": "~5.59.2",
17+
"eslint": "7.7.0",
18+
"typescript": "~5.0.4"
19+
}
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
export class Foo {
5+
private _bar: string = 'bar';
6+
public baz: string = this._bar;
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json.schemastore.org/tsconfig",
3+
4+
"compilerOptions": {
5+
"outDir": "lib",
6+
"rootDir": "src",
7+
8+
"forceConsistentCasingInFileNames": true,
9+
"declaration": true,
10+
"sourceMap": true,
11+
"declarationMap": true,
12+
"inlineSources": true,
13+
"experimentalDecorators": true,
14+
"strictNullChecks": true,
15+
"noUnusedLocals": true,
16+
17+
"module": "esnext",
18+
"moduleResolution": "node",
19+
"target": "es5",
20+
"lib": ["es5"]
21+
},
22+
"include": ["src/**/*.ts", "src/**/*.tsx"],
23+
"exclude": ["node_modules", "lib"]
24+
}

common/config/rush/common-versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@
6161
*/
6262
"allowedAlternativeVersions": {
6363
/**
64-
* Used by build-tests/eslint-7-test
64+
* Used by build-tests/eslint-7-7-test, build-tests/eslint-7-11-test, and build-tests/eslint-7-test
6565
*/
66-
"eslint": ["~7.30.0"],
66+
"eslint": ["7.7.0", "7.11.0", "~7.30.0"],
6767
/**
6868
* For example, allow some projects to use an older TypeScript compiler
6969
* (in addition to whatever "usual" version is being used by other projects in the repo):

rush.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,18 @@
530530
"reviewCategory": "tests",
531531
"shouldPublish": false
532532
},
533+
{
534+
"packageName": "eslint-7-7-test",
535+
"projectFolder": "build-tests/eslint-7-7-test",
536+
"reviewCategory": "tests",
537+
"shouldPublish": false
538+
},
539+
{
540+
"packageName": "eslint-7-11-test",
541+
"projectFolder": "build-tests/eslint-7-11-test",
542+
"reviewCategory": "tests",
543+
"shouldPublish": false
544+
},
533545
{
534546
"packageName": "eslint-7-test",
535547
"projectFolder": "build-tests/eslint-7-test",

0 commit comments

Comments
 (0)