|
10 | 10 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
11 | 11 | // For more information about any of the rules below, check out the relevant
|
12 | 12 | // reference page on eslint.org. For example, to get details on "no-sequences",
|
13 |
| - // you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure |
| 13 | + // you would visit `https://eslint.org/docs/rules/no-sequences`. If you're unsure |
14 | 14 | // or could use some advice, come by https://sailsjs.com/support.
|
15 | 15 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
16 | 16 |
|
17 | 17 | "env": {
|
18 |
| - "node": true |
| 18 | + "node": true, |
| 19 | + "es2021": true |
19 | 20 | },
|
20 | 21 |
|
21 | 22 | "parserOptions": {
|
22 |
| - "ecmaVersion": 5 |
23 |
| - // ^^This can be changed to `8` if this package doesn't need to support <= Node v6. |
| 23 | + "ecmaVersion": "latest" |
24 | 24 | },
|
25 | 25 |
|
| 26 | + "plugins": [ |
| 27 | + "eslint-comments" |
| 28 | + ], |
| 29 | + |
26 | 30 | "globals": {
|
27 | 31 | "Promise": true
|
28 | 32 | // ^^Available since Node v4
|
|
46 | 50 | "ObjectExpression": 1,
|
47 | 51 | "ignoredNodes": ["ConditionalExpression"]
|
48 | 52 | }],
|
| 53 | + // require let or const instead of var |
| 54 | + "no-var": "error", |
| 55 | + "no-whitespace-before-property": [ |
| 56 | + "error" |
| 57 | + ], |
| 58 | + "space-before-blocks": [ |
| 59 | + "error" |
| 60 | + ], |
| 61 | + "space-before-function-paren": [ |
| 62 | + "error", |
| 63 | + { |
| 64 | + "anonymous": "always", |
| 65 | + "named": "never" |
| 66 | + } |
| 67 | + ], |
| 68 | + "space-in-parens": [ |
| 69 | + "error" |
| 70 | + ], |
| 71 | + "space-infix-ops": [ |
| 72 | + "error" |
| 73 | + ], |
| 74 | + "space-unary-ops": [ |
| 75 | + "error" |
| 76 | + ], |
| 77 | + "spaced-comment": [ |
| 78 | + "error", |
| 79 | + "always", |
| 80 | + { |
| 81 | + "line": { |
| 82 | + "markers": [ |
| 83 | + "/" |
| 84 | + ], |
| 85 | + "exceptions": [ |
| 86 | + "-", |
| 87 | + "+" |
| 88 | + ] |
| 89 | + }, |
| 90 | + "block": { |
| 91 | + "markers": [ |
| 92 | + "!" |
| 93 | + ], |
| 94 | + "exceptions": [ |
| 95 | + "*" |
| 96 | + ], |
| 97 | + "balanced": true |
| 98 | + } |
| 99 | + } |
| 100 | + ], |
| 101 | + "arrow-body-style": [ |
| 102 | + "error", |
| 103 | + "as-needed", |
| 104 | + { |
| 105 | + "requireReturnForObjectLiteral": false |
| 106 | + } |
| 107 | + ], |
| 108 | + // require parens in arrow function arguments |
| 109 | + // https://eslint.org/docs/rules/arrow-parens |
| 110 | + "arrow-parens": [ |
| 111 | + "error", |
| 112 | + "as-needed", |
| 113 | + { |
| 114 | + "requireForBlockBody": true |
| 115 | + } |
| 116 | + ], |
| 117 | + // require space before/after arrow function"s arrow |
| 118 | + // https://eslint.org/docs/rules/arrow-spacing |
| 119 | + "arrow-spacing": [ |
| 120 | + "error", |
| 121 | + { |
| 122 | + "before": true, |
| 123 | + "after": true |
| 124 | + } |
| 125 | + ], |
| 126 | + // Allow "confusing arrows" since, well, we don't confuse them |
| 127 | + // https://eslint.org/docs/rules/no-confusing-arrow |
| 128 | + "no-confusing-arrow": "off", |
| 129 | + // disallow modifying variables that are declared using const |
| 130 | + "no-const-assign": "error", |
| 131 | + // require method and property shorthand syntax for object literals |
| 132 | + // https://eslint.org/docs/rules/object-shorthand |
| 133 | + "object-shorthand": [ |
| 134 | + "error", |
| 135 | + "always", |
| 136 | + { |
| 137 | + "ignoreConstructors": false, |
| 138 | + "avoidQuotes": true |
| 139 | + } |
| 140 | + ], |
| 141 | + // suggest using arrow functions as callbacks |
| 142 | + "prefer-arrow-callback": [ |
| 143 | + "error", |
| 144 | + { |
| 145 | + "allowNamedFunctions": false, |
| 146 | + "allowUnboundThis": true |
| 147 | + } |
| 148 | + ], |
| 149 | + // suggest using of const declaration for variables that are never modified after declared |
| 150 | + "prefer-const": [ |
| 151 | + "error", |
| 152 | + { |
| 153 | + "destructuring": "any", |
| 154 | + "ignoreReadBeforeAssign": true |
| 155 | + } |
| 156 | + ], |
| 157 | + // disallow parseInt() in favor of binary, octal, and hexadecimal literals |
| 158 | + // https://eslint.org/docs/rules/prefer-numeric-literals |
| 159 | + "prefer-numeric-literals": "error", |
| 160 | + // suggest using Reflect methods where applicable |
| 161 | + // https://eslint.org/docs/rules/prefer-reflect |
| 162 | + "prefer-reflect": "off", |
| 163 | + // use rest parameters instead of arguments |
| 164 | + // https://eslint.org/docs/rules/prefer-rest-params |
| 165 | + "prefer-rest-params": "error", |
| 166 | + // suggest using the spread operator instead of .apply() |
| 167 | + // https://eslint.org/docs/rules/prefer-spread |
| 168 | + "prefer-spread": "error", |
| 169 | + // suggest using template literals instead of string concatenation |
| 170 | + // https://eslint.org/docs/rules/prefer-template |
| 171 | + "prefer-template": "error", |
| 172 | + // disallow generator functions that do not have yield |
| 173 | + // https://eslint.org/docs/rules/require-yield |
| 174 | + "require-yield": "error", |
| 175 | + // enforce spacing between object rest-spread |
| 176 | + // https://eslint.org/docs/rules/rest-spread-spacing |
| 177 | + "rest-spread-spacing": [ |
| 178 | + "error", |
| 179 | + "never" |
| 180 | + ], |
| 181 | + // enforce usage of spacing in template strings |
| 182 | + // https://eslint.org/docs/rules/template-curly-spacing |
| 183 | + "template-curly-spacing": "error", |
49 | 184 | "linebreak-style": ["error", "unix"],
|
50 | 185 | "no-dupe-keys": ["error"],
|
51 | 186 | "no-duplicate-case": ["error"],
|
|
0 commit comments