-
Notifications
You must be signed in to change notification settings - Fork 33
/
.eslintrc.yml
126 lines (124 loc) · 3.52 KB
/
.eslintrc.yml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
env:
browser: true
es6: true
jest: true
node: true
cypress/globals: true
ignorePatterns:
- 'node_modules/'
- '/**/node_modules/'
- '**/node_modules/'
extends:
- 'eslint:recommended'
- 'plugin:react/recommended'
parser: '@babel/eslint-parser'
parserOptions:
ecmaFeatures:
experimentalObjectRestSpread: true
jsx: true
legacyDecorators: true
sourceType: module
plugins:
- react
- jsx-a11y
- import
- simple-import-sort
- cypress
- chai-friendly # See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions
settings:
react:
version: detect
rules:
linebreak-style: ['error', 'unix']
quotes: ['warn', 'single', { avoidEscape: true }]
semi: ['error', 'never']
import/first: ['warn']
simple-import-sort/imports: ['error']
no-else-return: off
no-trailing-spaces: ['warn']
no-continue: off
no-plusplus: off
radix: off
eol-last: ['warn']
prefer-const: ['warn']
no-restricted-globals: ['error', 'event', 'fdescribe']
no-mixed-operators: ['warn']
# See https://github.com/cypress-io/eslint-plugin-cypress#chai-and-no-unused-expressions
no-unused-expressions: 0
chai-friendly/no-unused-expressions: 2
# React
react/display-name: ['warn']
react/destructuring-assignment: off
react/jsx-indent-props: ['warn', 2]
react/jsx-first-prop-new-line: ['warn']
react/jsx-closing-bracket-location: ['warn']
react/jsx-curly-spacing: ['warn']
react/jsx-tag-spacing: ['warn', { beforeSelfClosing: 'allow' }]
react/jsx-wrap-multilines: ['warn']
react/no-unused-state: ['warn']
react/jsx-max-props-per-line: ['warn', { when: 'multiline' }]
react/jsx-closing-tag-location: ['warn']
react/no-unescaped-entities: ['warn']
react/no-unused-prop-types: ['warn']
react/self-closing-comp: ['warn']
react/jsx-indent: ['warn', 2]
react/no-array-index-key: ['warn']
react/prefer-stateless-function: off
react/forbid-prop-types: off
# JSX
jsx-a11y/anchor-is-valid:
- warn
- components: ['Link']
specialLink: ['To']
jsx-a11y/alt-text: ['warn']
jsx-a11y/label-has-for: ['warn']
jsx-a11y/label-has-associated-control:
- warn
- controlComponents:
- 'Field'
jsx-a11y/click-events-have-key-events: ['warn']
jsx-a11y/no-static-element-interactions: ['warn']
jsx-a11y/media-has-caption: ['warn']
jsx-a11y/accessible-emoji: ['warn']
jsx-a11y/anchor-has-content: off
no-console: ['error']
curly: ['error']
# Following rule haves been disabled for compatibility with
# existing code. Some of them should be re-activated in the future.
no-shadow: off
nonblock-statement-body-position: off
object-curly-spacing: off
object-curly-newline: off
object-property-newline: off
comma-dangle: off
function-paren-newline: off
arrow-parens: off
arrow-body-style: off
no-use-before-define: off
no-param-reassign: off
camelcase: off
no-underscore-dangle: off
no-restricted-syntax: off
prefer-destructuring: off
consistent-return: off
class-methods-use-this: off
prefer-promise-reject-errors: off
import/prefer-default-export: off
import/export: off
block-spacing: off
brace-style: off
no-multi-spaces: off
max-len: off # Handled by prettier
# React-specific temporarily disabled rules
react/prop-types: off
react/no-string-refs: off
react/react-in-jsx-scope: off # Generates erros in tests
react/sort-comp: off
react/require-default-props: off
react/jsx-one-expression-per-line: off
react/jsx-no-bind: off
globals:
# For tests
snapshot: false
snapshotReducer: false
snapshotComponent: false