-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
136 lines (130 loc) Β· 3.65 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
/* eslint-disable unicorn/prefer-module */
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true,
es2022: true,
node: true
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:jsx-a11y/strict",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:unicorn/all"
],
globals: {
Atomics: "readonly",
NodeJS: "readonly",
SharedArrayBuffer: "readonly",
$: "readonly"
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2022,
sourceType: "module"
},
plugins: [
"react",
"react-hooks",
"simple-import-sort",
"unicorn",
"@typescript-eslint"
],
rules: {
"array-bracket-newline": ["error", "consistent"],
"array-bracket-spacing": ["error", "never"],
"array-callback-return": "error",
"array-element-newline": ["error", "consistent"],
"comma-dangle": ["error", "never"],
"dot-location": ["error", "property"],
eqeqeq: ["error", "always", { null: "ignore" }],
"func-call-spacing": ["error", "never"],
"function-call-argument-newline": ["error", "consistent"],
indent: ["error", "tab", { SwitchCase: 1, offsetTernaryExpressions: true }],
"max-lines-per-function": ["warn", { max: 300 }],
"max-params": ["warn", { max: 5 }],
"multiline-comment-style": ["error", "separate-lines"],
"multiline-ternary": ["error", "always-multiline"],
"newline-per-chained-call": ["error", { ignoreChainWithDepth: 1 }],
"no-empty": "off",
"no-implicit-coercion": "error",
// Disabling because this false-positives a lot when using spaces to align things. Itβs too
// noisy to use an eslint disable comment every time this gets in the way.
"no-mixed-spaces-and-tabs": "off",
"no-spaced-func": "off",
// Has a lot of false positives
"no-unused-vars": "off",
"no-useless-return": "error",
"no-var": "error",
"no-warning-comments": "warn",
"object-curly-newline": [
"error",
{
multiline: true,
consistent: true
}
],
"object-curly-spacing": ["error", "always"],
"object-shorthand": ["error", "always"],
"one-var": ["error", "never"],
"padded-blocks": ["error", "never"],
"prefer-const": ["error", { destructuring: "all" }],
"prefer-template": "error",
"quote-props": ["error", "as-needed"],
quotes: ["error", "double", { allowTemplateLiterals: true }],
semi: ["error", "always", { omitLastInOneLineBlock: true }],
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true
}
],
"space-before-function-paren": [
"error",
{
anonymous: "always",
asyncArrow: "always",
named: "never"
}
],
"spaced-comment": ["error", "always", { markers: ["/", "!", "*"] }],
"import/no-anonymous-default-export": "off",
"react/no-unknown-property": ["error", { ignore: ["class", "for"] }],
"unicorn/consistent-function-scoping": "off",
"unicorn/custom-error-definition": "off",
"unicorn/filename-case": [
"warn",
{
cases: {
pascalCase: true,
kebabCase: true,
camelCase: true
},
ignore: ["API", "ID", "IP", "PDF", "URL", "OMG", "WTF", "BBQ"]
}
],
"unicorn/no-array-callback-reference": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/no-keyword-prefix": "off",
"unicorn/no-null": "off",
"unicorn/no-static-only-class": "off",
// This rule is confusing. What am I meant to fix?
"unicorn/no-unsafe-regex": "off",
"unicorn/no-useless-undefined": ["error", { checkArguments: false }],
"unicorn/prefer-node-protocol": "off",
"unicorn/prevent-abbreviations": "off"
},
settings: {
react: {
version: "18"
}
}
};