-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact.js
61 lines (55 loc) · 1.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
},
plugins: ['promise'],
extends: [
'./base',
'airbnb',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:promise/recommended',
'plugin:import/recommended',
'prettier',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
rules: {
// Allow JSX not allowed in files with extension '.js'
'react/jsx-filename-extension': 'off',
// new JSX transform
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
"react/display-name": "off",
"react/jsx-no-bind": "off",
/* Allow 'React' was used before it was defined */
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
},
],
'import/prefer-default-export': 'off',
// for preventing "'React' was used before it was defined"
'no-use-before-define': 'off',
// Not interested in consistent types of function components
'react/function-component-definition': 'off',
// asserts that the label has htmlFor, a nested label, both or either.
'jsx-a11y/label-has-associated-control': [
'error',
{
assert: 'either',
},
],
},
};