-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
44 lines (43 loc) · 1.28 KB
/
react.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
module.exports = {
plugins: ['react-hooks'],
extends: ['airbnb'],
env: {
browser: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
babelOptions: {
presets: ['@babel/preset-react'],
},
},
rules: {
'react/prop-types': 'off',
'react/jsx-filename-extension': 'off',
'react/require-default-props': 'off',
'react/no-unknown-property': 'off', // Allows custom properties to be used for css (is-desktop, etc) and for parents (columns, growX, etc)
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/function-component-definition': 'off', // TODO look into this more
'react/jsx-props-no-spreading': 'off',
'react/jsx-no-bind': [
'error',
{
ignoreRefs: true,
allowArrowFunctions: true,
allowFunctions: true, // 2024-06-05: We decided that it is fine to allowFunctions as there doesn't seem to be benefits for it
allowBind: false,
ignoreDOMComponents: true,
},
],
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
// Overrides airbnb's rule
'jsx-a11y/label-has-associated-control': [
'error',
{
assert: 'either', // fs-styles does not support nesting currently
},
],
},
}