forked from Yoast/wordpress-seo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
134 lines (130 loc) · 3.57 KB
/
.eslintrc
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
127
128
129
130
131
132
133
134
extends: yoast
parserOptions:
ecmaVersion: 2018
sourceType: module
settings:
react:
version: "16.8"
rules:
no-prototype-builtins: 0
comma-dangle:
- error
- arrays: always-multiline
objects: always-multiline
imports: always-multiline
exports: always-multiline
functions: never
overrides:
- files:
- "packages/*/tests/**/*.js"
- "packages/*/spec/**/*.js"
# Temporary exclusion:
- "packages/components/a11y/tests/**/*.js"
env:
jest: true
rules:
no-restricted-imports: "off"
- files:
- "packages/schema-blocks/src/**"
env:
jest: true
rules:
new-cap: 0
complexity:
- 2
- 10
"@typescript-eslint/no-parameter-properties":
- 2
- allows:
- protected readonly
- private readonly
"@typescript-eslint/explicit-function-return-type": 0
"@typescript-eslint/no-use-before-define":
- error
- functions: false
no-constant-condition:
- error
- checkLoops: false
max-statements:
- 2
- 33
no-unused-vars: 'off'
"@typescript-eslint/no-unused-vars":
- error
- varsIgnorePattern: "^createElement$"
no-dupe-class-members: 'off'
indent: 'off'
"@typescript-eslint/indent":
- 2
- tab
- SwitchCase: 1
space-before-function-paren:
- error
- anonymous: never
named: never
asyncArrow: always
valid-jsdoc:
- error
- requireReturn: false
requireReturnType: false
requireParamType: false
react/react-in-jsx-scope: 0
- files:
- "packages/components/**/*.js"
rules:
react/jsx-no-bind: 1
react/require-default-props: 1
react/default-props-match-prop-types: 1
react/no-unused-prop-types: 1
require-jsdoc: 1
- files:
- "packages/configuration-wizard/**/*.js"
rules:
react/no-unused-prop-types: 1
react/jsx-no-bind: 1
react/no-access-state-in-setstate: 1
require-jsdoc: 1
- files:
- "packages/replacement-variable-editor/**/*.js"
rules:
react/jsx-no-bind: 1
react/require-default-props: 1
- files:
- "packages/search-metadata-previews/**/*.js"
rules:
react/jsx-no-bind: 1
react/no-unused-state: 1
react/no-access-state-in-setstate: 1
react/require-default-props: 1
react/default-props-match-prop-types: 1
- files:
- "packages/yoastseo/**/*.js"
rules:
complexity: 1
# Longer grace period for Yoast config.
no-shadow: [ 1, { "builtinGlobals": false, "hoist": "all", "allow": [ ] } ]
require-jsdoc: [ 1, { "require": { "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, "FunctionExpression": true } } ]
no-useless-escape: 1
- files:
- "packages/yoast-components/**/*.js"
rules:
complexity: [ 1, 6 ]
// A wrapping label is not necessary when there already is an htmlFor attribute.
jsx-a11y/label-has-for: [ "error", { required: "id" } ]
require-jsdoc: 1
react/button-has-type: 1
react/default-props-match-prop-types: 1
react/no-unused-prop-types: 1
react/no-access-state-in-setstate: 1
react/no-unused-state: 1
react/jsx-no-bind: 1
react/jsx-no-target-blank: 1
react/require-default-props: 1
react/forbid-foreign-prop-types: 1
env:
jest: true
- files:
- "packages/**/tests/**/*Test.js"
rules:
no-console: 0
react/jsx-no-bind: 0