Skip to content

Commit dd3129b

Browse files
Merge pull request #1218 from github/robertbrignull/eslint-9
Upgrade to eslint version 9
2 parents 2c00fae + 39e4e3a commit dd3129b

File tree

7 files changed

+348
-376
lines changed

7 files changed

+348
-376
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

build.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { rm } from "node:fs/promises";
22
import { dirname, join } from "node:path";
33
import { fileURLToPath } from "node:url";
4+
45
import * as esbuild from "esbuild";
56

67
const __filename = fileURLToPath(import.meta.url);

eslint.config.mjs

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import eslint from "@eslint/js";
2+
import { globalIgnores } from "eslint/config";
3+
import github from "eslint-plugin-github";
4+
import tseslint from "typescript-eslint";
5+
6+
export default tseslint.config(
7+
globalIgnores(["dist/", "node_modules/", "script/", "jest.config.ts", "eslint.config.mjs", "build.mjs"]),
8+
github.getFlatConfigs().recommended,
9+
...github.getFlatConfigs().typescript,
10+
tseslint.configs.recommendedTypeChecked,
11+
eslint.configs.recommended,
12+
tseslint.configs.recommended,
13+
{
14+
rules: {
15+
"sort-imports": "off",
16+
"i18n-text/no-en": "off",
17+
"import/extensions": [
18+
"error",
19+
{
20+
json: "always",
21+
},
22+
],
23+
"import/named": "off",
24+
"import/no-amd": "error",
25+
"import/no-commonjs": "error",
26+
"import/no-dynamic-require": "error",
27+
"import/no-extraneous-dependencies": [
28+
"error",
29+
{
30+
devDependencies: true,
31+
},
32+
],
33+
"import/no-namespace": "off",
34+
"import/no-unresolved": "error",
35+
"import/no-webpack-loader-syntax": "error",
36+
"import/order": [
37+
"error",
38+
{
39+
alphabetize: {
40+
order: "asc",
41+
},
42+
"newlines-between": "always",
43+
},
44+
],
45+
"no-console": "off",
46+
"no-sequences": "error",
47+
"no-shadow": "off",
48+
"@typescript-eslint/naming-convention": "error",
49+
"eslint-comments/no-use": [
50+
"error",
51+
{
52+
allow: [
53+
"eslint-disable",
54+
"eslint-enable",
55+
"eslint-disable-next-line",
56+
],
57+
},
58+
],
59+
"@typescript-eslint/no-shadow": "error",
60+
"one-var": ["error", "never"],
61+
"@typescript-eslint/restrict-template-expressions": "off",
62+
},
63+
settings: {
64+
"import/parsers": {
65+
"@typescript-eslint/parser": [".ts", ".tsx"]
66+
},
67+
"import/resolver": {
68+
"typescript": {}
69+
}
70+
},
71+
languageOptions: {
72+
parserOptions: {
73+
projectService: true,
74+
tsconfigRootDir: import.meta.dirname,
75+
},
76+
},
77+
},
78+
);

0 commit comments

Comments
 (0)