Skip to content

Commit 77fc96a

Browse files
committed
Migrate to a new eslint
Linter is not yet autoenabled, need to fix some issues first in npm run test Signed-off-by: Alexander Borsuk <[email protected]>
1 parent 492220a commit 77fc96a

File tree

4 files changed

+1098
-403
lines changed

4 files changed

+1098
-403
lines changed

.eslintrc.yml

-18
This file was deleted.

eslint.config.mjs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import globals from "globals";
2+
import tsParser from "@typescript-eslint/parser";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import js from "@eslint/js";
6+
import { FlatCompat } from "@eslint/eslintrc";
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all
14+
});
15+
16+
export default [...compat.extends("plugin:@typescript-eslint/recommended"), {
17+
languageOptions: {
18+
globals: {
19+
...globals.worker,
20+
},
21+
22+
parser: tsParser,
23+
ecmaVersion: 2020,
24+
sourceType: "module",
25+
26+
parserOptions: {
27+
ecmaFeatures: {
28+
impliedStrict: true,
29+
},
30+
},
31+
},
32+
33+
rules: {
34+
indent: ["error", 2, {
35+
SwitchCase: 1,
36+
}],
37+
38+
semi: ["error", "always"],
39+
quotes: ["error", "single", "avoid-escape"],
40+
"no-trailing-spaces": ["error"],
41+
42+
"no-unused-vars": ["error", {
43+
argsIgnorePattern: "^_",
44+
}],
45+
46+
"prefer-const": ["error", {
47+
destructuring: "all",
48+
}],
49+
},
50+
}];

0 commit comments

Comments
 (0)