Skip to content

Commit 083d2dc

Browse files
Upgrade to eslint 9
1 parent 2c00fae commit 083d2dc

File tree

8 files changed

+342
-347
lines changed

8 files changed

+342
-347
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: 2 additions & 1 deletion
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);
@@ -31,7 +32,7 @@ const context = await esbuild.context({
3132
outdir: "dist",
3233
platform: "node",
3334
format: "cjs",
34-
sourcemap: !!process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS
35+
sourcemap: process.env.CODEQL_VARIANT_ANALYSIS_ACTION_GENERATE_SOURCEMAPS
3536
? "external"
3637
: false,
3738
chunkNames: "chunks/[name]-[hash]",

eslint.config.mjs

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

0 commit comments

Comments
 (0)