Skip to content

Commit 995ab71

Browse files
committed
Add eslint 8 test
1 parent af3dc78 commit 995ab71

File tree

9 files changed

+123
-3
lines changed

9 files changed

+123
-3
lines changed
+25
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+
};

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

+6
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.
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+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "eslint-8-test",
3+
"description": "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)",
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/eslint-config": "workspace:*",
14+
"@rushstack/heft": "workspace:*",
15+
"local-node-rig": "workspace:*",
16+
"@types/node": "18.17.15",
17+
"@typescript-eslint/parser": "~5.59.2",
18+
"eslint": "~8.7.0",
19+
"typescript": "~5.0.4"
20+
}
21+
}
+7
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+
}
+24
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/pnpm-lock.yaml

+26-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/config/rush/repo-state.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "92561e650a0b5a0ffde5b5dcc107d597c755b413",
3+
"pnpmShrinkwrapHash": "00aeb975643cac9bd71b0f5af110395618d2eedf",
44
"preferredVersionsHash": "1926a5b12ac8f4ab41e76503a0d1d0dccc9c0e06"
55
}

rush.json

+6
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,12 @@
536536
"reviewCategory": "tests",
537537
"shouldPublish": false
538538
},
539+
{
540+
"packageName": "eslint-8-test",
541+
"projectFolder": "build-tests/eslint-8-test",
542+
"reviewCategory": "tests",
543+
"shouldPublish": false
544+
},
539545
{
540546
"packageName": "package-extractor-test-01",
541547
"projectFolder": "build-tests/package-extractor-test-01",

0 commit comments

Comments
 (0)