-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.json
135 lines (135 loc) · 4.04 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
// lean strict on linting, can reduce strictness if/when things get annoying
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:import/recommended",
"plugin:tailwindcss/recommended",
"prettier"
],
"plugins": ["functional", "import", "no-relative-import-paths"],
"overrides": [
// don't use ts checking for js files https://stackoverflow.com/a/64488475
{
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"tsconfigRootDir": ".",
"project": ["./tsconfig.json"]
},
"rules": {
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-confusing-void-expression": [
"error",
{ "ignoreArrowShorthand": true }
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
"allowAny": true,
"allowBoolean": true,
"allowNullish": true,
"allowNumber": true,
"allowRegExp": true,
"allowNever": true
}
],
// annoying when wanting to overspecify different types that happen to be the same but could become different
"@typescript-eslint/no-duplicate-type-constituents": "off",
// annoying to have to dupe this with the js version
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-relative-import-paths/no-relative-import-paths": [
"error",
{
"allowSameFolder": false,
"rootDir": "src",
"prefix": "@"
}
]
}
}
],
"rules": {
"functional/functional-parameters": [
"error",
{
"enforceParameterCount": false
}
],
"functional/immutable-data": ["error", { "ignoreIdentifierPattern": ["router"] }],
"functional/no-classes": "error",
"functional/no-let": "error",
"functional/no-loop-statements": "error",
"functional/no-this-expressions": "error",
// apparently ts itself checks these https://typescript-eslint.io/troubleshooting/performance-troubleshooting/#eslint-plugin-import
"import/named": "off",
"import/namespace": "off",
"import/order": [
"error",
{
"groups": [
"builtin", // Built-in imports (come from NodeJS native) go first
"external",
"internal",
["sibling", "parent"], // <- Relative imports, the sibling and parent types they can be mingled together
"index",
"unknown"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc"
}
}
],
"no-param-reassign": [
"error",
{
"props": true
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"react/no-unescaped-entities": "off",
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true, // don"t want to sort import lines, use eslint-plugin-import instead
"allowSeparatedGroups": true // separating imports by group seems more readable
}
],
"tailwindcss/no-custom-classname": [
"error",
{
"cssFiles": [], // don't need this anyway, but the reasonable default causes perf issues https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/276#issuecomment-2076947699
"whitelist": [
"nopan",
"react\\-flow.*",
"selected",
"flashlight-mode",
"spotlight\\-",
"diagram-node",
"diagram-edge"
]
}
]
}
}