-
Notifications
You must be signed in to change notification settings - Fork 308
/
eslint.config.js
102 lines (99 loc) · 3.58 KB
/
eslint.config.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
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
// Plugins
const cypress = require('eslint-plugin-cypress/flat');
const compat = new FlatCompat({ recommendedConfig: js.configs.recommended });
module.exports = [
{
ignores: [
'build/',
'dist/',
'es/',
'flow/',
'flow-typed/npm/',
'i18n/',
'node_modules/',
'reports/',
'styleguide/',
'**/__snapshots__/',
'**/*.json',
'**/*.png',
],
},
...compat.extends(
require.resolve('@box/frontend/eslint/base'),
require.resolve('@box/frontend/eslint/react'),
require.resolve('@box/frontend/eslint/typescript'),
require.resolve('@box/frontend/eslint/flow'),
),
cypress.configs.recommended,
{
rules: {
camelcase: 'off',
'class-methods-use-this': 'off',
'import/export': 'off', // fixme
'import/no-extraneous-dependencies': 'off', // fixme
'import/no-named-as-default': 'off', // fixme
'import/no-named-as-default-member': 'off', // fixme
'import/no-unresolved': 'off', // fixme
'jsx-a11y/label-has-associated-control': 'off',
'react/default-props-match-prop-types': 'off', // fixme
'react/destructuring-assignment': 'off', // fixme
'react/forbid-prop-types': 'off', // fixme
'react/jsx-no-bind': 'off', // fixme
'react/jsx-sort-props': 'off', // fixme
'react/no-access-state-in-setstate': 'off', // fixme
'react/no-array-index-key': 'off', // fixme
'react/no-this-in-sfc': 'off',
'react/no-unknown-property': 'off', // fixme
'react/no-unused-prop-types': 'off', // fixme
'react/prop-types': 'off', // fixme
'react/sort-comp': 'off', // fixme
'no-promise-executor-return': 'off', // fixme
'no-undef': 'off', // fixme
'no-unused-expressions': 'off', // fixme
},
},
{
files: ['**/*.test.js', '**/*.test.tsx'],
languageOptions: {
globals: {
BoxVisualTestUtils: true,
shallow: true,
mount: true,
},
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-check': 'allow-with-description',
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
minimumDescriptionLength: 1,
},
],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
Function: false, // fixme
Object: false, // fixme
object: false, // fixme
'{}': false, // fixme
},
},
],
'@typescript-eslint/explicit-function-return-type': 'off', // fixme
'@typescript-eslint/explicit-module-boundary-types': 'off', // fixme
'@typescript-eslint/no-non-null-assertion': 'off', // fixme
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-use-before-define': ['error'],
},
},
];