-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
33 lines (31 loc) · 1.02 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import path from "node:path";
import { fileURLToPath } from "node:url";
import tsParser from "@typescript-eslint/parser";
import tseslint from "@typescript-eslint/eslint-plugin";
import prettier from "eslint-plugin-prettier";
import eslintConfigPrettier from "eslint-config-prettier";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default [
{
files: ["src/**/*.{js,mjs,cjs,ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: path.resolve(__dirname, "tsconfig.json"),
tsconfigRootDir: __dirname,
},
},
plugins: {
"@typescript-eslint": tseslint,
prettier,
},
rules: {
...tseslint.configs["recommended-type-checked"].rules,
...eslintConfigPrettier.rules,
"prettier/prettier": "error",
},
},
];