-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
114 lines (114 loc) · 3.1 KB
/
.eslintrc.json
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
"root": true,
"env": { "browser": true, "es2020": true },
"extends": [
"airbnb-base",
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"ignorePatterns": ["dist", ".eslintrc.cjs"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["./tsconfig.json", "./tsconfig.node.json"]
// "tsconfigRootDir": __dirname,
},
// "prettier" must be the last item in "plugins" to remove all eslint rules that conflict with prettier
"plugins": [
"@typescript-eslint",
"unused-imports",
"react-refresh",
"prettier"
],
"rules": {
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowAny": false,
"allowNullableBoolean": false,
"allowNullableNumber": false,
"allowNullableObject": false,
"allowNullableString": false,
"allowNumber": false,
"allowString": false
}
],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"import/extensions": "off",
"import/no-default-export": "error",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/order": [
"error",
{
"pathGroups": [
{
"pattern": "@/**",
"group": "parent",
"position": "before"
}
],
"alphabetize": { "order": "asc", "orderImportKind": "asc" }
}
],
"import/prefer-default-export": "off",
"max-classes-per-file": "off",
"no-undef": "off",
"no-unused-vars": "off",
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
// 使ってない import を自動で消す
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"args": "after-used",
"argsIgnorePattern": "^_",
"vars": "all",
"varsIgnorePattern": "^_"
}
],
"react-refresh/only-export-components": [
"warn",
{ "allowConstantExport": true }
],
"arrow-body-style": "off",
"func-style": "off",
"no-shadow": "off",
"no-useless-return": "off",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"require-jsdoc": "off",
// override airbnb-base (recently changed some?)
// 行末の semicolon (;) を消す
"semi": "off",
// 配列や関数の引数のが1行の場合最後の要素の後に , を付けない、複数行の場合は付ける
"comma-dangle": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}