-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
80 lines (65 loc) · 2.04 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
module.exports = {
root: true,
env: {
browser: true,
amd: true,
node: true,
},
extends: [
'plugin:@wordpress/eslint-plugin/esnext',
],
rules: {
// No semi-colons because they're a hassle.
'semi': [ 'error', 'never' ],
// Only use parenthesis on arrow functions that need them since it's a hassle.
'arrow-parens': [ 'error', 'as-needed' ],
// Allow our deprecated properties since they're readable.
'camelcase': [ 'error', {
allow: [ '\\w+(_\\d+)+' ],
} ],
// Force destructuring assignments to be multiline if they have lots of variables.
'object-curly-newline': [ 'error', {
multiline: true,
minProperties: 3,
consistent: true,
} ],
// I don't like block comments that are too close.
'lines-around-comment': [ 'error', {
beforeBlockComment: true,
} ],
// Allow assigning same named variables (mainly for function arguments) in inside code-blocks.
'no-shadow': 'off',
// For me it's easier to read nested ternary if you add some formatting.
'no-nested-ternary': 'off',
// Allow tabs and spaces mixed for aesthetics.
'no-mixed-spaces-and-tabs': [ 'error', 'smart-tabs' ],
// Sort to find stuff easier.
'sort-vars': [ 'error', { ignoreCase: true } ],
// 'sort-keys': ["error", "asc", {caseSensitive: false, natural: true}],
// Allow arrays to be consistently vertical or horizontal.
'array-element-newline': [ 'error', 'consistent' ],
// We know what we're doing.
'@wordpress/valid-sprintf': 'off',
// Off since returning false positives.
'@wordpress/no-unused-vars-before-return': 'off',
'jsdoc/no-undefined-types': 'off',
'@wordpress/no-unguarded-get-range-at': 'off',
// LF style line breaks.
// 'linebreak-style': [ 'error', 'unix' ],
// Added linebreak-style off to avoid cross platform eol error.
'linebreak-style': 'off',
'quotes': [ 'error', 'single' ],
'quote-props': [ 'error', 'consistent' ],
},
globals: {
Cypress: true,
cy: true,
context: true,
beforeEach: true,
afterEach: true,
it: true,
expect: true,
describe: true,
assert: true,
},
}