1 |
|
2 |
|
3 |
|
4 | const ruleIDs = [
|
5 |
|
6 | 'no-extra-boolean-cast',
|
7 | 'no-extra-parens',
|
8 | 'no-extra-semi',
|
9 | 'no-regex-spaces',
|
10 | 'no-unsafe-negation',
|
11 |
|
12 |
|
13 | 'curly',
|
14 | 'dot-location',
|
15 | 'dot-notation',
|
16 | 'eqeqeq',
|
17 | 'no-div-regex',
|
18 | 'no-else-return',
|
19 | 'no-extra-bind',
|
20 | 'no-extra-label',
|
21 | 'no-floating-decimal',
|
22 |
|
23 | 'no-multi-spaces',
|
24 | 'no-unused-labels',
|
25 | 'no-useless-return',
|
26 | 'wrap-iife',
|
27 | 'yoda',
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | 'no-undef-init',
|
34 |
|
35 |
|
36 | 'array-bracket-newline',
|
37 | 'array-bracket-spacing',
|
38 | 'array-element-newline',
|
39 | 'block-spacing',
|
40 | 'brace-style',
|
41 |
|
42 | 'comma-dangle',
|
43 | 'comma-spacing',
|
44 | 'comma-style',
|
45 | 'computed-property-spacing',
|
46 | 'eol-last',
|
47 | 'func-call-spacing',
|
48 | 'function-paren-newline',
|
49 | 'indent',
|
50 | 'key-spacing',
|
51 | 'keyword-spacing',
|
52 | 'linebreak-style',
|
53 | 'lines-around-comment',
|
54 |
|
55 |
|
56 | 'new-parens',
|
57 | 'newline-per-chained-call',
|
58 |
|
59 | 'no-multiple-empty-lines',
|
60 | 'no-trailing-spaces',
|
61 | 'no-unneeded-ternary',
|
62 | 'no-whitespace-before-property',
|
63 | 'nonblock-statement-body-position',
|
64 | 'object-curly-newline',
|
65 | 'object-curly-spacing',
|
66 | 'object-property-newline',
|
67 | 'one-var',
|
68 | 'one-var-declaration-per-line',
|
69 | 'operator-assignment',
|
70 | 'operator-linebreak',
|
71 | 'padded-blocks',
|
72 |
|
73 | 'quote-props',
|
74 | 'quotes',
|
75 | 'semi',
|
76 | 'semi-spacing',
|
77 | 'semi-style',
|
78 |
|
79 | 'space-before-blocks',
|
80 | 'space-before-function-paren',
|
81 | 'space-in-parens',
|
82 | 'space-infix-ops',
|
83 | 'space-unary-ops',
|
84 | 'spaced-comment',
|
85 | 'switch-colon-spacing',
|
86 | 'template-tag-spacing',
|
87 | 'unicode-bom',
|
88 | 'wrap-regex',
|
89 | ];
|
90 |
|
91 | const rules = Object.fromEntries
|
92 | ? Object.fromEntries(ruleIDs.map((rule) => [rule, 'warn']))
|
93 | : ruleIDs.reduce((rules, id) => {
|
94 | rules[id] = 'warn';
|
95 | return rules;
|
96 | }, {});
|
97 |
|
98 | module.exports = {
|
99 | rules: {
|
100 | ...rules,
|
101 | 'one-var': ['warn', 'never'],
|
102 |
|
103 |
|
104 |
|
105 | 'spaced-comment': [
|
106 | 'warn',
|
107 | 'always',
|
108 | {
|
109 | line: {
|
110 | exceptions: ['-', '+'],
|
111 | markers: ['=', '!', '/'],
|
112 | },
|
113 | block: {
|
114 | exceptions: ['-', '+'],
|
115 | markers: ['=', '!'],
|
116 | balanced: true,
|
117 | },
|
118 | },
|
119 | ],
|
120 | },
|
121 | };
|