-
Notifications
You must be signed in to change notification settings - Fork 26
/
.eslintrc.yaml
100 lines (99 loc) 路 2.49 KB
/
.eslintrc.yaml
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
---
parser: babel-eslint
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 8
sourceType: module
extends:
- 'airbnb-base'
- 'plugin:jest/recommended'
- 'plugin:react/recommended'
- 'prettier'
- 'prettier/react'
env:
browser: true
es6: true
jest: true
node: true
mocha: false
plugins:
- 'import'
- 'jest'
- 'jsx-a11y'
- 'prettier'
- 'prefer-object-spread'
- 'react'
overrides:
- files: ['*.spec.js']
rules:
'react/display-name': 0
settings:
import/ignore:
# included by default, but replaced if explicitly configured
- node_modules
# We use `export * from 'react-testing-library';` in `test-utils`, so that
# tests can do `import { render, fireEvent }` from '../test-utils'`.
# Because we export the whole namespace, the `import/ignore` rule can't find
# the named exports. So we disable the rule for imports of that file.
- test-utils.js
react:
pragma: React
version: detect
rules:
'class-methods-use-this':
- 'error'
- exceptMethods: [
'render',
'getInitialState',
'getDefaultProps',
'getChildContext',
'shouldComponentUpdate',
'UNSAFE_componentWillMount',
'UNSAFE_componentWillReceiveProps',
'UNSAFE_componentWillUpdate',
'componentWillUnmount',
'componentDidMount',
'componentDidUpdate',
]
'function-paren-newline': 0
'import/extensions': [
'error',
'always',
{
js: 'never',
},
]
'import/no-extraneous-dependencies': 0
'import/no-named-as-default': 0
'import/no-unresolved': 0
'import/first': 0
'import/order': 2
'no-restricted-globals': ['error', 'find', 'name', 'location']
'no-warning-comments': 0
'no-use-before-define': [
'error',
{
functions: false,
},
]
'no-underscore-dangle': 0
'jest/no-identical-title': 'warn'
'jest/no-focused-tests': 2
'react/jsx-uses-vars': 2
'react/wrap-multilines': 0
'react/no-deprecated': 'error'
'react/no-find-dom-node': 0
'react/display-name': [
1,
{
ignoreTranspilerName: true,
}
]
'prefer-object-spread/prefer-object-spread': 2
'prefer-destructuring': 0
'prefer-promise-reject-errors': 'warn'
'react/jsx-no-target-blank': 0
'lines-between-class-members': 0
# NOTE: The regular rule does not support do-expressions. The equivalent rule of babel does.
'no-unused-expressions': 0