forked from airbnb/visx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.js
95 lines (83 loc) · 2.51 KB
/
base.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
const EXTS = ['.ts', '.tsx', '.js', '.jsx', '.json'];
const EXTS_GROUP = '{ts,tsx,js,jsx}';
const ASSET_EXT_PATTERN = /\.(ttf|eot|otf|svg|woff|woff2|mp3|png|jpg|jpeg|gif|ico)$/;
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
},
extends: ['airbnb', 'plugin:jsx-a11y/recommended'],
plugins: ['import', 'react', 'react-hooks'],
globals: {
// Metrics and analytics providers
ga: 'readonly',
// Mostly for easier compatibility between browsers, workers, etc
global: 'readonly',
// Mostly references to `process.env.NODE_ENV`
process: 'readonly',
},
env: {
browser: true,
node: false,
},
reportUnusedDisableDirectives: true,
settings: {
propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
'import/ignore': ['node_modules', '\\.json$', ASSET_EXT_PATTERN.source],
'import/extensions': EXTS,
'import/resolver': {
node: {
extensions: EXTS,
},
},
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
overrides: [
{
files: [`*.test.${EXTS_GROUP}`],
plugins: ['jest'],
globals: {
jsdom: 'readonly',
},
env: {
jest: true,
node: true,
},
rules: {
'max-classes-per-file': 'off',
'no-magic-numbers': 'off',
'sort-keys': 'off',
// JEST
'jest/expect-expect': 'error',
'jest/no-alias-methods': 'error',
'jest/no-done-callback': 'error',
'jest/no-disabled-tests': 'error',
'jest/no-duplicate-hooks': 'error',
'jest/no-export': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/no-if': 'error',
'jest/no-jasmine-globals': 'error',
'jest/no-standalone-expect': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-hooks-on-top': 'error',
'jest/prefer-spy-on': 'error',
'jest/prefer-todo': 'error',
'jest/prefer-to-be': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/require-to-throw-message': 'error',
'jest/require-top-level-describe': 'error',
'jest/valid-describe-callback': 'error',
'jest/valid-expect': 'error',
'jest/valid-title': 'error',
// REACT
'react/function-component-definition': 'off',
},
},
],
};