-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
75 lines (73 loc) · 2.12 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
{
"extends": ["plugin:jsx-a11y/recommended", "eslint-config-prettier", "next/core-web-vitals"],
"plugins": ["jsx-a11y", "import-helpers", "react-hooks", "@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_$",
"ignoreRestSiblings": true,
"destructuredArrayIgnorePattern": "^_$"
}
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": true
}
},
{
"selector": "enum",
"format": ["PascalCase"],
"custom": {
"regex": "^E[A-Z]",
"match": true
}
}
],
"arrow-body-style": ["error", "as-needed"],
"no-use-before-define": "error",
"react/self-closing-comp": ["error", { "component": true, "html": true }],
"import-helpers/order-imports": [
"error",
{
"newlinesBetween": "always",
"groups": [
["/^react$/", "/^next$/", "/^next//"],
["module", "/(@)/", "/^react-/", "/^next-/", "/mdx-components/"],
["/(contexts)/", "/(hooks)/"],
"/(data)/",
["/(views)/", "/(routes)/", "/api/"],
["/(sections)/", "/(components)/"],
["/(lib)/", "/(util)/"],
["/(interface)/", "/(enum)/", "/(schemas)/"],
"/(static)/",
"/(styles)/"
],
"alphabetize": {
"order": "desc",
"ignoreCase": true
}
}
],
"react-hooks/exhaustive-deps": "warn",
"react/display-name": "error",
"react/no-unescaped-entities": "off",
"testing-library/no-debugging-utils": "off"
}
}
// * Referências:
// https://itnext.io/7-recommended-eslint-rules-for-react-typescript-project-1a22b011b4b5
// https://blog.logrocket.com/12-essential-eslint-rules-react/