forked from ampproject/amp-wp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
109 lines (109 loc) · 3.19 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
{
"root": true,
"extends": [
"plugin:@wordpress/eslint-plugin/recommended-with-formatting",
"plugin:import/recommended",
"plugin:eslint-comments/recommended"
],
"rules": {
"block-scoped-var": "error",
"complexity": ["error", { "max": 20 } ],
"consistent-return": "error",
"default-case": "error",
"guard-for-in": "error",
"no-await-in-loop": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-loop-func": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-restricted-properties": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-shadow": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": true
}
],
"no-useless-call": "error",
"no-useless-concat": "error",
"prefer-object-spread": "error",
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"radix": [ "error", "as-needed" ],
"require-await": "error",
"rest-spread-spacing": [ "error", "never" ],
"react/prop-types": "error",
"react-hooks/exhaustive-deps": [ "error", { "additionalHooks": "useSelect" } ],
"react/jsx-closing-tag-location": "error",
"react/jsx-fragments": "error",
"react/jsx-first-prop-new-line": "error",
"react/jsx-max-props-per-line": [ "error", { "when": "multiline" } ],
"react/jsx-no-literals": "error",
"react/jsx-no-useless-fragment": "error",
"react/jsx-one-expression-per-line": "error",
"react/no-unused-prop-types": "error",
"react/self-closing-comp": "error",
"import/no-unresolved": [ "error", {
"ignore": [ "jquery", "amp-block-editor-data" ]
} ],
"import/order": [ "error", { "groups": [ "builtin", [ "external", "unknown" ], "internal", "parent", "sibling", "index" ] } ],
"jsdoc/check-indentation": "error",
"@wordpress/dependency-group": "error",
"@wordpress/react-no-unsafe-timeout": "error"
},
"overrides": [
{
"files":[
"**/__tests__/**/*.js",
"**/test/*.js",
"**/?(*.)test.js",
"tests/js/**/*.js"
],
"extends": [
"plugin:jest/all"
],
"rules": {
"jest/lowercase-name": [
"error",
{
"ignore": [ "describe" ]
}
],
"jest/no-hooks": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off"
}
},
{
"files": [ "tests/e2e/**/*.js" ],
"extends": [
"plugin:@wordpress/eslint-plugin/test-e2e",
"plugin:jest/all"
],
"rules": {
"jest/lowercase-name": [
"error",
{
"ignore": [ "describe" ]
}
],
"jest/no-hooks": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off"
}
}
]
}