-
Notifications
You must be signed in to change notification settings - Fork 42
/
.eslintrc.js
146 lines (146 loc) · 5.23 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
144
145
146
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
ignorePatterns: ['public', 'build'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: '16',
},
},
plugins: [
'react',
'@typescript-eslint',
'@tanstack/query',
],
globals: {
find: 'off',
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@tanstack/eslint-plugin-query/recommended',
],
rules: {
'array-bracket-spacing': ['error', 'never'],
'arrow-parens': 'error',
'arrow-spacing': 'error',
'brace-style': 'off', // TypeScript extension
'comma-dangle': 'off', // TypeScript extension
'comma-spacing': 'off', // TypeScript extension
'computed-property-spacing': 'error',
'eol-last': 'error',
eqeqeq: 'error',
'generator-star-spacing': 'error',
indent: ['error', 2, { SwitchCase: 1, MemberExpression: 0 }],
'jsx-quotes': ['error', 'prefer-double'],
'key-spacing': 'error',
'keyword-spacing': 'off', // TypeScript extension
'no-cond-assign': 'error',
// We're making console statements report as warnings, so that it's easier
// to tell in the editor when there are real errors vs just console
// statements. But CI checks that there aren't any warnings in addition to
// errors, so we're still enforcing that no console statements are checked
// in.
'no-console': 'warn',
'no-debugger': 'error',
'no-delete-var': 'error',
'no-dupe-args': 'error',
'no-dupe-else-if': 'error',
'no-duplicate-case': 'error',
'no-empty': 'error',
'no-empty-pattern': 'error',
'no-eval': 'error',
'no-ex-assign': 'error',
'no-extra-semi': 'off', // TypeScript extension
'no-func-assign': 'error',
'no-implied-eval': 'error',
'no-import-assign': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-misleading-character-class': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-multi-spaces': ['error', {
ignoreEOLComments: true,
exceptions: {
VariableDeclarator: true,
},
}],
'no-redeclare': 'off', // TypeScript extension
'no-regex-spaces': 'error',
'no-shadow': 'off', // TypeScript extension
'no-shadow-restricted-names': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'error',
'no-unused-vars': 'off', // TypeScript extension
'no-use-before-define': 'off', // TypeScript extension
'no-useless-rename': 'error',
'no-var': 'error',
'object-curly-spacing': 'off', // TypeScript extension
'object-shorthand': 'error',
'padded-blocks': ['error', { classes: 'never' }],
'prefer-const': ['error', { destructuring: 'all' }],
'prefer-template': 'error',
'quote-props': ['error', 'as-needed'],
quotes: 'off', // TypeScript extension
radix: 'error',
'react/boolean-prop-naming': 'error',
'react/jsx-boolean-value': ['error', 'never', {
always: [
// We always want isRange because of the DatePicker component. The type
// of its props uses a union type, so the JSX needs to explicitly be a
// boolean value, not just the presence of the prop.
'isRange',
],
}],
'react/jsx-props-no-multi-spaces': 'error',
'react/jsx-sort-props': 'error',
'react/jsx-tag-spacing': ['error', {
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
}],
'react/jsx-uses-react': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
semi: 'off', // TypeScript extension
'space-before-function-paren': 'off', // TypeScript extension
'space-in-parens': 'error',
'space-infix-ops': 'off', // TypeScript extension
'template-curly-spacing': 'error',
yoda: 'error',
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/comma-spacing': ['error', { before: false, after: true }],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/keyword-spacing': 'error',
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'@typescript-eslint/no-extra-semi': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/quotes': ['error', 'single'],
'@typescript-eslint/semi': 'error',
'@typescript-eslint/space-before-function-paren': 'error',
'@typescript-eslint/space-infix-ops': ['error', { int32Hint: false }],
'@typescript-eslint/type-annotation-spacing': 'error',
},
};