-
Notifications
You must be signed in to change notification settings - Fork 10
/
.eslintrc.js
183 lines (182 loc) · 5.35 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// Copyright 2018 Stanford University see Apache2.txt for license
module.exports = {
plugins: [
'import',
'jest',
'jsx-a11y',
'react',
'react-hooks',
'security',
'cypress'
],
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:jsx-a11y/recommended',
'plugin:security/recommended',
'airbnb-base',
'plugin:cypress/recommended',
'prettier'
],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
node: {
resolvePaths: ['src', '__tests__/testUtilities'],
tryExtensions: ['.js', '.jsx', '.json', '.node'],
},
'import/resolver': {
node: {
paths: ['src', '__tests__/testUtilities'],
extensions: ['.js', '.jsx'],
},
},
react: {
version: '16.6',
},
},
env: {
browser: true,
jest: true,
node: true,
es6: true,
},
rules: {
'array-callback-return': 'off',
'brace-style': 'off',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
eqeqeq: ['error', 'smart'],
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'global-require': 'off',
'guard-for-in': 'off',
'id-length': 'off',
'import/exports-last': 'off',
'import/group-exports': 'off',
'import/max-dependencies': 'off',
'import/no-commonjs': 'off',
'import/no-cycle': 'off',
'import/no-default-export': 'off',
'import/no-dynamic-require': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-internal-modules': 'off',
'import/no-mutable-exports': 'off',
'import/no-named-as-default': 'off',
'import/no-namespace': 'off',
'import/no-nodejs-modules': 'off',
'import/no-relative-parent-imports': 'off',
'import/no-unassigned-import': 'off',
'import/order': 'off',
'import/unambiguous': 'off',
'indent': 'off', // Off for prettier
'init-declarations': 'off',
'jsx-a11y/anchor-is-valid': 'warn', // see #172
'jsx-a11y/label-has-for': 'off', // see #173
'jsx-a11y/no-onchange': 'warn', // The DropZone select form needs an onChange prop to set the state with the new group
'jsx-a11y/no-noninteractive-tabindex': ['off', { roles: ['tooltip'] }],
'lines-around-comment': 'off', // Off for prettier
'max-classes-per-file': 'off',
'max-len': 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
'max-statements-per-line': 'off',
'multiline-comment-style': 'off',
'new-cap': 'off',
'newline-after-var': 'off', // deprecated rule, enabled by airbnb-base/whitespace
'newline-before-return': 'off',
'node/no-extraneous-import': 'off', // turning off because objects to our imports
'no-alert': 'off',
'no-await-in-loop': 'off',
'no-console': ['warn', { allow: ['error', 'info'] }], // we want to see errors in the console
'no-extra-semi': 'off', // Off for prettier
'no-inline-comments': 'off',
'no-invalid-this': 'off',
'no-magic-numbers': 'off',
'no-negated-condition': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-process-env': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-return-await': 'off',
'no-sequences': 'off',
'no-shadow': 'off',
'no-sync': 'off',
'no-ternary': 'off',
'no-throw-literal': 'off',
'no-undefined': 'off',
'no-underscore-dangle': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_.*' }],
'no-use-before-define': 'off',
'no-useless-constructor': 'warn',
'no-var': 'error',
'no-warning-comments': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'prefer-const': 'error',
'prefer-destructuring': 'off',
'prefer-reflect': 'off',
'quotes': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-indent': 'off', // Off for prettier
'react/jsx-indent-props': 'off', // Off for prettier
'react/no-unknown-property': ['error', { ignore: ['placement', 'trigger']}],
'require-await': 'off',
'require-jsdoc': 'off',
'require-unicode-regexp': 'off',
'security/detect-object-injection': 'off',
'semi': 'off', // Off for prettier,
'sort-imports': 'off',
'sort-keys': 'off',
'valid-jsdoc': 'off',
},
overrides: [
{
// Allow tests to include block statements (idiomatic Jest style)
files: ['__tests__/**'],
rules: {
'arrow-body-style': 'off',
'max-lines': 'off',
'max-len': 'off',
},
extends: ['plugin:testing-library/react']
},
{
// Bootstrap styles require that navbar's use <a> instead of <btn>, so ignoring.
// Might be able to fix this with BS4.
files: [
'src/components/Header.jsx',
'src/components/home/Header.jsx'
],
rules: {
'jsx-a11y/anchor-is-valid': 'off',
},
},
{
files: [
'react-testing-library.setup.js'
],
rules: {
'node/no-unpublished-import': 'off',
},
},
{
files: ['cypress/plugins/index.js'],
rules: {
'no-unused-vars': 'off',
},
},
],
}