Skip to content

Commit 9367898

Browse files
committed
migrate eslint to v9
1 parent 90680b6 commit 9367898

File tree

2 files changed

+48
-22
lines changed

2 files changed

+48
-22
lines changed

.eslintrc.json

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

eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import tsParser from "@typescript-eslint/parser";
4+
import path from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
import js from "@eslint/js";
7+
import { FlatCompat } from "@eslint/eslintrc";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default defineConfig([globalIgnores([
18+
"**/out",
19+
"**/dist",
20+
"**/*.d.ts",
21+
"src/bsvjs/syntaxes",
22+
"src/test",
23+
"src/BsvProvider.ts",
24+
]), {
25+
extends: compat.extends("eslint:recommended", "prettier"),
26+
27+
plugins: {
28+
"@typescript-eslint": typescriptEslint,
29+
},
30+
31+
languageOptions: {
32+
parser: tsParser,
33+
ecmaVersion: 6,
34+
sourceType: "module",
35+
},
36+
37+
rules: {
38+
"@typescript-eslint/naming-convention": "warn",
39+
"@/semi": "warn",
40+
curly: "warn",
41+
eqeqeq: "warn",
42+
"no-throw-literal": "warn",
43+
semi: "off",
44+
"no-unused-vars": "off",
45+
"no-undef": "warn",
46+
"no-constant-condition": "warn",
47+
},
48+
}]);

0 commit comments

Comments
 (0)