Skip to content

Commit 1b1cff4

Browse files
committed
add eslint.config.mjs
1 parent fb7c4c3 commit 1b1cff4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

eslint.config.mjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
2+
import globals from "globals";
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 [{
18+
ignores: ["**/.eslintrc.js"],
19+
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"), {
20+
plugins: {
21+
"@typescript-eslint": typescriptEslintEslintPlugin,
22+
},
23+
24+
languageOptions: {
25+
globals: {
26+
...globals.node,
27+
...globals.jest,
28+
},
29+
30+
parser: tsParser,
31+
ecmaVersion: 5,
32+
sourceType: "module",
33+
34+
parserOptions: {
35+
project: "tsconfig.json",
36+
tsconfigRootDir: __dirname,
37+
},
38+
},
39+
40+
rules: {
41+
"@typescript-eslint/interface-name-prefix": "off",
42+
"@typescript-eslint/explicit-function-return-type": "off",
43+
"@typescript-eslint/explicit-module-boundary-types": "off",
44+
"@typescript-eslint/no-explicit-any": "off",
45+
},
46+
}];

0 commit comments

Comments
 (0)