-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
106 lines (106 loc) · 2.53 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
{
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
"next/core-web-vitals",
"prettier"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"unicorn/no-array-callback-reference": "off",
"unicorn/no-useless-undefined": "off", // causes eslint to remove usages of undefined e.g. `someFunction(undefined)` which is dangerous and not advisable
"unicorn/prevent-abbreviations": "off", // this one is annoying due to prevalence of the term Props within React code
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
},
"overrides": [
{
"files": ["**/*.js?(x)"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"unicorn/prefer-module": "off"
}
},
{
"files": ["**/*.tsx", "**/*.jsx"],
"rules": {
"unicorn/no-null": "off",
"unicorn/filename-case": [
"error",
{
"case": "pascalCase"
}
]
}
},
{
"files": ["**/app/**/*.tsx"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
]
}
},
// hooks-specific
{
"files": ["**/hooks/**/*.ts", "**/use*.ts"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "camelCase"
}
]
}
},
// unit-test specific
{
"files": [
"**/*.test.{js,jsx,ts,tsx}",
"**/__mocks__/**/*.{js,jsx,ts,tsx}"
],
"extends": [
"plugin:jest/recommended",
"plugin:jest-formatting/recommended",
"plugin:testing-library/react"
],
"rules": {
"unicorn/filename-case": "off"
}
}
]
}