-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
125 lines (119 loc) · 3.48 KB
/
.eslintrc
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
{
"extends": [
// "react-app",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
// "plugin:mdx/recommended"
],
"env": {
"node": true,
"es6": true,
"jest": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react"
],
"parserOptions": {
"project": "./tsconfig.eslint.json",
"createDefaultProgram": true, // this is bad, but the VSCode bug is super annoying
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
// App-specific
"@typescript-eslint/camelcase": "off",
// ESLint
// Replaces the need for Prettier
// "max-len": ["error", { "code": 300 }],
"max-len": "off",
"semi": ["error", "always"],
"indent": "off",
"quotes": ["error", "single"],
"jsx-quotes": ["error", "prefer-double"],
"comma-dangle": ["error", "only-multiline"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": ["error", "never"],
"arrow-parens": ["error", "always"],
"keyword-spacing": ["warn", {
"before": true,
"after": true
}],
// ESLint (cont'd)
"no-case-declarations": "error",
"no-class-assign": "error",
"no-cond-assign": "error",
"no-console": ["warn", { "allow": ["warn", "error", "info"] }],
"no-constant-condition": "error",
"no-empty": "error",
"no-empty-pattern": "error",
"no-extra-semi": "off",
"no-global-assign": "error",
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-mixed-requires": "error",
"no-mixed-spaces-and-tabs": "error",
"no-negated-in-lhs": "error",
"no-new-require": "error",
"no-path-concat": "error",
"no-proto": "error",
"no-regex-spaces": "error",
"no-restricted-modules": ["error", "sys", "_linklist"],
"no-sparse-arrays": "error",
"no-undef": "error",
"no-unexpected-multiline": "off",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-vars": "off", // using typescript plugin instead
"constructor-super": "error",
"prefer-const": "error",
"quote-props": "off",
"require-yield": "error",
"linebreak-style": ["error", "unix"],
// TypeScript-ESLint
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }], // this ignores the unused var error for TS interfaces
"@typescript-eslint/no-use-before-define": "off",
// "@typescript-eslint/camelcase": "warn",
"@typescript-eslint/interface-name-prefix": "off",
// this rule is documented wrong in eslint's docs, or there's a bug with eslint
// "@typescript-eslint/array-type": ["error", {
// "default": "generic"
// }],
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}],
// React
"react/jsx-closing-bracket-location": "off",
// "react/jsx-closing-bracket-location": "error",
"react/jsx-uses-react": "error",
"react/jsx-key": "error",
"react/jsx-uses-vars": "error",
"react/prop-types": "off",
"react/react-in-jsx-scope": "error",
"react/display-name": "off",
"react/no-unescaped-entities": "off",
"react/no-children-prop": "warn"
}
}