1 | import { Linter } from "../index";
|
2 |
|
3 | export interface ECMAScript6 extends Linter.RulesRecord {
|
4 | /**
|
5 | * Rule to require braces around arrow function bodies.
|
6 | *
|
7 | * @since 1.8.0
|
8 | * @see https://eslint.org/docs/rules/arrow-body-style
|
9 | */
|
10 | "arrow-body-style":
|
11 | | Linter.RuleEntry<
|
12 | [
|
13 | "as-needed",
|
14 | Partial<{
|
15 | /**
|
16 | * @default false
|
17 | */
|
18 | requireReturnForObjectLiteral: boolean;
|
19 | }>,
|
20 | ]
|
21 | >
|
22 | | Linter.RuleEntry<["always" | "never"]>;
|
23 |
|
24 | /**
|
25 | * Rule to require parentheses around arrow function arguments.
|
26 | *
|
27 | * @since 1.0.0-rc-1
|
28 | * @see https://eslint.org/docs/rules/arrow-parens
|
29 | */
|
30 | "arrow-parens":
|
31 | | Linter.RuleEntry<["always"]>
|
32 | | Linter.RuleEntry<
|
33 | [
|
34 | "as-needed",
|
35 | Partial<{
|
36 | /**
|
37 | * @default false
|
38 | */
|
39 | requireForBlockBody: boolean;
|
40 | }>,
|
41 | ]
|
42 | >;
|
43 |
|
44 | /**
|
45 | * Rule to enforce consistent spacing before and after the arrow in arrow functions.
|
46 | *
|
47 | * @since 1.0.0-rc-1
|
48 | * @see https://eslint.org/docs/rules/arrow-spacing
|
49 | */
|
50 | "arrow-spacing": Linter.RuleEntry<[]>;
|
51 |
|
52 | /**
|
53 | * Rule to require `super()` calls in constructors.
|
54 | *
|
55 | * @remarks
|
56 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
57 | *
|
58 | * @since 0.24.0
|
59 | * @see https://eslint.org/docs/rules/constructor-super
|
60 | */
|
61 | "constructor-super": Linter.RuleEntry<[]>;
|
62 |
|
63 | /**
|
64 | * Rule to enforce consistent spacing around `*` operators in generator functions.
|
65 | *
|
66 | * @since 0.17.0
|
67 | * @see https://eslint.org/docs/rules/generator-star-spacing
|
68 | */
|
69 | "generator-star-spacing": Linter.RuleEntry<
|
70 | [
|
71 | | Partial<{
|
72 | before: boolean;
|
73 | after: boolean;
|
74 | named:
|
75 | | Partial<{
|
76 | before: boolean;
|
77 | after: boolean;
|
78 | }>
|
79 | | "before"
|
80 | | "after"
|
81 | | "both"
|
82 | | "neither";
|
83 | anonymous:
|
84 | | Partial<{
|
85 | before: boolean;
|
86 | after: boolean;
|
87 | }>
|
88 | | "before"
|
89 | | "after"
|
90 | | "both"
|
91 | | "neither";
|
92 | method:
|
93 | | Partial<{
|
94 | before: boolean;
|
95 | after: boolean;
|
96 | }>
|
97 | | "before"
|
98 | | "after"
|
99 | | "both"
|
100 | | "neither";
|
101 | }>
|
102 | | "before"
|
103 | | "after"
|
104 | | "both"
|
105 | | "neither",
|
106 | ]
|
107 | >;
|
108 |
|
109 | /**
|
110 | * Rule to disallow reassigning class members.
|
111 | *
|
112 | * @remarks
|
113 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
114 | *
|
115 | * @since 1.0.0-rc-1
|
116 | * @see https://eslint.org/docs/rules/no-class-assign
|
117 | */
|
118 | "no-class-assign": Linter.RuleEntry<[]>;
|
119 |
|
120 | /**
|
121 | * Rule to disallow arrow functions where they could be confused with comparisons.
|
122 | *
|
123 | * @since 2.0.0-alpha-2
|
124 | * @see https://eslint.org/docs/rules/no-confusing-arrow
|
125 | */
|
126 | "no-confusing-arrow": Linter.RuleEntry<
|
127 | [
|
128 | Partial<{
|
129 | /**
|
130 | * @default true
|
131 | */
|
132 | allowParens: boolean;
|
133 | }>,
|
134 | ]
|
135 | >;
|
136 |
|
137 | /**
|
138 | * Rule to disallow reassigning `const` variables.
|
139 | *
|
140 | * @remarks
|
141 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
142 | *
|
143 | * @since 1.0.0-rc-1
|
144 | * @see https://eslint.org/docs/rules/no-const-assign
|
145 | */
|
146 | "no-const-assign": Linter.RuleEntry<[]>;
|
147 |
|
148 | /**
|
149 | * Rule to disallow duplicate class members.
|
150 | *
|
151 | * @remarks
|
152 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
153 | *
|
154 | * @since 1.2.0
|
155 | * @see https://eslint.org/docs/rules/no-dupe-class-members
|
156 | */
|
157 | "no-dupe-class-members": Linter.RuleEntry<[]>;
|
158 |
|
159 | /**
|
160 | * Rule to disallow duplicate module imports.
|
161 | *
|
162 | * @since 2.5.0
|
163 | * @see https://eslint.org/docs/rules/no-duplicate-import
|
164 | */
|
165 | "no-duplicate-import": Linter.RuleEntry<
|
166 | [
|
167 | Partial<{
|
168 | /**
|
169 | * @default false
|
170 | */
|
171 | includeExports: boolean;
|
172 | }>,
|
173 | ]
|
174 | >;
|
175 |
|
176 | /**
|
177 | * Rule to disallow `new` operators with the `Symbol` object.
|
178 | *
|
179 | * @remarks
|
180 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
181 | *
|
182 | * @since 2.0.0-beta.1
|
183 | * @see https://eslint.org/docs/rules/no-new-symbol
|
184 | */
|
185 | "no-new-symbol": Linter.RuleEntry<[]>;
|
186 |
|
187 | /**
|
188 | * Rule to disallow specified modules when loaded by `import`.
|
189 | *
|
190 | * @since 2.0.0-alpha-1
|
191 | * @see https://eslint.org/docs/rules/no-restricted-imports
|
192 | */
|
193 | "no-restricted-imports": Linter.RuleEntry<
|
194 | [
|
195 | ...Array<
|
196 | | string
|
197 | | {
|
198 | name: string;
|
199 | importNames?: string[] | undefined;
|
200 | message?: string | undefined;
|
201 | }
|
202 | | Partial<{
|
203 | paths: Array<
|
204 | | string
|
205 | | {
|
206 | name: string;
|
207 | importNames?: string[] | undefined;
|
208 | message?: string | undefined;
|
209 | }
|
210 | >;
|
211 | patterns: string[];
|
212 | }>
|
213 | >
|
214 | ]
|
215 | >;
|
216 |
|
217 | /**
|
218 | * Rule to disallow `this`/`super` before calling `super()` in constructors.
|
219 | *
|
220 | * @remarks
|
221 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
222 | *
|
223 | * @since 0.24.0
|
224 | * @see https://eslint.org/docs/rules/no-this-before-super
|
225 | */
|
226 | "no-this-before-super": Linter.RuleEntry<[]>;
|
227 |
|
228 | /**
|
229 | * Rule to disallow unnecessary computed property keys in object literals.
|
230 | *
|
231 | * @since 2.9.0
|
232 | * @see https://eslint.org/docs/rules/no-useless-computed-key
|
233 | */
|
234 | "no-useless-computed-key": Linter.RuleEntry<[]>;
|
235 |
|
236 | /**
|
237 | * Rule to disallow unnecessary constructors.
|
238 | *
|
239 | * @since 2.0.0-beta.1
|
240 | * @see https://eslint.org/docs/rules/no-useless-constructor
|
241 | */
|
242 | "no-useless-constructor": Linter.RuleEntry<[]>;
|
243 |
|
244 | /**
|
245 | * Rule to disallow renaming import, export, and destructured assignments to the same name.
|
246 | *
|
247 | * @since 2.11.0
|
248 | * @see https://eslint.org/docs/rules/no-useless-rename
|
249 | */
|
250 | "no-useless-rename": Linter.RuleEntry<
|
251 | [
|
252 | Partial<{
|
253 | /**
|
254 | * @default false
|
255 | */
|
256 | ignoreImport: boolean;
|
257 | /**
|
258 | * @default false
|
259 | */
|
260 | ignoreExport: boolean;
|
261 | /**
|
262 | * @default false
|
263 | */
|
264 | ignoreDestructuring: boolean;
|
265 | }>,
|
266 | ]
|
267 | >;
|
268 |
|
269 | /**
|
270 | * Rule to require `let` or `const` instead of `var`.
|
271 | *
|
272 | * @since 0.12.0
|
273 | * @see https://eslint.org/docs/rules/no-var
|
274 | */
|
275 | "no-var": Linter.RuleEntry<[]>;
|
276 |
|
277 | /**
|
278 | * Rule to require or disallow method and property shorthand syntax for object literals.
|
279 | *
|
280 | * @since 0.20.0
|
281 | * @see https://eslint.org/docs/rules/object-shorthand
|
282 | */
|
283 | "object-shorthand":
|
284 | | Linter.RuleEntry<
|
285 | [
|
286 | "always" | "methods",
|
287 | Partial<{
|
288 | /**
|
289 | * @default false
|
290 | */
|
291 | avoidQuotes: boolean;
|
292 | /**
|
293 | * @default false
|
294 | */
|
295 | ignoreConstructors: boolean;
|
296 | /**
|
297 | * @default false
|
298 | */
|
299 | avoidExplicitReturnArrows: boolean;
|
300 | }>,
|
301 | ]
|
302 | >
|
303 | | Linter.RuleEntry<
|
304 | [
|
305 | "properties",
|
306 | Partial<{
|
307 | /**
|
308 | * @default false
|
309 | */
|
310 | avoidQuotes: boolean;
|
311 | }>,
|
312 | ]
|
313 | >
|
314 | | Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>;
|
315 |
|
316 | /**
|
317 | * Rule to require using arrow functions for callbacks.
|
318 | *
|
319 | * @since 1.2.0
|
320 | * @see https://eslint.org/docs/rules/prefer-arrow-callback
|
321 | */
|
322 | "prefer-arrow-callback": Linter.RuleEntry<
|
323 | [
|
324 | Partial<{
|
325 | /**
|
326 | * @default false
|
327 | */
|
328 | allowNamedFunctions: boolean;
|
329 | /**
|
330 | * @default true
|
331 | */
|
332 | allowUnboundThis: boolean;
|
333 | }>,
|
334 | ]
|
335 | >;
|
336 |
|
337 | /**
|
338 | * Rule to require `const` declarations for variables that are never reassigned after declared.
|
339 | *
|
340 | * @since 0.23.0
|
341 | * @see https://eslint.org/docs/rules/prefer-const
|
342 | */
|
343 | "prefer-const": Linter.RuleEntry<
|
344 | [
|
345 | Partial<{
|
346 | /**
|
347 | * @default 'any'
|
348 | */
|
349 | destructuring: "any" | "all";
|
350 | /**
|
351 | * @default false
|
352 | */
|
353 | ignoreReadBeforeAssign: boolean;
|
354 | }>,
|
355 | ]
|
356 | >;
|
357 |
|
358 | /**
|
359 | * Rule to require destructuring from arrays and/or objects.
|
360 | *
|
361 | * @since 3.13.0
|
362 | * @see https://eslint.org/docs/rules/prefer-destructuring
|
363 | */
|
364 | "prefer-destructuring": Linter.RuleEntry<
|
365 | [
|
366 | Partial<
|
367 | | {
|
368 | VariableDeclarator: Partial<{
|
369 | array: boolean;
|
370 | object: boolean;
|
371 | }>;
|
372 | AssignmentExpression: Partial<{
|
373 | array: boolean;
|
374 | object: boolean;
|
375 | }>;
|
376 | }
|
377 | | {
|
378 | array: boolean;
|
379 | object: boolean;
|
380 | }
|
381 | >,
|
382 | Partial<{
|
383 | enforceForRenamedProperties: boolean;
|
384 | }>,
|
385 | ]
|
386 | >;
|
387 |
|
388 | /**
|
389 | * Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals.
|
390 | *
|
391 | * @since 3.5.0
|
392 | * @see https://eslint.org/docs/rules/prefer-numeric-literals
|
393 | */
|
394 | "prefer-numeric-literals": Linter.RuleEntry<[]>;
|
395 |
|
396 | /**
|
397 | * Rule to require rest parameters instead of `arguments`.
|
398 | *
|
399 | * @since 2.0.0-alpha-1
|
400 | * @see https://eslint.org/docs/rules/prefer-rest-params
|
401 | */
|
402 | "prefer-rest-params": Linter.RuleEntry<[]>;
|
403 |
|
404 | /**
|
405 | * Rule to require spread operators instead of `.apply()`.
|
406 | *
|
407 | * @since 1.0.0-rc-1
|
408 | * @see https://eslint.org/docs/rules/prefer-spread
|
409 | */
|
410 | "prefer-spread": Linter.RuleEntry<[]>;
|
411 |
|
412 | /**
|
413 | * Rule to require template literals instead of string concatenation.
|
414 | *
|
415 | * @since 1.2.0
|
416 | * @see https://eslint.org/docs/rules/prefer-template
|
417 | */
|
418 | "prefer-template": Linter.RuleEntry<[]>;
|
419 |
|
420 | /**
|
421 | * Rule to require generator functions to contain `yield`.
|
422 | *
|
423 | * @remarks
|
424 | * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
425 | *
|
426 | * @since 1.0.0-rc-1
|
427 | * @see https://eslint.org/docs/rules/require-yield
|
428 | */
|
429 | "require-yield": Linter.RuleEntry<[]>;
|
430 |
|
431 | /**
|
432 | * Rule to enforce spacing between rest and spread operators and their expressions.
|
433 | *
|
434 | * @since 2.12.0
|
435 | * @see https://eslint.org/docs/rules/rest-spread-spacing
|
436 | */
|
437 | "rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>;
|
438 |
|
439 | /**
|
440 | * Rule to enforce sorted import declarations within modules.
|
441 | *
|
442 | * @since 2.0.0-beta.1
|
443 | * @see https://eslint.org/docs/rules/sort-imports
|
444 | */
|
445 | "sort-imports": Linter.RuleEntry<
|
446 | [
|
447 | Partial<{
|
448 | /**
|
449 | * @default false
|
450 | */
|
451 | ignoreCase: boolean;
|
452 | /**
|
453 | * @default false
|
454 | */
|
455 | ignoreDeclarationSort: boolean;
|
456 | /**
|
457 | * @default false
|
458 | */
|
459 | ignoreMemberSort: boolean;
|
460 | /**
|
461 | * @default ['none', 'all', 'multiple', 'single']
|
462 | */
|
463 | memberSyntaxSortOrder: Array<"none" | "all" | "multiple" | "single">;
|
464 | }>,
|
465 | ]
|
466 | >;
|
467 |
|
468 | /**
|
469 | * Rule to require symbol descriptions.
|
470 | *
|
471 | * @since 3.4.0
|
472 | * @see https://eslint.org/docs/rules/symbol-description
|
473 | */
|
474 | "symbol-description": Linter.RuleEntry<[]>;
|
475 |
|
476 | /**
|
477 | * Rule to require or disallow spacing around embedded expressions of template strings.
|
478 | *
|
479 | * @since 2.0.0-rc.0
|
480 | * @see https://eslint.org/docs/rules/template-curly-spacing
|
481 | */
|
482 | "template-curly-spacing": Linter.RuleEntry<["never" | "always"]>;
|
483 |
|
484 | /**
|
485 | * Rule to require or disallow spacing around the `*` in `yield*` expressions.
|
486 | *
|
487 | * @since 2.0.0-alpha-1
|
488 | * @see https://eslint.org/docs/rules/yield-star-spacing
|
489 | */
|
490 | "yield-star-spacing": Linter.RuleEntry<
|
491 | [
|
492 | | Partial<{
|
493 | before: boolean;
|
494 | after: boolean;
|
495 | }>
|
496 | | "before"
|
497 | | "after"
|
498 | | "both"
|
499 | | "neither",
|
500 | ]
|
501 | >;
|
502 | }
|