-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
109 lines (109 loc) · 2.77 KB
/
.eslintrc
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
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:tailwindcss/recommended",
"plugin:@tanstack/query/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"warnOnUnsupportedTypeScriptVersion": false
},
"settings": {
"react": {
"version": "detect"
},
"tailwindcss": {
"callees": ["cn"]
}
},
"ignorePatterns": ["vite-env.d.ts"],
"rules": {
"react/react-in-jsx-scope": "off",
"react/display-name": "off",
"newline-before-return": "error",
"react/jsx-no-useless-fragment": "error",
"arrow-body-style": ["warn", "as-needed"],
"tailwindcss/migration-from-tailwind-2": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/array-type": ["error", { "default": "array" }],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": ["PascalCase"]
}
],
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"FC": "Useless and has some drawbacks, see https://github.com/facebook/create-react-app/pull/8177"
}
}
],
"react/boolean-prop-naming": [
"error",
{
"rule": "^is[A-Z]([A-Za-z0-9]?)+",
"validateNested": true
}
],
"react/destructuring-assignment": [
"warn",
"always",
{
"destructureInSignature": "always"
}
],
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/jsx-curly-brace-presence": [
"error",
{
"props": "never",
"children": "never"
}
],
"react/self-closing-comp": [
"warn",
{
"component": true,
"html": true
}
],
"tailwindcss/no-custom-classname": [
"warn",
{ "whitelist": ["shadow-none"] }
],
"no-restricted-imports": [
"error",
{
"name": "react-redux",
"importNames": ["useDispatch", "useSelector"],
"message": "Please import useAppDispatch or useAppSelector from `hooks/redux` instead."
}
],
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value='react'] :matches(ImportDefaultSpecifier, ImportNamespaceSpecifier)",
"message": "Default React import is not allowed"
},
{
"selector": "Identifier[name=\"React\"]",
"message": "Prefix React is not allowed"
}
]
}
}