-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
74 lines (71 loc) · 2.03 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import importPlugin from "eslint-plugin-import";
import prettier from "eslint-config-prettier";
export default [
js.configs.recommended,
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
projectService: true,
},
},
plugins: {
"@typescript-eslint": tseslint,
react: reactPlugin,
"react-hooks": reactHooksPlugin,
import: importPlugin,
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
// TypeScript rules
// ...tseslint.configs.recommended.rules,
// tseslint.configs.recommended,
...tseslint.configs["recommended-type-checked"].rules,
"no-undef": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/await-thenable": "off",
"no-console": "off",
// React rules
...reactPlugin.configs.recommended.rules,
"react/react-in-jsx-scope": "off",
...reactHooksPlugin.configs.recommended.rules,
// Import rules
"import/order": [
"error",
{
groups: ["builtin", "external", "internal", ["parent", "sibling"], "index"],
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],
},
},
{
ignores: ["dist/**", "node_modules/**", "coverage/**", ".github/**"],
},
prettier,
];