-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
143 lines (140 loc) · 4.04 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
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
136
137
138
139
140
141
142
143
/* eslint-disable quote-props */
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
},
extends: [
"plugin:react/recommended",
"airbnb",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2022,
sourceType: "module",
},
plugins: [
"react",
'@typescript-eslint',
],
rules: {
"arrow-body-style": "off",
"arrow-parens": "off",
"class-methods-use-this": "off",
"function-paren-newline": "off",
"import/extensions": "off",
"import/prefer-default-export": "off",
"import/no-unresolved": "off",
"lines-between-class-members": ["error", "always", {exceptAfterSingleLine: true}],
"max-classes-per-file": "off",
"no-continue": "off",
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-else-return": "off",
"no-floating-decimal": "off",
"no-loop-func": "off",
"@typescript-eslint/no-loop-func": ["error"],
"no-plusplus": "off",
"no-trailing-spaces": "off", // pre-commit will enforce this
"no-underscore-dangle": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
"object-curly-newline": "off",
"object-curly-spacing": "off",
"prefer-template": "off",
"quotes": "off", // In general this is awfully noisy; ideally it would be ["error", "double"]
"radix": "off",
"react/destructuring-assignment": "off",
"react/jsx-wrap-multilines": "off",
"react/static-property-placement": "off",
"new-cap": "off",
"no-restricted-syntax": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"space-before-function-paren": "off",
"spaced-comment": ["error", "always", {
"block": {
"exceptions": ["/"],
},
}],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"unicorn/catch-error-name": "off",
"unicorn/consistent-destructuring": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/filename-case": "off",
"unicorn/import-style": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-for-loop": "off",
"unicorn/no-new-array": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/prefer-modern-dom-apis": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-spread": "off",
"unicorn/prefer-string-slice": "off",
"unicorn/prefer-ternary": "off",
"unicorn/prevent-abbreviations": "off",
// These rules may be removable with some work
"no-param-reassign": "off",
"react/button-has-type": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-one-expression-per-line": "off",
"react/sort-comp": "off",
"react/state-in-constructor": "off",
"react/require-default-props": "off",
"react/forbid-prop-types": "off",
},
overrides: [
{
files: ["*.test.js"],
rules: {
"no-undef": "off",
},
},
{
files: ["js/books.ts"],
rules: {
"quote-props": "off",
"comma-dangle": "off",
"unicorn/escape-case": "off",
},
},
{
files: ["*.js", "*.jsx"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
},
},
{
files: ["*.tsx"],
rules: {
"react/jsx-filename-extension": "off",
},
},
{
files: ["*.[jt]sx"],
rules: {
"unicorn/no-null": "off",
},
},
{
files: ["api_request_handler.ts"],
rules: {
"no-console": "off",
},
},
],
};