-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
53 lines (49 loc) · 1.7 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import prettier from "eslint-plugin-prettier";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const compat = new FlatCompat({
baseDirectory: path.dirname(fileURLToPath(import.meta.url)),
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
const esLintConfig = tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, ...compat.extends("next"), {
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
prettier
},
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/require-await": "off",
"no-console": ["error", { allow: ["warn", "error"] }],
"no-fallthrough": "off",
"no-restricted-syntax": ["error", "Literal[value=/text-m[\\d]/i]"],
"prettier/prettier": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}
}, { ignores: ["**/__generated__/**/*", "src/styles/**/*"] });
export default esLintConfig;