Skip to content

Commit c545315

Browse files
committed
Update eslint to v9
1 parent 5e7a52f commit c545315

16 files changed

+1621
-1468
lines changed

eslint.config.mjs

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
// Automatically generated by running npx @eslint/migrate-config .eslintrc.json
2-
3-
import path from "node:path";
4-
import { fileURLToPath } from "node:url";
5-
6-
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
7-
import { FlatCompat } from "@eslint/eslintrc";
8-
import js from "@eslint/js";
9-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
10-
import tsParser from "@typescript-eslint/parser";
11-
import filenames from "eslint-plugin-filenames";
1+
import { fixupPluginRules } from "@eslint/compat";
122
import github from "eslint-plugin-github";
13-
import _import from "eslint-plugin-import";
143
import noAsyncForeach from "eslint-plugin-no-async-foreach";
154
import jsdoc from "eslint-plugin-jsdoc";
5+
import tseslint from "typescript-eslint";
166
import globals from "globals";
177

18-
const __filename = fileURLToPath(import.meta.url);
19-
const __dirname = path.dirname(__filename);
20-
const compat = new FlatCompat({
21-
baseDirectory: __dirname,
22-
recommendedConfig: js.configs.recommended,
23-
allConfig: js.configs.all,
24-
});
8+
const githubFlatConfigs = github.getFlatConfigs();
259

2610
export default [
2711
{
@@ -36,29 +20,23 @@ export default [
3620
".github/**/*",
3721
],
3822
},
39-
...fixupConfigRules(
40-
compat.extends(
41-
"eslint:recommended",
42-
"plugin:@typescript-eslint/recommended",
43-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
44-
"plugin:github/recommended",
45-
"plugin:github/typescript",
46-
"plugin:import/typescript",
47-
),
48-
),
23+
// eslint-plugin-github recommended config (includes eslint:recommended,
24+
// eslint-plugin-import, eslint-comments, i18n-text, and github rules).
25+
githubFlatConfigs.recommended,
26+
// eslint-plugin-github typescript config (includes
27+
// @typescript-eslint/recommended and escompat).
28+
...githubFlatConfigs.typescript,
29+
// Type-checked rules from typescript-eslint (the github plugin only
30+
// includes the base recommended rules, not the type-checked ones).
31+
...tseslint.configs.recommendedTypeCheckedOnly,
4932
{
5033
plugins: {
51-
"@typescript-eslint": fixupPluginRules(typescriptEslint),
52-
filenames: fixupPluginRules(filenames),
53-
github: fixupPluginRules(github),
54-
import: fixupPluginRules(_import),
55-
"no-async-foreach": noAsyncForeach,
34+
"no-async-foreach": fixupPluginRules(noAsyncForeach),
5635
"jsdoc": jsdoc,
5736
},
5837

5938
languageOptions: {
60-
parser: tsParser,
61-
ecmaVersion: 5,
39+
ecmaVersion: "latest",
6240
sourceType: "module",
6341

6442
globals: {
@@ -82,7 +60,7 @@ export default [
8260
},
8361

8462
rules: {
85-
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
63+
"github/filenames-match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
8664
"i18n-text/no-en": "off",
8765

8866
"import/extensions": [

lib/analyze-action-post.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/start-proxy-action-post.js

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)