-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
93 lines (91 loc) · 2.42 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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"airbnb",
"airbnb/hooks",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 13,
sourceType: "module",
},
overrides: [
{
extends: [
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
files: ["*.ts", "*.tsx"], // Your TypeScript files extension
parserOptions: {
project: ["./tsconfig.json"], // Specify it only for TypeScript files
},
rules: {
quotes: "off",
"@typescript-eslint/quotes": ["error", "double"],
"lines-between-class-members": "off",
"@typescript-eslint/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
// Ignore trailing comma in generics, as it is required to avoid syntax errors in some
// contexts in .tsx files
// TODO: Only apply this to .tsx files (not .ts files)
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": ["error", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "always-multiline",
enums: "always-multiline",
generics: "ignore",
tuples: "always-multiline",
}],
},
},
],
parser: "@typescript-eslint/parser",
plugins: [
"react",
"@typescript-eslint",
"only-warn",
],
rules: {
// Fixing TypeScript stuff
"import/extensions": [
"error",
"ignorePackages",
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never",
},
],
// Custom stuff
quotes: ["error", "double"],
"lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
"react/jsx-one-expression-per-line": "off",
"max-len": ["error", {
code: 100,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
}],
"react/no-array-index-key": "off",
"no-underscore-dangle": ["error", { allow: ["__"] }],
"no-param-reassign": "off",
},
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
};