-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
83 lines (83 loc) · 1.39 KB
/
.eslintrc.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module.exports = {
root: true,
"extends": [
"yoast",
],
parser: "@babel/eslint-parser",
parserOptions: {
ecmaVersion: 2019,
sourceType: "module",
},
plugins: [
"@babel",
],
settings: {
react: {
version: "detect",
},
},
rules: {
// We use 'wp.element.createElement' instead of the 'react' package directly.
"react/react-in-jsx-scope": "off",
"no-restricted-imports": [
"error",
{
name: "react",
message: "Please use @wordpress/element instead. No need to import just for JSX.",
},
{
name: "react-dom",
message: "Please use @wordpress/element instead.",
},
],
"no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
},
],
"max-len": [
"error",
{
code: 150,
ignoreStrings: true,
ignorePattern: "[\t]*<path [\\w\\W]*/>\n",
},
],
"space-unary-ops": [
"error",
{
words: true,
nonwords: false,
overrides: {
"!": true,
"!!": true,
},
},
],
"space-before-function-paren": [
"error",
{
anonymous: "never",
named: "never",
asyncArrow: "always",
},
],
"template-curly-spacing": [
"error",
"always",
],
},
overrides: [
{
files: [ "src/**/*.stories.js", "src/**/stories.js" ],
rules: {
"no-unused-vars": "off",
"require-jsdoc": "off",
"valid-jsdoc": "off",
"react/prop-types": "off",
},
},
],
};