Skip to content

Commit 770c1e8

Browse files
committed
upgrade eslint to v9 and typescript-eslint to v8
1 parent 5dc4655 commit 770c1e8

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

playground/eslint.config.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ export default ts.config(
1111
files: ['*.ts'],
1212
languageOptions: {
1313
parserOptions: {
14-
project: 'tsconfig.json',
14+
projectService: true,
15+
project: './tsconfig.json',
16+
tsconfigRootDir: import.meta.dirname,
1517
},
1618
},
1719
},
1820
{
1921
files: ['*.ts', '*.mjs'],
2022
rules: {
21-
indent: ['error', 4],
22-
quotes: ['error', 'single'],
23-
'linebreak-style': ['error', 'unix'],
24-
semi: ['error', 'always'],
2523
eqeqeq: ['error', 'always'],
2624
'no-constant-condition': ['error', { checkLoops: false }],
2725
'@typescript-eslint/no-unsafe-member-access': 'off',
@@ -44,6 +42,7 @@ export default ts.config(
4442
files: ['eslint.config.mjs'],
4543
languageOptions: {
4644
parserOptions: {
45+
projectService: false,
4746
project: 'tsconfig.eslint.json',
4847
},
4948
},

playground/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ jobs:
145145
successMessage.style.display = 'none';
146146
invalidInputMessage.style.display = 'none';
147147
editor.clearGutter('error-marker');
148-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
149148
window.runActionlint!(editor.getValue());
150149
}
151150

playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"lint:stylelint": "stylelint style.css",
99
"lint:prettier": "prettier --check '*.ts' '*.mjs'",
1010
"lint:eslint": "eslint --max-warnings 0 '*.ts' '*.mjs'",
11-
"lint:eslintconfig": "tsc --checkJs --noEmit -p tsconfig.eslint.json",
12-
"lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:stylelint && npm run lint:eslintconfig",
11+
"lint:tsc-eslint": "tsc -p tsconfig.eslint.json",
12+
"lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:stylelint && npm run lint:tsc-eslint",
1313
"prettier": "prettier --write '*.ts' '*.mjs'",
1414
"build": "tsc -p .",
1515
"watch": "tsc -p . --watch",

playground/test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ if (typeof globalThis.crypto === 'undefined') {
99
globalThis.crypto = new Crypto();
1010
}
1111

12-
// Inject global.Go
13-
require('./lib/js/wasm_exec.js');
12+
// Inject global.Go for testing `main.wasm`.
13+
require('./lib/js/wasm_exec.js'); // eslint-disable-line @typescript-eslint/no-require-imports
1414

1515
class CheckResults {
1616
errors: ActionlintError[] | null = null;
@@ -76,7 +76,6 @@ jobs:
7676
const json = JSON.stringify(errors);
7777
assert.equal(errors.length, 1, json);
7878

79-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8079
const err = errors[0]!;
8180
assert.equal(err.message, '"runs-on" section is missing in job "test"', `message is unexpected: ${json}`);
8281
assert.equal(err.line, 5, `line is unexpected: ${json}`);
@@ -102,7 +101,6 @@ jobs:
102101
const json = JSON.stringify(errors);
103102
assert.equal(errors.length, 1, json);
104103

105-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
106104
const err = errors[0]!;
107105
assert.ok(err.message.includes('unknown Webhook event "foo"'), `message is unexpected: ${json}`);
108106
assert.equal(err.line, 2, `line is unexpected: ${json}`);

playground/tsconfig.eslint.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4+
"checkJs": true,
5+
"noEmit": true,
46
"module": "nodenext",
57
"moduleResolution": "nodenext"
68
},

0 commit comments

Comments
 (0)