-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eslintrc.js
110 lines (110 loc) · 3.37 KB
/
.eslintrc.js
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
module.exports = {
extends: ["plugin:collation/strict"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: "./tsconfig.json",
},
plugins: [
"@typescript-eslint",
"collation",
"react",
"react-hooks",
"typescript-sort-keys",
],
settings: {
react: {
version: "detect",
},
},
rules: {
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/padding-line-between-statements": [
"error",
{
blankLine: "always",
next: "export",
prev: "*",
},
{
blankLine: "never",
next: "export",
prev: "export",
},
{
blankLine: "always",
next: "*",
prev: "import",
},
{
blankLine: "never",
next: "import",
prev: "import",
},
],
"@typescript-eslint/sort-type-union-intersection-members": "error",
"@typescript-eslint/strict-boolean-expressions": "warn",
curly: "error",
eqeqeq: [
"error",
"always",
{
null: "ignore",
},
],
"no-restricted-imports": [
"error",
{
paths: [
{
importNames: [
"useLocation",
"useParams",
"useNavigate",
"generatePath",
],
message:
"Please import routing hooks from 'hooks/use-router' or utils from 'utils/route-utils' instead.",
name: "react-router",
},
{
importNames: [
"Dialog",
"FileUploader",
"EmptyState",
"IconButton",
"SelectMenu",
"Menu",
"FormField",
],
message:
"Please import the wrapped component from 'components' instead.",
name: "evergreen-ui",
},
],
},
],
"padding-line-between-statements": "off",
"react/display-name": "error",
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"react/hook-use-state": "error",
"react/jsx-boolean-value": ["error", "always"],
"react/jsx-handler-names": "error",
"react/jsx-no-constructed-context-values": "error",
"react/jsx-sort-props": "error",
"react/self-closing-comp": "error",
"typescript-sort-keys/interface": [
"error",
"asc",
{
caseSensitive: false,
},
],
"typescript-sort-keys/string-enum": "error",
},
};