forked from box/box-ui-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
68 lines (67 loc) · 2.67 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
const eslintrc = require.resolve('@box/frontend/eslint/eslintrc.js');
module.exports = {
extends: [eslintrc],
rules: {
camelcase: 'off',
'class-methods-use-this': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'import/no-extraneous-dependencies': 'off', // fixme
'react/default-props-match-prop-types': 'off', // fixme
'react/destructuring-assignment': 'off', // fixme
'react/forbid-prop-types': 'off', // fixme
'react/jsx-sort-props': 'off', // fixme
'react/jsx-no-bind': 'off', // fixme
'react/sort-comp': 'off', // fixme
'react/no-unused-prop-types': 'off', // fixme
'react/no-access-state-in-setstate': 'off', // fixme
'react/no-array-index-key': 'off', // fixme
'react/no-this-in-sfc': 'off',
'import/no-unresolved': 'off', // fixme
},
overrides: [
{
files: ['*.test.js', '*.test.tsx'],
globals: {
BoxVisualTestUtils: true,
shallow: true,
mount: true,
},
},
{
files: ['*.ts', '*.tsx'],
rules: {
'flowtype/no-types-missing-file-annotation': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off', // fixme
'@typescript-eslint/explicit-function-return-type': 'off', // fixme
'@typescript-eslint/ban-types': [
'error',
{
'types': {
'Function': false, // fixme
'Object': false, // fixme
'object': false, // fixme
'{}': false, // fixme
}
}
],
// note you must disable the base rule as it can report incorrect errors:
'no-use-before-define': 'off',
'@typescript-eslint/ban-ts-ignore': 'off', // deprecated
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': 'allow-with-description',
minimumDescriptionLength: 1,
},
],
'camelcase': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
},
},
],
};