UNPKG

2.74 kBJavaScriptView Raw
1// https://eslint.org/docs/rules/
2// ALL RULES [...$$('td > [title=fixable]')].map(d => d.parentNode.nextElementSibling.querySelector('a').getAttribute('href'))
3
4const ruleIDs = [
5 // Possible Errors
6 'no-extra-boolean-cast',
7 'no-extra-parens',
8 'no-extra-semi',
9 'no-regex-spaces',
10 'no-unsafe-negation',
11
12 // Best Practices
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 // 'no-implicit-coercion',
23 'no-multi-spaces',
24 'no-unused-labels',
25 'no-useless-return',
26 'wrap-iife',
27 'yoda',
28
29 // Strict Mode
30 // 'strict',
31
32 // Variables
33 'no-undef-init',
34
35 // Stylistic Issues ()
36 'array-bracket-newline',
37 'array-bracket-spacing',
38 'array-element-newline',
39 'block-spacing',
40 'brace-style',
41 // 'capitalized-comments',
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 // 'lines-between-class-members',
55 // 'multiline-comment-style',
56 'new-parens',
57 'newline-per-chained-call',
58 // 'no-lonely-if',
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 // 'padding-line-between-statements',
73 'quote-props',
74 'quotes',
75 'semi',
76 'semi-spacing',
77 'semi-style',
78 // 'sort-vars',
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
91const 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
98module.exports = {
99 rules: {
100 ...rules,
101 'one-var': ['warn', 'never'],
102
103 // require or disallow a space immediately following the // or /* in a comment
104 // https://eslint.org/docs/rules/spaced-comment
105 'spaced-comment': [
106 'warn',
107 'always',
108 {
109 line: {
110 exceptions: ['-', '+'],
111 markers: ['=', '!', '/'], // space here to support sprockets directives
112 },
113 block: {
114 exceptions: ['-', '+'],
115 markers: ['=', '!'], // space here to support sprockets directives
116 balanced: true,
117 },
118 },
119 ],
120 },
121};