@schemastore/tslint 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.d.ts +251 -289
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -3459,54 +3459,50 @@ export interface TsRules {
|
|
|
3459
3459
|
* Enforces function overloads to be consecutive.
|
|
3460
3460
|
*/
|
|
3461
3461
|
"adjacent-overload-signatures"?: (Rule & []) | [boolean];
|
|
3462
|
-
/**
|
|
3463
|
-
* Bans "// @ts-ignore" comments from being used.
|
|
3464
|
-
*/
|
|
3465
|
-
"ban-ts-ignore"?: (Rule1 & []) | [boolean];
|
|
3466
3462
|
/**
|
|
3467
3463
|
* Requires using either 'T[]' or 'Array<T>' for arrays.
|
|
3468
3464
|
*/
|
|
3469
|
-
"array-type"?: (
|
|
3465
|
+
"array-type"?: (Rule & []) | [boolean, ...("array" | "generic" | "array-simple")[]];
|
|
3470
3466
|
/**
|
|
3471
3467
|
* Warns for an awaited value that is not a Promise.
|
|
3472
3468
|
*/
|
|
3473
|
-
"await-promise"?: (
|
|
3469
|
+
"await-promise"?: (Rule & []) | [boolean, ...string[]];
|
|
3474
3470
|
/**
|
|
3475
3471
|
* Bans specific types from being used. Does not ban the corresponding runtime objects from being used.
|
|
3476
3472
|
*/
|
|
3477
|
-
"ban-types"?: (
|
|
3473
|
+
"ban-types"?: (Rule & []) | [boolean, ...Items[]];
|
|
3478
3474
|
/**
|
|
3479
3475
|
* An interface or literal type with just a call signature can be written as a function type.
|
|
3480
3476
|
*/
|
|
3481
|
-
"callable-types"?: (
|
|
3477
|
+
"callable-types"?: (Rule & []) | [boolean];
|
|
3482
3478
|
/**
|
|
3483
3479
|
* Requires interface names to begin with a capital 'I'
|
|
3484
3480
|
*/
|
|
3485
|
-
"interface-name"?: (
|
|
3481
|
+
"interface-name"?: (Rule & []) | [boolean, ...("always-prefix" | "never-prefix")[]];
|
|
3486
3482
|
/**
|
|
3487
3483
|
* Prefer an interface declaration over a type literal (`type T = { ... }`)
|
|
3488
3484
|
*/
|
|
3489
|
-
"interface-over-type-literal"?: (
|
|
3485
|
+
"interface-over-type-literal"?: (Rule & []) | [boolean];
|
|
3490
3486
|
/**
|
|
3491
3487
|
* Requires that a default import have the same name as the declaration it imports.
|
|
3492
3488
|
* Does nothing for anonymous default exports.
|
|
3493
3489
|
*/
|
|
3494
|
-
"match-default-export-name"?: (
|
|
3490
|
+
"match-default-export-name"?: (Rule & []) | [boolean];
|
|
3495
3491
|
/**
|
|
3496
3492
|
* Requires explicit visibility declarations for class members.
|
|
3497
3493
|
*/
|
|
3498
3494
|
"member-access"?:
|
|
3499
|
-
| (
|
|
3495
|
+
| (Rule & [])
|
|
3500
3496
|
| [boolean, ...("no-public" | "check-accessor" | "check-constructor" | "check-parameter-property")[]];
|
|
3501
3497
|
/**
|
|
3502
3498
|
* Requires the use of `as Type` for type assertions instead of `<Type>`.
|
|
3503
3499
|
*/
|
|
3504
|
-
"no-angle-bracket-type-assertion"?: (
|
|
3500
|
+
"no-angle-bracket-type-assertion"?: (Rule & []) | [boolean];
|
|
3505
3501
|
/**
|
|
3506
3502
|
* Disallows usages of `any` as a type declaration.
|
|
3507
3503
|
*/
|
|
3508
3504
|
"no-any"?:
|
|
3509
|
-
| (
|
|
3505
|
+
| (Rule & [])
|
|
3510
3506
|
| [boolean]
|
|
3511
3507
|
| [
|
|
3512
3508
|
boolean,
|
|
@@ -3518,84 +3514,84 @@ export interface TsRules {
|
|
|
3518
3514
|
/**
|
|
3519
3515
|
* Warns on comparison to a boolean literal, as in `x === true`.
|
|
3520
3516
|
*/
|
|
3521
|
-
"no-boolean-literal-compare"?: (
|
|
3517
|
+
"no-boolean-literal-compare"?: (Rule & []) | [boolean];
|
|
3522
3518
|
/**
|
|
3523
3519
|
* Forbids empty interfaces.
|
|
3524
3520
|
*/
|
|
3525
|
-
"no-empty-interface"?: (
|
|
3521
|
+
"no-empty-interface"?: (Rule & []) | [boolean];
|
|
3526
3522
|
/**
|
|
3527
3523
|
* Promises returned by functions must be handled appropriately.
|
|
3528
3524
|
*/
|
|
3529
|
-
"no-floating-promises"?: (
|
|
3525
|
+
"no-floating-promises"?: (Rule & []) | [boolean, ...string[]];
|
|
3530
3526
|
/**
|
|
3531
3527
|
* Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean.
|
|
3532
3528
|
*/
|
|
3533
|
-
"no-inferrable-types"?: (
|
|
3529
|
+
"no-inferrable-types"?: (Rule & []) | [boolean, ...("ignore-params" | "ignore-properties")[]];
|
|
3534
3530
|
/**
|
|
3535
3531
|
* Disallow type inference of {} (empty object type) at function and constructor call sites
|
|
3536
3532
|
*/
|
|
3537
|
-
"no-inferred-empty-object-type"?: (
|
|
3533
|
+
"no-inferred-empty-object-type"?: (Rule & []) | [boolean];
|
|
3538
3534
|
/**
|
|
3539
3535
|
* Disallows internal `module`
|
|
3540
3536
|
*/
|
|
3541
|
-
"no-internal-module"?: (
|
|
3537
|
+
"no-internal-module"?: (Rule & []) | [boolean];
|
|
3542
3538
|
/**
|
|
3543
3539
|
* Disallows mergeable namespaces in the same file.
|
|
3544
3540
|
*/
|
|
3545
|
-
"no-mergeable-namespace"?: (
|
|
3541
|
+
"no-mergeable-namespace"?: (Rule & []) | [boolean];
|
|
3546
3542
|
/**
|
|
3547
3543
|
* Warns on apparent attempts to define constructors for interfaces or `new` for classes.
|
|
3548
3544
|
*/
|
|
3549
|
-
"no-misused-new"?: (
|
|
3545
|
+
"no-misused-new"?: (Rule & []) | [boolean];
|
|
3550
3546
|
/**
|
|
3551
3547
|
* Disallows use of internal `module`s and `namespace`s.
|
|
3552
3548
|
*/
|
|
3553
|
-
"no-namespace"?: (
|
|
3549
|
+
"no-namespace"?: (Rule & []) | [boolean, ..."allow-declarations"[]];
|
|
3554
3550
|
/**
|
|
3555
3551
|
* Disallows non-null assertions.
|
|
3556
3552
|
*/
|
|
3557
|
-
"no-non-null-assertion"?: (
|
|
3553
|
+
"no-non-null-assertion"?: (Rule & []) | [boolean];
|
|
3558
3554
|
/**
|
|
3559
3555
|
* Forbids an object literal to appear in a type assertion expression.
|
|
3560
3556
|
* Casting to `any` is still allowed.
|
|
3561
3557
|
*/
|
|
3562
|
-
"no-object-literal-type-assertion"?: (
|
|
3558
|
+
"no-object-literal-type-assertion"?: (Rule & []) | [boolean];
|
|
3563
3559
|
/**
|
|
3564
3560
|
* Disallows parameter properties in class constructors.
|
|
3565
3561
|
*/
|
|
3566
|
-
"no-parameter-properties"?: (
|
|
3562
|
+
"no-parameter-properties"?: (Rule & []) | [boolean];
|
|
3567
3563
|
/**
|
|
3568
3564
|
* Forbids JSDoc which duplicates TypeScript functionality.
|
|
3569
3565
|
*/
|
|
3570
|
-
"no-redundant-jsdoc"?: (
|
|
3566
|
+
"no-redundant-jsdoc"?: (Rule & []) | [boolean];
|
|
3571
3567
|
/**
|
|
3572
3568
|
* Don't `<reference types="foo" />` if you import `foo` anyway.
|
|
3573
3569
|
*/
|
|
3574
|
-
"no-reference-import"?: (
|
|
3570
|
+
"no-reference-import"?: (Rule & []) | [boolean];
|
|
3575
3571
|
/**
|
|
3576
3572
|
* Warns when a method is used as outside of a method call.
|
|
3577
3573
|
*/
|
|
3578
|
-
"no-unbound-method"?: (
|
|
3574
|
+
"no-unbound-method"?: (Rule & []) | [boolean, ..."ignore-static"[]];
|
|
3579
3575
|
/**
|
|
3580
3576
|
* Warns when a namespace qualifier (`A.x`) is unnecessary.
|
|
3581
3577
|
*/
|
|
3582
|
-
"no-unnecessary-qualifier"?: (
|
|
3578
|
+
"no-unnecessary-qualifier"?: (Rule & []) | [boolean];
|
|
3583
3579
|
/**
|
|
3584
3580
|
* Warns if a type assertion does not change the type of an expression.
|
|
3585
3581
|
*/
|
|
3586
|
-
"no-unnecessary-type-assertion"?: (
|
|
3582
|
+
"no-unnecessary-type-assertion"?: (Rule & []) | [boolean, ...string[]];
|
|
3587
3583
|
/**
|
|
3588
3584
|
* Warns when using an expression of type 'any' in a dynamic way.
|
|
3589
3585
|
* Uses are only allowed if they would work for `{} | null | undefined`.
|
|
3590
3586
|
* Type casts and tests are allowed.
|
|
3591
3587
|
* Expressions that work on all values (such as `"" + x`) are allowed.
|
|
3592
3588
|
*/
|
|
3593
|
-
"no-unsafe-any"?: (
|
|
3589
|
+
"no-unsafe-any"?: (Rule & []) | [boolean];
|
|
3594
3590
|
/**
|
|
3595
3591
|
* Disallows unused imports, variables, functions and private class members. Similar to tsc's --noUnusedParameters and --noUnusedLocals options, but does not interrupt code compilation.
|
|
3596
3592
|
*/
|
|
3597
3593
|
"no-unused-variable"?:
|
|
3598
|
-
| (
|
|
3594
|
+
| (Rule & [])
|
|
3599
3595
|
| [
|
|
3600
3596
|
boolean,
|
|
3601
3597
|
...(
|
|
@@ -3608,11 +3604,11 @@ export interface TsRules {
|
|
|
3608
3604
|
/**
|
|
3609
3605
|
* Disallows the use of require statements except in import statements.
|
|
3610
3606
|
*/
|
|
3611
|
-
"no-var-requires"?: (
|
|
3607
|
+
"no-var-requires"?: (Rule & []) | [boolean];
|
|
3612
3608
|
/**
|
|
3613
|
-
* Requires that private variables are marked as `readonly` if they
|
|
3609
|
+
* Requires that private variables are marked as `readonly` if they’re never modified outside of the constructor.
|
|
3614
3610
|
*/
|
|
3615
|
-
"prefer-readonly"?: (
|
|
3611
|
+
"prefer-readonly"?: (Rule & []) | [boolean, ..."only-inline-lambdas"[]];
|
|
3616
3612
|
/**
|
|
3617
3613
|
* Restricts the types allowed in boolean expressions. By default only booleans are allowed.
|
|
3618
3614
|
*
|
|
@@ -3622,7 +3618,7 @@ export interface TsRules {
|
|
|
3622
3618
|
* * Conditions for `if`, `for`, `while`, and `do-while` statements.
|
|
3623
3619
|
*/
|
|
3624
3620
|
"strict-boolean-expressions"?:
|
|
3625
|
-
| (
|
|
3621
|
+
| (Rule & [])
|
|
3626
3622
|
| [
|
|
3627
3623
|
boolean,
|
|
3628
3624
|
...(
|
|
@@ -3645,12 +3641,12 @@ export interface TsRules {
|
|
|
3645
3641
|
*
|
|
3646
3642
|
* This rule requires `strictNullChecks` to work properly.
|
|
3647
3643
|
*/
|
|
3648
|
-
"strict-type-predicates"?: (
|
|
3644
|
+
"strict-type-predicates"?: (Rule & []) | [boolean];
|
|
3649
3645
|
/**
|
|
3650
3646
|
* Requires type definitions to exist.
|
|
3651
3647
|
*/
|
|
3652
3648
|
typedef?:
|
|
3653
|
-
| (
|
|
3649
|
+
| (Rule & [])
|
|
3654
3650
|
| [
|
|
3655
3651
|
boolean,
|
|
3656
3652
|
...(
|
|
@@ -3669,7 +3665,7 @@ export interface TsRules {
|
|
|
3669
3665
|
* Requires or disallows whitespace for type definitions.
|
|
3670
3666
|
*/
|
|
3671
3667
|
"typedef-whitespace"?:
|
|
3672
|
-
| (
|
|
3668
|
+
| (Rule & [])
|
|
3673
3669
|
| [boolean]
|
|
3674
3670
|
| [
|
|
3675
3671
|
boolean,
|
|
@@ -3703,7 +3699,7 @@ export interface TsRules {
|
|
|
3703
3699
|
* Enforces a trailing semicolon for multiline type literals.
|
|
3704
3700
|
*/
|
|
3705
3701
|
"type-literal-delimiter"?:
|
|
3706
|
-
| (
|
|
3702
|
+
| (Rule & [])
|
|
3707
3703
|
| [boolean]
|
|
3708
3704
|
| [
|
|
3709
3705
|
boolean,
|
|
@@ -3715,35 +3711,31 @@ export interface TsRules {
|
|
|
3715
3711
|
/**
|
|
3716
3712
|
* Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter.
|
|
3717
3713
|
*/
|
|
3718
|
-
"unified-signatures"?: (
|
|
3714
|
+
"unified-signatures"?: (Rule & []) | [boolean];
|
|
3719
3715
|
/**
|
|
3720
3716
|
* Warns if an explicitly specified type argument is the default for that type parameter.
|
|
3721
3717
|
*/
|
|
3722
|
-
"use-default-type-parameter"?: (
|
|
3723
|
-
/**
|
|
3724
|
-
* Prevents using the built-in Function constructor.
|
|
3725
|
-
*/
|
|
3726
|
-
"function-constructor"?: (Rule1 & []) | [boolean];
|
|
3718
|
+
"use-default-type-parameter"?: (Rule & []) | [boolean];
|
|
3727
3719
|
[k: string]: unknown | undefined;
|
|
3728
3720
|
}
|
|
3729
3721
|
export interface Rules {
|
|
3730
3722
|
/**
|
|
3731
3723
|
* Enforces vertical alignment.
|
|
3732
3724
|
*/
|
|
3733
|
-
align?: (
|
|
3725
|
+
align?: (Rule & []) | [boolean, ...("arguments" | "elements" | "members" | "parameters" | "statements")[]];
|
|
3734
3726
|
/**
|
|
3735
3727
|
* Requires parentheses around the parameters of arrow function definitions.
|
|
3736
3728
|
*/
|
|
3737
|
-
"arrow-parens"?: (
|
|
3729
|
+
"arrow-parens"?: (Rule & []) | [boolean, ..."ban-single-arg-parens"[]];
|
|
3738
3730
|
/**
|
|
3739
3731
|
* Suggests to convert `() => { return x; }` to `() => x`.
|
|
3740
3732
|
*/
|
|
3741
|
-
"arrow-return-shorthand"?: (
|
|
3733
|
+
"arrow-return-shorthand"?: (Rule & []) | [boolean, ..."multiline"[]];
|
|
3742
3734
|
/**
|
|
3743
3735
|
* Bans the use of specific functions or global methods.
|
|
3744
3736
|
*/
|
|
3745
3737
|
ban?:
|
|
3746
|
-
| (
|
|
3738
|
+
| (Rule & [])
|
|
3747
3739
|
| [
|
|
3748
3740
|
boolean,
|
|
3749
3741
|
...(
|
|
@@ -3760,21 +3752,21 @@ export interface Rules {
|
|
|
3760
3752
|
/**
|
|
3761
3753
|
* Bans the comma operator.
|
|
3762
3754
|
*/
|
|
3763
|
-
"ban-comma-operator"?: (
|
|
3755
|
+
"ban-comma-operator"?: (Rule & []) | [boolean];
|
|
3764
3756
|
/**
|
|
3765
3757
|
* In a binary expression, a literal should always be on the right-hand side if possible.
|
|
3766
3758
|
* For example, prefer 'x + 1' over '1 + x'.
|
|
3767
3759
|
*/
|
|
3768
|
-
"binary-expression-operand-order"?: (
|
|
3760
|
+
"binary-expression-operand-order"?: (Rule & []) | [boolean];
|
|
3769
3761
|
/**
|
|
3770
3762
|
* Enforces PascalCased class and interface names.
|
|
3771
3763
|
*/
|
|
3772
|
-
"class-name"?: (
|
|
3764
|
+
"class-name"?: (Rule & []) | [boolean];
|
|
3773
3765
|
/**
|
|
3774
3766
|
* Enforces formatting rules for single-line comments.
|
|
3775
3767
|
*/
|
|
3776
3768
|
"comment-format"?:
|
|
3777
|
-
| (
|
|
3769
|
+
| (Rule & [])
|
|
3778
3770
|
| [
|
|
3779
3771
|
boolean,
|
|
3780
3772
|
...(
|
|
@@ -3790,7 +3782,7 @@ export interface Rules {
|
|
|
3790
3782
|
* Enforces documentation for important items be filled out.
|
|
3791
3783
|
*/
|
|
3792
3784
|
"completed-docs"?:
|
|
3793
|
-
| (
|
|
3785
|
+
| (Rule & [])
|
|
3794
3786
|
| [
|
|
3795
3787
|
boolean,
|
|
3796
3788
|
...(
|
|
@@ -3846,27 +3838,27 @@ export interface Rules {
|
|
|
3846
3838
|
/**
|
|
3847
3839
|
* Enforces braces for `if`/`for`/`do`/`while` statements.
|
|
3848
3840
|
*/
|
|
3849
|
-
curly?: (
|
|
3841
|
+
curly?: (Rule & []) | [boolean, ...("as-needed" | "ignore-same-line")[]];
|
|
3850
3842
|
/**
|
|
3851
3843
|
* Enforces a threshold of cyclomatic complexity.
|
|
3852
3844
|
*/
|
|
3853
|
-
"cyclomatic-complexity"?: (
|
|
3845
|
+
"cyclomatic-complexity"?: (Rule & []) | [boolean, ...number[]];
|
|
3854
3846
|
/**
|
|
3855
3847
|
* Warns when deprecated APIs are used.
|
|
3856
3848
|
*/
|
|
3857
|
-
deprecation?: (
|
|
3849
|
+
deprecation?: (Rule & []) | [boolean];
|
|
3858
3850
|
/**
|
|
3859
3851
|
* Enforces UTF-8 file encoding.
|
|
3860
3852
|
*/
|
|
3861
|
-
encoding?: (
|
|
3853
|
+
encoding?: (Rule & []) | [boolean];
|
|
3862
3854
|
/**
|
|
3863
3855
|
* Ensures the file ends with a newline.
|
|
3864
3856
|
*/
|
|
3865
|
-
eofline?: (
|
|
3857
|
+
eofline?: (Rule & []) | [boolean];
|
|
3866
3858
|
/**
|
|
3867
3859
|
* Enforces a certain header comment for all files, matched by a regular expression.
|
|
3868
3860
|
*/
|
|
3869
|
-
"file-header"?: (
|
|
3861
|
+
"file-header"?: (Rule & []) | [boolean, ...string[]];
|
|
3870
3862
|
/**
|
|
3871
3863
|
* Enforces a consistent file naming convention.
|
|
3872
3864
|
*
|
|
@@ -3884,13 +3876,13 @@ export interface Rules {
|
|
|
3884
3876
|
/**
|
|
3885
3877
|
* Requires a `for ... in` statement to be filtered with an `if` statement.
|
|
3886
3878
|
*/
|
|
3887
|
-
forin?: (
|
|
3879
|
+
forin?: (Rule & []) | [boolean];
|
|
3888
3880
|
/**
|
|
3889
3881
|
* Disallows importing the specified modules directly via `import` and `require`.
|
|
3890
3882
|
* Instead only sub modules may be imported from that module.
|
|
3891
3883
|
*/
|
|
3892
3884
|
"import-blacklist"?:
|
|
3893
|
-
| (
|
|
3885
|
+
| (Rule & [])
|
|
3894
3886
|
| [
|
|
3895
3887
|
boolean,
|
|
3896
3888
|
...(
|
|
@@ -3907,36 +3899,36 @@ export interface Rules {
|
|
|
3907
3899
|
/**
|
|
3908
3900
|
* Ensures proper spacing between import statement keywords
|
|
3909
3901
|
*/
|
|
3910
|
-
"import-spacing"?: (
|
|
3902
|
+
"import-spacing"?: (Rule & []) | [boolean];
|
|
3911
3903
|
/**
|
|
3912
3904
|
* Enforces indentation with tabs or spaces.
|
|
3913
3905
|
*/
|
|
3914
|
-
indent?: (
|
|
3906
|
+
indent?: (Rule & []) | [boolean] | [boolean, "tabs" | "spaces"] | [boolean, "tabs" | "spaces", 2 | 4];
|
|
3915
3907
|
/**
|
|
3916
3908
|
* Enforces basic format rules for JSDoc comments.
|
|
3917
3909
|
*/
|
|
3918
|
-
"jsdoc-format"?: (
|
|
3910
|
+
"jsdoc-format"?: (Rule & []) | [boolean, ..."check-multiline-start"[]];
|
|
3919
3911
|
/**
|
|
3920
3912
|
* Only allows labels in sensible locations.
|
|
3921
3913
|
*/
|
|
3922
|
-
"label-position"?: (
|
|
3914
|
+
"label-position"?: (Rule & []) | [boolean];
|
|
3923
3915
|
/**
|
|
3924
3916
|
* Enforces a consistent linebreak style.
|
|
3925
3917
|
*/
|
|
3926
|
-
"linebreak-style"?: (
|
|
3918
|
+
"linebreak-style"?: (Rule & []) | [boolean, ...("LF" | "CRLF")[]];
|
|
3927
3919
|
/**
|
|
3928
3920
|
* A file may not contain more than the specified number of classes
|
|
3929
3921
|
*/
|
|
3930
|
-
"max-classes-per-file"?: (
|
|
3922
|
+
"max-classes-per-file"?: (Rule & [boolean, number]) | [boolean, number, "exclude-class-expressions"];
|
|
3931
3923
|
/**
|
|
3932
3924
|
* Requires files to remain under a certain number of lines
|
|
3933
3925
|
*/
|
|
3934
|
-
"max-file-line-count"?: (
|
|
3926
|
+
"max-file-line-count"?: (Rule & []) | [boolean, ...number[]];
|
|
3935
3927
|
/**
|
|
3936
3928
|
* Requires lines to be under a certain max length.
|
|
3937
3929
|
*/
|
|
3938
3930
|
"max-line-length"?:
|
|
3939
|
-
| (
|
|
3931
|
+
| (Rule & [])
|
|
3940
3932
|
| [
|
|
3941
3933
|
boolean,
|
|
3942
3934
|
...(
|
|
@@ -3952,359 +3944,344 @@ export interface Rules {
|
|
|
3952
3944
|
/**
|
|
3953
3945
|
* Enforces member ordering.
|
|
3954
3946
|
*/
|
|
3955
|
-
"member-ordering"?: (
|
|
3947
|
+
"member-ordering"?: (Rule & []) | [boolean, ...Items1[]];
|
|
3956
3948
|
/**
|
|
3957
3949
|
* Enforces blank line before return when not the only line in the block.
|
|
3958
3950
|
*/
|
|
3959
|
-
"newline-before-return"?: (
|
|
3951
|
+
"newline-before-return"?: (Rule & []) | [boolean];
|
|
3960
3952
|
/**
|
|
3961
3953
|
* Requires that chained method calls be broken apart onto separate lines.
|
|
3962
3954
|
*/
|
|
3963
|
-
"newline-per-chained-call"?: (
|
|
3955
|
+
"newline-per-chained-call"?: (Rule & []) | [boolean];
|
|
3964
3956
|
/**
|
|
3965
3957
|
* Requires parentheses when invoking a constructor via the `new` keyword.
|
|
3966
3958
|
*/
|
|
3967
|
-
"new-parens"?: (
|
|
3959
|
+
"new-parens"?: (Rule & []) | [boolean];
|
|
3968
3960
|
/**
|
|
3969
3961
|
* Disallows use of `arguments.callee`.
|
|
3970
3962
|
*/
|
|
3971
|
-
"no-arg"?: (
|
|
3963
|
+
"no-arg"?: (Rule & []) | [boolean];
|
|
3972
3964
|
/**
|
|
3973
3965
|
* Disallows bitwise operators.
|
|
3974
3966
|
*/
|
|
3975
|
-
"no-bitwise"?: (
|
|
3967
|
+
"no-bitwise"?: (Rule & []) | [boolean];
|
|
3976
3968
|
/**
|
|
3977
3969
|
* Disallows any type of assignment in conditionals.
|
|
3978
3970
|
*/
|
|
3979
|
-
"no-conditional-assignment"?: (
|
|
3971
|
+
"no-conditional-assignment"?: (Rule & []) | [boolean];
|
|
3980
3972
|
/**
|
|
3981
3973
|
* Disallows one or more blank lines in a row.
|
|
3982
3974
|
*/
|
|
3983
|
-
"no-consecutive-blank-lines"?: (
|
|
3975
|
+
"no-consecutive-blank-lines"?: (Rule & []) | [boolean, ...number[]];
|
|
3984
3976
|
/**
|
|
3985
3977
|
* Bans the use of specified `console` methods.
|
|
3986
3978
|
*/
|
|
3987
|
-
"no-console"?: (
|
|
3979
|
+
"no-console"?: (Rule & []) | [boolean, ...string[]];
|
|
3988
3980
|
/**
|
|
3989
3981
|
* Disallows access to the constructors of `String`, `Number`, and `Boolean`.
|
|
3990
3982
|
*/
|
|
3991
|
-
"no-construct"?: (
|
|
3983
|
+
"no-construct"?: (Rule & []) | [boolean];
|
|
3992
3984
|
/**
|
|
3993
3985
|
* Disallows `debugger` statements.
|
|
3994
3986
|
*/
|
|
3995
|
-
"no-debugger"?: (
|
|
3987
|
+
"no-debugger"?: (Rule & []) | [boolean];
|
|
3996
3988
|
/**
|
|
3997
3989
|
* Disallows default exports in ES6-style modules.
|
|
3998
3990
|
*/
|
|
3999
|
-
"no-default-export"?: (
|
|
3991
|
+
"no-default-export"?: (Rule & []) | [boolean];
|
|
4000
3992
|
/**
|
|
4001
3993
|
* Disallows multiple import statements from the same module.
|
|
4002
3994
|
*/
|
|
4003
|
-
"no-duplicate-imports"?: (
|
|
3995
|
+
"no-duplicate-imports"?: (Rule & []) | [boolean] | [boolean, Options];
|
|
4004
3996
|
/**
|
|
4005
3997
|
* Warns if 'super()' appears twice in a constructor.
|
|
4006
3998
|
*/
|
|
4007
|
-
"no-duplicate-super"?: (
|
|
3999
|
+
"no-duplicate-super"?: (Rule & []) | [boolean];
|
|
4008
4000
|
/**
|
|
4009
4001
|
* Prevents duplicate cases in switch statements.
|
|
4010
4002
|
*/
|
|
4011
|
-
"no-duplicate-switch-case"?: (
|
|
4003
|
+
"no-duplicate-switch-case"?: (Rule & []) | [boolean];
|
|
4012
4004
|
/**
|
|
4013
4005
|
* Disallows duplicate variable declarations in the same block scope.
|
|
4014
4006
|
*/
|
|
4015
|
-
"no-duplicate-variable"?: (
|
|
4007
|
+
"no-duplicate-variable"?: (Rule & []) | [boolean, ..."check-parameters"[]];
|
|
4016
4008
|
/**
|
|
4017
4009
|
* Bans usage of the delete operator with computed key expressions.
|
|
4018
4010
|
*/
|
|
4019
|
-
"no-dynamic-delete"?: (
|
|
4011
|
+
"no-dynamic-delete"?: (Rule & []) | [boolean];
|
|
4020
4012
|
/**
|
|
4021
4013
|
* Disallows empty blocks.
|
|
4022
4014
|
*/
|
|
4023
|
-
"no-empty"?: (
|
|
4015
|
+
"no-empty"?: (Rule & []) | [boolean, ...("allow-empty-catch" | "allow-empty-functions")[]];
|
|
4024
4016
|
/**
|
|
4025
4017
|
* Disallows `eval` function invocations.
|
|
4026
4018
|
*/
|
|
4027
|
-
"no-eval"?: (
|
|
4028
|
-
/**
|
|
4029
|
-
* Forbid for…in statements
|
|
4030
|
-
* https://palantir.github.io/tslint/rules/no-for-in/
|
|
4031
|
-
*/
|
|
4032
|
-
"no-for-in"?: (Rule1 & []) | [boolean];
|
|
4019
|
+
"no-eval"?: (Rule & []) | [boolean];
|
|
4033
4020
|
/**
|
|
4034
4021
|
* Disallows iterating over an array with a for-in loop.
|
|
4035
4022
|
*/
|
|
4036
|
-
"no-for-in-array"?: (
|
|
4023
|
+
"no-for-in-array"?: (Rule & []) | [boolean];
|
|
4037
4024
|
/**
|
|
4038
|
-
* Disallows importing modules that are not listed as dependency in the project
|
|
4025
|
+
* Disallows importing modules that are not listed as dependency in the project’s package.json.
|
|
4039
4026
|
*/
|
|
4040
4027
|
"no-implicit-dependencies"?:
|
|
4041
|
-
| (
|
|
4028
|
+
| (Rule & [])
|
|
4042
4029
|
| [boolean, ...[{type: "string"; enum: ["dev", "optional"]}, {type: "array"; minItems: 0}][]];
|
|
4043
4030
|
/**
|
|
4044
4031
|
* Avoid import statements with side-effect.
|
|
4045
4032
|
*/
|
|
4046
|
-
"no-import-side-effect"?: (
|
|
4033
|
+
"no-import-side-effect"?: (Rule & []) | [boolean, ...Items2[]];
|
|
4047
4034
|
/**
|
|
4048
4035
|
* Warns on use of `${` in non-template strings.
|
|
4049
4036
|
*/
|
|
4050
|
-
"no-invalid-template-strings"?: (
|
|
4037
|
+
"no-invalid-template-strings"?: (Rule & []) | [boolean];
|
|
4051
4038
|
/**
|
|
4052
4039
|
* Disallows using the `this` keyword outside of classes.
|
|
4053
4040
|
*/
|
|
4054
|
-
"no-invalid-this"?: (
|
|
4041
|
+
"no-invalid-this"?: (Rule & []) | [boolean, ..."check-function-in-method"[]];
|
|
4055
4042
|
/**
|
|
4056
4043
|
* Disallow irregular whitespace outside of strings and comments
|
|
4057
4044
|
*/
|
|
4058
|
-
"no-irregular-whitespace"?: (
|
|
4045
|
+
"no-irregular-whitespace"?: (Rule & []) | [boolean];
|
|
4059
4046
|
/**
|
|
4060
4047
|
* Disallows the use constant number values outside of variable assignments.
|
|
4061
4048
|
* When no list of allowed values is specified, -1, 0 and 1 are allowed by default.
|
|
4062
4049
|
*/
|
|
4063
|
-
"no-magic-numbers"?: (
|
|
4064
|
-
/**
|
|
4065
|
-
* Forbid explicitly declared or implicitly returned union types with both null and undefined as members
|
|
4066
|
-
* https://palantir.github.io/tslint/rules/no-null-undefined-union/
|
|
4067
|
-
*/
|
|
4068
|
-
"no-null-undefined-union"?: (Rule1 & []) | [boolean];
|
|
4050
|
+
"no-magic-numbers"?: (Rule & []) | [boolean, ...number[]];
|
|
4069
4051
|
/**
|
|
4070
4052
|
* Disallows use of the `null` keyword literal.
|
|
4071
4053
|
*/
|
|
4072
|
-
"no-null-keyword"?: (
|
|
4054
|
+
"no-null-keyword"?: (Rule & []) | [boolean];
|
|
4073
4055
|
/**
|
|
4074
4056
|
* Disallows reassigning parameters.
|
|
4075
4057
|
*/
|
|
4076
|
-
"no-parameter-reassignment"?: (
|
|
4058
|
+
"no-parameter-reassignment"?: (Rule & []) | [boolean];
|
|
4077
4059
|
/**
|
|
4078
4060
|
* Disallows `/// <reference path=>` imports (use ES6-style imports instead).
|
|
4079
4061
|
*/
|
|
4080
|
-
"no-reference"?: (
|
|
4062
|
+
"no-reference"?: (Rule & []) | [boolean];
|
|
4081
4063
|
/**
|
|
4082
4064
|
* Disallows unnecessary `return await`.
|
|
4083
4065
|
*/
|
|
4084
|
-
"no-return-await"?: (
|
|
4066
|
+
"no-return-await"?: (Rule & []) | [boolean];
|
|
4085
4067
|
/**
|
|
4086
4068
|
* Disallows invocation of `require()`.
|
|
4087
4069
|
*/
|
|
4088
|
-
"no-require-imports"?: (
|
|
4070
|
+
"no-require-imports"?: (Rule & []) | [boolean];
|
|
4089
4071
|
/**
|
|
4090
4072
|
* Disallows shadowing variable declarations.
|
|
4091
4073
|
*/
|
|
4092
|
-
"no-shadowed-variable"?: (
|
|
4074
|
+
"no-shadowed-variable"?: (Rule & []) | [boolean, ...Items3[]];
|
|
4093
4075
|
/**
|
|
4094
4076
|
* Forbids array literals to contain missing elements.
|
|
4095
4077
|
*/
|
|
4096
|
-
"no-sparse-arrays"?: (
|
|
4078
|
+
"no-sparse-arrays"?: (Rule & []) | [boolean];
|
|
4097
4079
|
/**
|
|
4098
4080
|
* Forbids unnecessary string literal property access.
|
|
4099
4081
|
* Allows `obj["prop-erty"]` (can't be a regular property access).
|
|
4100
4082
|
* Disallows `obj["property"]` (should be `obj.property`).
|
|
4101
4083
|
*/
|
|
4102
|
-
"no-string-literal"?: (
|
|
4084
|
+
"no-string-literal"?: (Rule & []) | [boolean];
|
|
4103
4085
|
/**
|
|
4104
4086
|
* Flags throwing plain strings or concatenations of strings because only Errors produce proper stack traces.
|
|
4105
4087
|
*/
|
|
4106
|
-
"no-string-throw"?: (
|
|
4088
|
+
"no-string-throw"?: (Rule & []) | [boolean];
|
|
4107
4089
|
/**
|
|
4108
4090
|
* Disallows importing any submodule.
|
|
4109
4091
|
*/
|
|
4110
|
-
"no-submodule-imports"?: (
|
|
4092
|
+
"no-submodule-imports"?: (Rule & []) | [boolean, ...string[]];
|
|
4111
4093
|
/**
|
|
4112
4094
|
* Disallows falling through case statements.
|
|
4113
4095
|
*/
|
|
4114
|
-
"no-switch-case-fall-through"?: (
|
|
4096
|
+
"no-switch-case-fall-through"?: (Rule & []) | [boolean];
|
|
4115
4097
|
/**
|
|
4116
4098
|
* Disallows unnecessary references to `this`.
|
|
4117
4099
|
*/
|
|
4118
|
-
"no-this-assignment"?: (
|
|
4100
|
+
"no-this-assignment"?: (Rule & []) | [boolean, ...Items4[]];
|
|
4119
4101
|
/**
|
|
4120
4102
|
* Disallows trailing whitespace at the end of a line.
|
|
4121
4103
|
*/
|
|
4122
4104
|
"no-trailing-whitespace"?:
|
|
4123
|
-
| (
|
|
4105
|
+
| (Rule & [])
|
|
4124
4106
|
| [boolean, ...("ignore-comments" | "ignore-jsdoc" | "ignore-template-strings" | "ignore-blank-lines")[]];
|
|
4125
4107
|
/**
|
|
4126
4108
|
* Replaces `x => f(x)` with just `f`.
|
|
4127
4109
|
* To catch more cases, enable `only-arrow-functions` and `arrow-return-shorthand` too.
|
|
4128
4110
|
*/
|
|
4129
|
-
"no-unnecessary-callback-wrapper"?: (
|
|
4111
|
+
"no-unnecessary-callback-wrapper"?: (Rule & []) | [boolean];
|
|
4130
4112
|
/**
|
|
4131
4113
|
* Disallows classes that are not strictly necessary.
|
|
4132
4114
|
*/
|
|
4133
4115
|
"no-unnecessary-class"?:
|
|
4134
|
-
| (
|
|
4116
|
+
| (Rule & [])
|
|
4135
4117
|
| [boolean, ...("allow-constructor-only" | "allow-empty-class" | "allow-static-only")[]];
|
|
4136
4118
|
/**
|
|
4137
4119
|
* Forbids a 'var'/'let' statement or destructuring initializer to be initialized to 'undefined'.
|
|
4138
4120
|
*/
|
|
4139
|
-
"no-unnecessary-initializer"?: (
|
|
4121
|
+
"no-unnecessary-initializer"?: (Rule & []) | [boolean];
|
|
4140
4122
|
/**
|
|
4141
4123
|
* Disallows control flow statements, such as `return`, `continue` `break` and `throws` in finally blocks.
|
|
4142
4124
|
*/
|
|
4143
|
-
"no-unsafe-finally"?: (
|
|
4125
|
+
"no-unsafe-finally"?: (Rule & []) | [boolean];
|
|
4144
4126
|
/**
|
|
4145
4127
|
* Disallows unused expression statements.
|
|
4146
4128
|
*/
|
|
4147
4129
|
"no-unused-expression"?:
|
|
4148
|
-
| (
|
|
4130
|
+
| (Rule & [])
|
|
4149
4131
|
| [boolean, ...("allow-fast-null-checks" | "allow-new" | "allow-tagged-template")[]];
|
|
4150
4132
|
/**
|
|
4151
4133
|
* Disallows usage of variables before their declaration.
|
|
4152
4134
|
*/
|
|
4153
|
-
"no-use-before-declare"?: (
|
|
4135
|
+
"no-use-before-declare"?: (Rule & []) | [boolean];
|
|
4154
4136
|
/**
|
|
4155
4137
|
* Disallows usage of the `var` keyword.
|
|
4156
4138
|
*/
|
|
4157
|
-
"no-var-keyword"?: (
|
|
4139
|
+
"no-var-keyword"?: (Rule & []) | [boolean];
|
|
4158
4140
|
/**
|
|
4159
4141
|
* Requires expressions of type `void` to appear in statement position.
|
|
4160
4142
|
*/
|
|
4161
|
-
"no-void-expression"?: (
|
|
4143
|
+
"no-void-expression"?: (Rule & []) | [boolean, ..."ignore-arrow-function-shorthand"[]];
|
|
4162
4144
|
/**
|
|
4163
4145
|
* Checks that decimal literals should begin with '0.' instead of just '.', and should not end with a trailing '0'.
|
|
4164
4146
|
*/
|
|
4165
|
-
"number-literal-format"?: (
|
|
4147
|
+
"number-literal-format"?: (Rule & []) | [boolean];
|
|
4166
4148
|
/**
|
|
4167
4149
|
* Enforces consistent object literal property quote style.
|
|
4168
4150
|
*/
|
|
4169
4151
|
"object-literal-key-quotes"?:
|
|
4170
|
-
| (
|
|
4152
|
+
| (Rule & [])
|
|
4171
4153
|
| [boolean, ...("always" | "as-needed" | "consistent" | "consistent-as-needed")[]];
|
|
4172
4154
|
/**
|
|
4173
4155
|
* Enforces use of ES6 object literal shorthand when possible.
|
|
4174
4156
|
*/
|
|
4175
|
-
"object-literal-shorthand"?: (
|
|
4157
|
+
"object-literal-shorthand"?: (Rule & []) | [boolean, ...("always" | "never")[]];
|
|
4176
4158
|
/**
|
|
4177
4159
|
* Checks ordering of keys in object literals.
|
|
4178
4160
|
*/
|
|
4179
4161
|
"object-literal-sort-keys"?:
|
|
4180
|
-
| (
|
|
4162
|
+
| (Rule & [])
|
|
4181
4163
|
| [boolean, ...("ignore-case" | "locale-compare" | "match-declaration-order" | "shorthand-first")[]];
|
|
4182
4164
|
/**
|
|
4183
4165
|
* Requires the specified tokens to be on the same line as the expression preceding them.
|
|
4184
4166
|
*/
|
|
4185
4167
|
"one-line"?:
|
|
4186
|
-
| (
|
|
4168
|
+
| (Rule & [])
|
|
4187
4169
|
| [boolean, ...("check-catch" | "check-finally" | "check-else" | "check-open-brace" | "check-whitespace")[]];
|
|
4188
4170
|
/**
|
|
4189
4171
|
* Disallows multiple variable definitions in the same declaration statement.
|
|
4190
4172
|
*/
|
|
4191
|
-
"one-variable-per-declaration"?: (
|
|
4173
|
+
"one-variable-per-declaration"?: (Rule & []) | [boolean, ..."ignore-for-loop"[]];
|
|
4192
4174
|
/**
|
|
4193
4175
|
* Disallows traditional (non-arrow) function expressions.
|
|
4194
4176
|
*/
|
|
4195
|
-
"only-arrow-functions"?: (
|
|
4177
|
+
"only-arrow-functions"?: (Rule & []) | [boolean, ...("allow-declarations" | "allow-named-functions")[]];
|
|
4196
4178
|
/**
|
|
4197
4179
|
* Requires that import statements be alphabetized.
|
|
4198
4180
|
*/
|
|
4199
|
-
"ordered-imports"?: (
|
|
4181
|
+
"ordered-imports"?: (Rule & []) | [boolean, ...Items5[]];
|
|
4200
4182
|
/**
|
|
4201
4183
|
* Recommends to use a conditional expression instead of assigning to the same thing in each branch of an if statement.
|
|
4202
4184
|
*/
|
|
4203
|
-
"prefer-conditional-expression"?: (
|
|
4185
|
+
"prefer-conditional-expression"?: (Rule & []) | [boolean, ..."check-else-if"[]];
|
|
4204
4186
|
/**
|
|
4205
4187
|
* Requires that variable declarations use `const` instead of `let` and `var` if possible.
|
|
4206
4188
|
*/
|
|
4207
|
-
"prefer-const"?: (
|
|
4189
|
+
"prefer-const"?: (Rule & []) | [boolean, ...Items6[]];
|
|
4208
4190
|
/**
|
|
4209
4191
|
* Recommends a 'for-of' loop over a standard 'for' loop if the index is only used to access the array being iterated.
|
|
4210
4192
|
*/
|
|
4211
|
-
"prefer-for-of"?: (
|
|
4193
|
+
"prefer-for-of"?: (Rule & []) | [boolean];
|
|
4212
4194
|
/**
|
|
4213
4195
|
* Warns for class methods that do not use 'this'.
|
|
4214
4196
|
*/
|
|
4215
|
-
"prefer-function-over-method"?: (
|
|
4197
|
+
"prefer-function-over-method"?: (Rule & []) | [boolean, ...("allow-public" | "allow-protected")[]];
|
|
4216
4198
|
/**
|
|
4217
4199
|
* Prefer `foo(): void` over `foo: () => void` in interfaces and types.
|
|
4218
4200
|
*/
|
|
4219
|
-
"prefer-method-signature"?: (
|
|
4201
|
+
"prefer-method-signature"?: (Rule & []) | [boolean];
|
|
4220
4202
|
/**
|
|
4221
4203
|
* Enforces the use of the ES2015 object spread operator over `Object.assign()` where appropriate.
|
|
4222
4204
|
*/
|
|
4223
|
-
"prefer-object-spread"?: (
|
|
4205
|
+
"prefer-object-spread"?: (Rule & []) | [boolean];
|
|
4224
4206
|
/**
|
|
4225
4207
|
* Prefer a `switch` statement to an `if` statement with simple `===` comparisons.
|
|
4226
4208
|
*/
|
|
4227
|
-
"prefer-switch"?: (
|
|
4209
|
+
"prefer-switch"?: (Rule & []) | [boolean, ...Items7[]];
|
|
4228
4210
|
/**
|
|
4229
4211
|
* Prefer a template expression over string literal concatenation.
|
|
4230
4212
|
*/
|
|
4231
|
-
"prefer-template"?: (
|
|
4213
|
+
"prefer-template"?: (Rule & []) | [boolean, ..."allow-single-concat"[]];
|
|
4232
4214
|
/**
|
|
4233
4215
|
* Prefer while loops instead of for loops without an initializer and incrementor.
|
|
4234
4216
|
*/
|
|
4235
|
-
"prefer-while"?: (
|
|
4236
|
-
/**
|
|
4237
|
-
* Force functions marked async contain an await or return statement
|
|
4238
|
-
* https://palantir.github.io/tslint/rules/no-async-without-await/
|
|
4239
|
-
*/
|
|
4240
|
-
"no-async-without-await"?: (Rule1 & []) | [boolean];
|
|
4217
|
+
"prefer-while"?: (Rule & []) | [boolean];
|
|
4241
4218
|
/**
|
|
4242
4219
|
* Requires any function or method that returns a promise to be marked async.
|
|
4243
4220
|
*/
|
|
4244
|
-
"promise-function-async"?: (
|
|
4221
|
+
"promise-function-async"?: (Rule & []) | [boolean];
|
|
4245
4222
|
/**
|
|
4246
4223
|
* Requires single or double quotes for string literals.
|
|
4247
4224
|
*/
|
|
4248
4225
|
quotemark?:
|
|
4249
|
-
| (
|
|
4226
|
+
| (Rule & [])
|
|
4250
4227
|
| [boolean, ...("single" | "double" | "jsx-single" | "jsx-double" | "avoid-escape" | "avoid-template")[]];
|
|
4251
4228
|
/**
|
|
4252
4229
|
* Requires the radix parameter to be specified when calling `parseInt`.
|
|
4253
4230
|
*/
|
|
4254
|
-
radix?: (
|
|
4231
|
+
radix?: (Rule & []) | [boolean];
|
|
4255
4232
|
/**
|
|
4256
4233
|
* When adding two variables, operands must both be of type number or of type string.
|
|
4257
4234
|
*/
|
|
4258
|
-
"restrict-plus-operands"?: (
|
|
4235
|
+
"restrict-plus-operands"?: (Rule & []) | [boolean];
|
|
4259
4236
|
/**
|
|
4260
4237
|
* Prefer `return;` in void functions and `return undefined;` in value-returning functions.
|
|
4261
4238
|
*/
|
|
4262
|
-
"return-undefined"?: (
|
|
4239
|
+
"return-undefined"?: (Rule & []) | [boolean];
|
|
4263
4240
|
/**
|
|
4264
4241
|
* Enforces consistent semicolon usage at the end of every statement.
|
|
4265
4242
|
*/
|
|
4266
4243
|
semicolon?:
|
|
4267
|
-
| (
|
|
4244
|
+
| (Rule & [])
|
|
4268
4245
|
| [boolean]
|
|
4269
4246
|
| [boolean, "always" | "never"]
|
|
4270
4247
|
| [boolean, "always" | "never", "ignore-interfaces" | "ignore-bound-class-methods" | "strict-bound-class-methods"];
|
|
4271
4248
|
/**
|
|
4272
4249
|
* Require or disallow a space before function parenthesis
|
|
4273
4250
|
*/
|
|
4274
|
-
"space-before-function-paren"?: (
|
|
4251
|
+
"space-before-function-paren"?: (Rule & []) | [boolean, ...Items8[]];
|
|
4275
4252
|
/**
|
|
4276
4253
|
* Enforces spaces within parentheses or disallow them.
|
|
4277
4254
|
*/
|
|
4278
|
-
"space-within-parens"?: (
|
|
4255
|
+
"space-within-parens"?: (Rule & []) | [boolean, ...number[]];
|
|
4279
4256
|
/**
|
|
4280
4257
|
* Require a `default` case in all `switch` statements.
|
|
4281
4258
|
*/
|
|
4282
|
-
"switch-default"?: (
|
|
4259
|
+
"switch-default"?: (Rule & []) | [boolean];
|
|
4283
4260
|
/**
|
|
4284
4261
|
* Checks whether the final clause of a switch statement ends in `break;`.
|
|
4285
4262
|
*/
|
|
4286
|
-
"switch-final-break"?: (
|
|
4263
|
+
"switch-final-break"?: (Rule & []) | [boolean, ..."always"[]];
|
|
4287
4264
|
/**
|
|
4288
4265
|
* Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.
|
|
4289
4266
|
*/
|
|
4290
|
-
"trailing-comma"?: (
|
|
4267
|
+
"trailing-comma"?: (Rule & []) | [boolean, ...Items9[]];
|
|
4291
4268
|
/**
|
|
4292
4269
|
* Requires `===` and `!==` in place of `==` and `!=`.
|
|
4293
4270
|
*/
|
|
4294
|
-
"triple-equals"?: (
|
|
4271
|
+
"triple-equals"?: (Rule & []) | [boolean, ...("allow-null-check" | "allow-undefined-check")[]];
|
|
4295
4272
|
/**
|
|
4296
4273
|
* Makes sure result of `typeof` is compared to correct string values
|
|
4297
4274
|
*/
|
|
4298
|
-
"typeof-compare"?: (
|
|
4275
|
+
"typeof-compare"?: (Rule & []) | [boolean];
|
|
4299
4276
|
/**
|
|
4300
4277
|
* Enforces use of the `isNaN()` function to check for NaN references instead of a comparison to the `NaN` constant.
|
|
4301
4278
|
*/
|
|
4302
|
-
"use-isnan"?: (
|
|
4279
|
+
"use-isnan"?: (Rule & []) | [boolean];
|
|
4303
4280
|
/**
|
|
4304
4281
|
* Checks variable names for various errors.
|
|
4305
4282
|
*/
|
|
4306
4283
|
"variable-name"?:
|
|
4307
|
-
| (
|
|
4284
|
+
| (Rule & [])
|
|
4308
4285
|
| [
|
|
4309
4286
|
boolean,
|
|
4310
4287
|
...(
|
|
@@ -4321,7 +4298,7 @@ export interface Rules {
|
|
|
4321
4298
|
* Enforces whitespace style conventions.
|
|
4322
4299
|
*/
|
|
4323
4300
|
whitespace?:
|
|
4324
|
-
| (
|
|
4301
|
+
| (Rule & [])
|
|
4325
4302
|
| [
|
|
4326
4303
|
boolean,
|
|
4327
4304
|
...(
|
|
@@ -8542,20 +8519,20 @@ export interface Rules1 {
|
|
|
8542
8519
|
/**
|
|
8543
8520
|
* Enforces vertical alignment.
|
|
8544
8521
|
*/
|
|
8545
|
-
align?: (
|
|
8522
|
+
align?: (Rule & []) | [boolean, ...("arguments" | "elements" | "members" | "parameters" | "statements")[]];
|
|
8546
8523
|
/**
|
|
8547
8524
|
* Requires parentheses around the parameters of arrow function definitions.
|
|
8548
8525
|
*/
|
|
8549
|
-
"arrow-parens"?: (
|
|
8526
|
+
"arrow-parens"?: (Rule & []) | [boolean, ..."ban-single-arg-parens"[]];
|
|
8550
8527
|
/**
|
|
8551
8528
|
* Suggests to convert `() => { return x; }` to `() => x`.
|
|
8552
8529
|
*/
|
|
8553
|
-
"arrow-return-shorthand"?: (
|
|
8530
|
+
"arrow-return-shorthand"?: (Rule & []) | [boolean, ..."multiline"[]];
|
|
8554
8531
|
/**
|
|
8555
8532
|
* Bans the use of specific functions or global methods.
|
|
8556
8533
|
*/
|
|
8557
8534
|
ban?:
|
|
8558
|
-
| (
|
|
8535
|
+
| (Rule & [])
|
|
8559
8536
|
| [
|
|
8560
8537
|
boolean,
|
|
8561
8538
|
...(
|
|
@@ -8572,21 +8549,21 @@ export interface Rules1 {
|
|
|
8572
8549
|
/**
|
|
8573
8550
|
* Bans the comma operator.
|
|
8574
8551
|
*/
|
|
8575
|
-
"ban-comma-operator"?: (
|
|
8552
|
+
"ban-comma-operator"?: (Rule & []) | [boolean];
|
|
8576
8553
|
/**
|
|
8577
8554
|
* In a binary expression, a literal should always be on the right-hand side if possible.
|
|
8578
8555
|
* For example, prefer 'x + 1' over '1 + x'.
|
|
8579
8556
|
*/
|
|
8580
|
-
"binary-expression-operand-order"?: (
|
|
8557
|
+
"binary-expression-operand-order"?: (Rule & []) | [boolean];
|
|
8581
8558
|
/**
|
|
8582
8559
|
* Enforces PascalCased class and interface names.
|
|
8583
8560
|
*/
|
|
8584
|
-
"class-name"?: (
|
|
8561
|
+
"class-name"?: (Rule & []) | [boolean];
|
|
8585
8562
|
/**
|
|
8586
8563
|
* Enforces formatting rules for single-line comments.
|
|
8587
8564
|
*/
|
|
8588
8565
|
"comment-format"?:
|
|
8589
|
-
| (
|
|
8566
|
+
| (Rule & [])
|
|
8590
8567
|
| [
|
|
8591
8568
|
boolean,
|
|
8592
8569
|
...(
|
|
@@ -8602,7 +8579,7 @@ export interface Rules1 {
|
|
|
8602
8579
|
* Enforces documentation for important items be filled out.
|
|
8603
8580
|
*/
|
|
8604
8581
|
"completed-docs"?:
|
|
8605
|
-
| (
|
|
8582
|
+
| (Rule & [])
|
|
8606
8583
|
| [
|
|
8607
8584
|
boolean,
|
|
8608
8585
|
...(
|
|
@@ -8658,27 +8635,27 @@ export interface Rules1 {
|
|
|
8658
8635
|
/**
|
|
8659
8636
|
* Enforces braces for `if`/`for`/`do`/`while` statements.
|
|
8660
8637
|
*/
|
|
8661
|
-
curly?: (
|
|
8638
|
+
curly?: (Rule & []) | [boolean, ...("as-needed" | "ignore-same-line")[]];
|
|
8662
8639
|
/**
|
|
8663
8640
|
* Enforces a threshold of cyclomatic complexity.
|
|
8664
8641
|
*/
|
|
8665
|
-
"cyclomatic-complexity"?: (
|
|
8642
|
+
"cyclomatic-complexity"?: (Rule & []) | [boolean, ...number[]];
|
|
8666
8643
|
/**
|
|
8667
8644
|
* Warns when deprecated APIs are used.
|
|
8668
8645
|
*/
|
|
8669
|
-
deprecation?: (
|
|
8646
|
+
deprecation?: (Rule & []) | [boolean];
|
|
8670
8647
|
/**
|
|
8671
8648
|
* Enforces UTF-8 file encoding.
|
|
8672
8649
|
*/
|
|
8673
|
-
encoding?: (
|
|
8650
|
+
encoding?: (Rule & []) | [boolean];
|
|
8674
8651
|
/**
|
|
8675
8652
|
* Ensures the file ends with a newline.
|
|
8676
8653
|
*/
|
|
8677
|
-
eofline?: (
|
|
8654
|
+
eofline?: (Rule & []) | [boolean];
|
|
8678
8655
|
/**
|
|
8679
8656
|
* Enforces a certain header comment for all files, matched by a regular expression.
|
|
8680
8657
|
*/
|
|
8681
|
-
"file-header"?: (
|
|
8658
|
+
"file-header"?: (Rule & []) | [boolean, ...string[]];
|
|
8682
8659
|
/**
|
|
8683
8660
|
* Enforces a consistent file naming convention.
|
|
8684
8661
|
*
|
|
@@ -8696,13 +8673,13 @@ export interface Rules1 {
|
|
|
8696
8673
|
/**
|
|
8697
8674
|
* Requires a `for ... in` statement to be filtered with an `if` statement.
|
|
8698
8675
|
*/
|
|
8699
|
-
forin?: (
|
|
8676
|
+
forin?: (Rule & []) | [boolean];
|
|
8700
8677
|
/**
|
|
8701
8678
|
* Disallows importing the specified modules directly via `import` and `require`.
|
|
8702
8679
|
* Instead only sub modules may be imported from that module.
|
|
8703
8680
|
*/
|
|
8704
8681
|
"import-blacklist"?:
|
|
8705
|
-
| (
|
|
8682
|
+
| (Rule & [])
|
|
8706
8683
|
| [
|
|
8707
8684
|
boolean,
|
|
8708
8685
|
...(
|
|
@@ -8719,36 +8696,36 @@ export interface Rules1 {
|
|
|
8719
8696
|
/**
|
|
8720
8697
|
* Ensures proper spacing between import statement keywords
|
|
8721
8698
|
*/
|
|
8722
|
-
"import-spacing"?: (
|
|
8699
|
+
"import-spacing"?: (Rule & []) | [boolean];
|
|
8723
8700
|
/**
|
|
8724
8701
|
* Enforces indentation with tabs or spaces.
|
|
8725
8702
|
*/
|
|
8726
|
-
indent?: (
|
|
8703
|
+
indent?: (Rule & []) | [boolean] | [boolean, "tabs" | "spaces"] | [boolean, "tabs" | "spaces", 2 | 4];
|
|
8727
8704
|
/**
|
|
8728
8705
|
* Enforces basic format rules for JSDoc comments.
|
|
8729
8706
|
*/
|
|
8730
|
-
"jsdoc-format"?: (
|
|
8707
|
+
"jsdoc-format"?: (Rule & []) | [boolean, ..."check-multiline-start"[]];
|
|
8731
8708
|
/**
|
|
8732
8709
|
* Only allows labels in sensible locations.
|
|
8733
8710
|
*/
|
|
8734
|
-
"label-position"?: (
|
|
8711
|
+
"label-position"?: (Rule & []) | [boolean];
|
|
8735
8712
|
/**
|
|
8736
8713
|
* Enforces a consistent linebreak style.
|
|
8737
8714
|
*/
|
|
8738
|
-
"linebreak-style"?: (
|
|
8715
|
+
"linebreak-style"?: (Rule & []) | [boolean, ...("LF" | "CRLF")[]];
|
|
8739
8716
|
/**
|
|
8740
8717
|
* A file may not contain more than the specified number of classes
|
|
8741
8718
|
*/
|
|
8742
|
-
"max-classes-per-file"?: (
|
|
8719
|
+
"max-classes-per-file"?: (Rule & [boolean, number]) | [boolean, number, "exclude-class-expressions"];
|
|
8743
8720
|
/**
|
|
8744
8721
|
* Requires files to remain under a certain number of lines
|
|
8745
8722
|
*/
|
|
8746
|
-
"max-file-line-count"?: (
|
|
8723
|
+
"max-file-line-count"?: (Rule & []) | [boolean, ...number[]];
|
|
8747
8724
|
/**
|
|
8748
8725
|
* Requires lines to be under a certain max length.
|
|
8749
8726
|
*/
|
|
8750
8727
|
"max-line-length"?:
|
|
8751
|
-
| (
|
|
8728
|
+
| (Rule & [])
|
|
8752
8729
|
| [
|
|
8753
8730
|
boolean,
|
|
8754
8731
|
...(
|
|
@@ -8764,359 +8741,344 @@ export interface Rules1 {
|
|
|
8764
8741
|
/**
|
|
8765
8742
|
* Enforces member ordering.
|
|
8766
8743
|
*/
|
|
8767
|
-
"member-ordering"?: (
|
|
8744
|
+
"member-ordering"?: (Rule & []) | [boolean, ...Items1[]];
|
|
8768
8745
|
/**
|
|
8769
8746
|
* Enforces blank line before return when not the only line in the block.
|
|
8770
8747
|
*/
|
|
8771
|
-
"newline-before-return"?: (
|
|
8748
|
+
"newline-before-return"?: (Rule & []) | [boolean];
|
|
8772
8749
|
/**
|
|
8773
8750
|
* Requires that chained method calls be broken apart onto separate lines.
|
|
8774
8751
|
*/
|
|
8775
|
-
"newline-per-chained-call"?: (
|
|
8752
|
+
"newline-per-chained-call"?: (Rule & []) | [boolean];
|
|
8776
8753
|
/**
|
|
8777
8754
|
* Requires parentheses when invoking a constructor via the `new` keyword.
|
|
8778
8755
|
*/
|
|
8779
|
-
"new-parens"?: (
|
|
8756
|
+
"new-parens"?: (Rule & []) | [boolean];
|
|
8780
8757
|
/**
|
|
8781
8758
|
* Disallows use of `arguments.callee`.
|
|
8782
8759
|
*/
|
|
8783
|
-
"no-arg"?: (
|
|
8760
|
+
"no-arg"?: (Rule & []) | [boolean];
|
|
8784
8761
|
/**
|
|
8785
8762
|
* Disallows bitwise operators.
|
|
8786
8763
|
*/
|
|
8787
|
-
"no-bitwise"?: (
|
|
8764
|
+
"no-bitwise"?: (Rule & []) | [boolean];
|
|
8788
8765
|
/**
|
|
8789
8766
|
* Disallows any type of assignment in conditionals.
|
|
8790
8767
|
*/
|
|
8791
|
-
"no-conditional-assignment"?: (
|
|
8768
|
+
"no-conditional-assignment"?: (Rule & []) | [boolean];
|
|
8792
8769
|
/**
|
|
8793
8770
|
* Disallows one or more blank lines in a row.
|
|
8794
8771
|
*/
|
|
8795
|
-
"no-consecutive-blank-lines"?: (
|
|
8772
|
+
"no-consecutive-blank-lines"?: (Rule & []) | [boolean, ...number[]];
|
|
8796
8773
|
/**
|
|
8797
8774
|
* Bans the use of specified `console` methods.
|
|
8798
8775
|
*/
|
|
8799
|
-
"no-console"?: (
|
|
8776
|
+
"no-console"?: (Rule & []) | [boolean, ...string[]];
|
|
8800
8777
|
/**
|
|
8801
8778
|
* Disallows access to the constructors of `String`, `Number`, and `Boolean`.
|
|
8802
8779
|
*/
|
|
8803
|
-
"no-construct"?: (
|
|
8780
|
+
"no-construct"?: (Rule & []) | [boolean];
|
|
8804
8781
|
/**
|
|
8805
8782
|
* Disallows `debugger` statements.
|
|
8806
8783
|
*/
|
|
8807
|
-
"no-debugger"?: (
|
|
8784
|
+
"no-debugger"?: (Rule & []) | [boolean];
|
|
8808
8785
|
/**
|
|
8809
8786
|
* Disallows default exports in ES6-style modules.
|
|
8810
8787
|
*/
|
|
8811
|
-
"no-default-export"?: (
|
|
8788
|
+
"no-default-export"?: (Rule & []) | [boolean];
|
|
8812
8789
|
/**
|
|
8813
8790
|
* Disallows multiple import statements from the same module.
|
|
8814
8791
|
*/
|
|
8815
|
-
"no-duplicate-imports"?: (
|
|
8792
|
+
"no-duplicate-imports"?: (Rule & []) | [boolean] | [boolean, Options];
|
|
8816
8793
|
/**
|
|
8817
8794
|
* Warns if 'super()' appears twice in a constructor.
|
|
8818
8795
|
*/
|
|
8819
|
-
"no-duplicate-super"?: (
|
|
8796
|
+
"no-duplicate-super"?: (Rule & []) | [boolean];
|
|
8820
8797
|
/**
|
|
8821
8798
|
* Prevents duplicate cases in switch statements.
|
|
8822
8799
|
*/
|
|
8823
|
-
"no-duplicate-switch-case"?: (
|
|
8800
|
+
"no-duplicate-switch-case"?: (Rule & []) | [boolean];
|
|
8824
8801
|
/**
|
|
8825
8802
|
* Disallows duplicate variable declarations in the same block scope.
|
|
8826
8803
|
*/
|
|
8827
|
-
"no-duplicate-variable"?: (
|
|
8804
|
+
"no-duplicate-variable"?: (Rule & []) | [boolean, ..."check-parameters"[]];
|
|
8828
8805
|
/**
|
|
8829
8806
|
* Bans usage of the delete operator with computed key expressions.
|
|
8830
8807
|
*/
|
|
8831
|
-
"no-dynamic-delete"?: (
|
|
8808
|
+
"no-dynamic-delete"?: (Rule & []) | [boolean];
|
|
8832
8809
|
/**
|
|
8833
8810
|
* Disallows empty blocks.
|
|
8834
8811
|
*/
|
|
8835
|
-
"no-empty"?: (
|
|
8812
|
+
"no-empty"?: (Rule & []) | [boolean, ...("allow-empty-catch" | "allow-empty-functions")[]];
|
|
8836
8813
|
/**
|
|
8837
8814
|
* Disallows `eval` function invocations.
|
|
8838
8815
|
*/
|
|
8839
|
-
"no-eval"?: (
|
|
8840
|
-
/**
|
|
8841
|
-
* Forbid for…in statements
|
|
8842
|
-
* https://palantir.github.io/tslint/rules/no-for-in/
|
|
8843
|
-
*/
|
|
8844
|
-
"no-for-in"?: (Rule1 & []) | [boolean];
|
|
8816
|
+
"no-eval"?: (Rule & []) | [boolean];
|
|
8845
8817
|
/**
|
|
8846
8818
|
* Disallows iterating over an array with a for-in loop.
|
|
8847
8819
|
*/
|
|
8848
|
-
"no-for-in-array"?: (
|
|
8820
|
+
"no-for-in-array"?: (Rule & []) | [boolean];
|
|
8849
8821
|
/**
|
|
8850
|
-
* Disallows importing modules that are not listed as dependency in the project
|
|
8822
|
+
* Disallows importing modules that are not listed as dependency in the project’s package.json.
|
|
8851
8823
|
*/
|
|
8852
8824
|
"no-implicit-dependencies"?:
|
|
8853
|
-
| (
|
|
8825
|
+
| (Rule & [])
|
|
8854
8826
|
| [boolean, ...[{type: "string"; enum: ["dev", "optional"]}, {type: "array"; minItems: 0}][]];
|
|
8855
8827
|
/**
|
|
8856
8828
|
* Avoid import statements with side-effect.
|
|
8857
8829
|
*/
|
|
8858
|
-
"no-import-side-effect"?: (
|
|
8830
|
+
"no-import-side-effect"?: (Rule & []) | [boolean, ...Items2[]];
|
|
8859
8831
|
/**
|
|
8860
8832
|
* Warns on use of `${` in non-template strings.
|
|
8861
8833
|
*/
|
|
8862
|
-
"no-invalid-template-strings"?: (
|
|
8834
|
+
"no-invalid-template-strings"?: (Rule & []) | [boolean];
|
|
8863
8835
|
/**
|
|
8864
8836
|
* Disallows using the `this` keyword outside of classes.
|
|
8865
8837
|
*/
|
|
8866
|
-
"no-invalid-this"?: (
|
|
8838
|
+
"no-invalid-this"?: (Rule & []) | [boolean, ..."check-function-in-method"[]];
|
|
8867
8839
|
/**
|
|
8868
8840
|
* Disallow irregular whitespace outside of strings and comments
|
|
8869
8841
|
*/
|
|
8870
|
-
"no-irregular-whitespace"?: (
|
|
8842
|
+
"no-irregular-whitespace"?: (Rule & []) | [boolean];
|
|
8871
8843
|
/**
|
|
8872
8844
|
* Disallows the use constant number values outside of variable assignments.
|
|
8873
8845
|
* When no list of allowed values is specified, -1, 0 and 1 are allowed by default.
|
|
8874
8846
|
*/
|
|
8875
|
-
"no-magic-numbers"?: (
|
|
8876
|
-
/**
|
|
8877
|
-
* Forbid explicitly declared or implicitly returned union types with both null and undefined as members
|
|
8878
|
-
* https://palantir.github.io/tslint/rules/no-null-undefined-union/
|
|
8879
|
-
*/
|
|
8880
|
-
"no-null-undefined-union"?: (Rule1 & []) | [boolean];
|
|
8847
|
+
"no-magic-numbers"?: (Rule & []) | [boolean, ...number[]];
|
|
8881
8848
|
/**
|
|
8882
8849
|
* Disallows use of the `null` keyword literal.
|
|
8883
8850
|
*/
|
|
8884
|
-
"no-null-keyword"?: (
|
|
8851
|
+
"no-null-keyword"?: (Rule & []) | [boolean];
|
|
8885
8852
|
/**
|
|
8886
8853
|
* Disallows reassigning parameters.
|
|
8887
8854
|
*/
|
|
8888
|
-
"no-parameter-reassignment"?: (
|
|
8855
|
+
"no-parameter-reassignment"?: (Rule & []) | [boolean];
|
|
8889
8856
|
/**
|
|
8890
8857
|
* Disallows `/// <reference path=>` imports (use ES6-style imports instead).
|
|
8891
8858
|
*/
|
|
8892
|
-
"no-reference"?: (
|
|
8859
|
+
"no-reference"?: (Rule & []) | [boolean];
|
|
8893
8860
|
/**
|
|
8894
8861
|
* Disallows unnecessary `return await`.
|
|
8895
8862
|
*/
|
|
8896
|
-
"no-return-await"?: (
|
|
8863
|
+
"no-return-await"?: (Rule & []) | [boolean];
|
|
8897
8864
|
/**
|
|
8898
8865
|
* Disallows invocation of `require()`.
|
|
8899
8866
|
*/
|
|
8900
|
-
"no-require-imports"?: (
|
|
8867
|
+
"no-require-imports"?: (Rule & []) | [boolean];
|
|
8901
8868
|
/**
|
|
8902
8869
|
* Disallows shadowing variable declarations.
|
|
8903
8870
|
*/
|
|
8904
|
-
"no-shadowed-variable"?: (
|
|
8871
|
+
"no-shadowed-variable"?: (Rule & []) | [boolean, ...Items3[]];
|
|
8905
8872
|
/**
|
|
8906
8873
|
* Forbids array literals to contain missing elements.
|
|
8907
8874
|
*/
|
|
8908
|
-
"no-sparse-arrays"?: (
|
|
8875
|
+
"no-sparse-arrays"?: (Rule & []) | [boolean];
|
|
8909
8876
|
/**
|
|
8910
8877
|
* Forbids unnecessary string literal property access.
|
|
8911
8878
|
* Allows `obj["prop-erty"]` (can't be a regular property access).
|
|
8912
8879
|
* Disallows `obj["property"]` (should be `obj.property`).
|
|
8913
8880
|
*/
|
|
8914
|
-
"no-string-literal"?: (
|
|
8881
|
+
"no-string-literal"?: (Rule & []) | [boolean];
|
|
8915
8882
|
/**
|
|
8916
8883
|
* Flags throwing plain strings or concatenations of strings because only Errors produce proper stack traces.
|
|
8917
8884
|
*/
|
|
8918
|
-
"no-string-throw"?: (
|
|
8885
|
+
"no-string-throw"?: (Rule & []) | [boolean];
|
|
8919
8886
|
/**
|
|
8920
8887
|
* Disallows importing any submodule.
|
|
8921
8888
|
*/
|
|
8922
|
-
"no-submodule-imports"?: (
|
|
8889
|
+
"no-submodule-imports"?: (Rule & []) | [boolean, ...string[]];
|
|
8923
8890
|
/**
|
|
8924
8891
|
* Disallows falling through case statements.
|
|
8925
8892
|
*/
|
|
8926
|
-
"no-switch-case-fall-through"?: (
|
|
8893
|
+
"no-switch-case-fall-through"?: (Rule & []) | [boolean];
|
|
8927
8894
|
/**
|
|
8928
8895
|
* Disallows unnecessary references to `this`.
|
|
8929
8896
|
*/
|
|
8930
|
-
"no-this-assignment"?: (
|
|
8897
|
+
"no-this-assignment"?: (Rule & []) | [boolean, ...Items4[]];
|
|
8931
8898
|
/**
|
|
8932
8899
|
* Disallows trailing whitespace at the end of a line.
|
|
8933
8900
|
*/
|
|
8934
8901
|
"no-trailing-whitespace"?:
|
|
8935
|
-
| (
|
|
8902
|
+
| (Rule & [])
|
|
8936
8903
|
| [boolean, ...("ignore-comments" | "ignore-jsdoc" | "ignore-template-strings" | "ignore-blank-lines")[]];
|
|
8937
8904
|
/**
|
|
8938
8905
|
* Replaces `x => f(x)` with just `f`.
|
|
8939
8906
|
* To catch more cases, enable `only-arrow-functions` and `arrow-return-shorthand` too.
|
|
8940
8907
|
*/
|
|
8941
|
-
"no-unnecessary-callback-wrapper"?: (
|
|
8908
|
+
"no-unnecessary-callback-wrapper"?: (Rule & []) | [boolean];
|
|
8942
8909
|
/**
|
|
8943
8910
|
* Disallows classes that are not strictly necessary.
|
|
8944
8911
|
*/
|
|
8945
8912
|
"no-unnecessary-class"?:
|
|
8946
|
-
| (
|
|
8913
|
+
| (Rule & [])
|
|
8947
8914
|
| [boolean, ...("allow-constructor-only" | "allow-empty-class" | "allow-static-only")[]];
|
|
8948
8915
|
/**
|
|
8949
8916
|
* Forbids a 'var'/'let' statement or destructuring initializer to be initialized to 'undefined'.
|
|
8950
8917
|
*/
|
|
8951
|
-
"no-unnecessary-initializer"?: (
|
|
8918
|
+
"no-unnecessary-initializer"?: (Rule & []) | [boolean];
|
|
8952
8919
|
/**
|
|
8953
8920
|
* Disallows control flow statements, such as `return`, `continue` `break` and `throws` in finally blocks.
|
|
8954
8921
|
*/
|
|
8955
|
-
"no-unsafe-finally"?: (
|
|
8922
|
+
"no-unsafe-finally"?: (Rule & []) | [boolean];
|
|
8956
8923
|
/**
|
|
8957
8924
|
* Disallows unused expression statements.
|
|
8958
8925
|
*/
|
|
8959
8926
|
"no-unused-expression"?:
|
|
8960
|
-
| (
|
|
8927
|
+
| (Rule & [])
|
|
8961
8928
|
| [boolean, ...("allow-fast-null-checks" | "allow-new" | "allow-tagged-template")[]];
|
|
8962
8929
|
/**
|
|
8963
8930
|
* Disallows usage of variables before their declaration.
|
|
8964
8931
|
*/
|
|
8965
|
-
"no-use-before-declare"?: (
|
|
8932
|
+
"no-use-before-declare"?: (Rule & []) | [boolean];
|
|
8966
8933
|
/**
|
|
8967
8934
|
* Disallows usage of the `var` keyword.
|
|
8968
8935
|
*/
|
|
8969
|
-
"no-var-keyword"?: (
|
|
8936
|
+
"no-var-keyword"?: (Rule & []) | [boolean];
|
|
8970
8937
|
/**
|
|
8971
8938
|
* Requires expressions of type `void` to appear in statement position.
|
|
8972
8939
|
*/
|
|
8973
|
-
"no-void-expression"?: (
|
|
8940
|
+
"no-void-expression"?: (Rule & []) | [boolean, ..."ignore-arrow-function-shorthand"[]];
|
|
8974
8941
|
/**
|
|
8975
8942
|
* Checks that decimal literals should begin with '0.' instead of just '.', and should not end with a trailing '0'.
|
|
8976
8943
|
*/
|
|
8977
|
-
"number-literal-format"?: (
|
|
8944
|
+
"number-literal-format"?: (Rule & []) | [boolean];
|
|
8978
8945
|
/**
|
|
8979
8946
|
* Enforces consistent object literal property quote style.
|
|
8980
8947
|
*/
|
|
8981
8948
|
"object-literal-key-quotes"?:
|
|
8982
|
-
| (
|
|
8949
|
+
| (Rule & [])
|
|
8983
8950
|
| [boolean, ...("always" | "as-needed" | "consistent" | "consistent-as-needed")[]];
|
|
8984
8951
|
/**
|
|
8985
8952
|
* Enforces use of ES6 object literal shorthand when possible.
|
|
8986
8953
|
*/
|
|
8987
|
-
"object-literal-shorthand"?: (
|
|
8954
|
+
"object-literal-shorthand"?: (Rule & []) | [boolean, ...("always" | "never")[]];
|
|
8988
8955
|
/**
|
|
8989
8956
|
* Checks ordering of keys in object literals.
|
|
8990
8957
|
*/
|
|
8991
8958
|
"object-literal-sort-keys"?:
|
|
8992
|
-
| (
|
|
8959
|
+
| (Rule & [])
|
|
8993
8960
|
| [boolean, ...("ignore-case" | "locale-compare" | "match-declaration-order" | "shorthand-first")[]];
|
|
8994
8961
|
/**
|
|
8995
8962
|
* Requires the specified tokens to be on the same line as the expression preceding them.
|
|
8996
8963
|
*/
|
|
8997
8964
|
"one-line"?:
|
|
8998
|
-
| (
|
|
8965
|
+
| (Rule & [])
|
|
8999
8966
|
| [boolean, ...("check-catch" | "check-finally" | "check-else" | "check-open-brace" | "check-whitespace")[]];
|
|
9000
8967
|
/**
|
|
9001
8968
|
* Disallows multiple variable definitions in the same declaration statement.
|
|
9002
8969
|
*/
|
|
9003
|
-
"one-variable-per-declaration"?: (
|
|
8970
|
+
"one-variable-per-declaration"?: (Rule & []) | [boolean, ..."ignore-for-loop"[]];
|
|
9004
8971
|
/**
|
|
9005
8972
|
* Disallows traditional (non-arrow) function expressions.
|
|
9006
8973
|
*/
|
|
9007
|
-
"only-arrow-functions"?: (
|
|
8974
|
+
"only-arrow-functions"?: (Rule & []) | [boolean, ...("allow-declarations" | "allow-named-functions")[]];
|
|
9008
8975
|
/**
|
|
9009
8976
|
* Requires that import statements be alphabetized.
|
|
9010
8977
|
*/
|
|
9011
|
-
"ordered-imports"?: (
|
|
8978
|
+
"ordered-imports"?: (Rule & []) | [boolean, ...Items5[]];
|
|
9012
8979
|
/**
|
|
9013
8980
|
* Recommends to use a conditional expression instead of assigning to the same thing in each branch of an if statement.
|
|
9014
8981
|
*/
|
|
9015
|
-
"prefer-conditional-expression"?: (
|
|
8982
|
+
"prefer-conditional-expression"?: (Rule & []) | [boolean, ..."check-else-if"[]];
|
|
9016
8983
|
/**
|
|
9017
8984
|
* Requires that variable declarations use `const` instead of `let` and `var` if possible.
|
|
9018
8985
|
*/
|
|
9019
|
-
"prefer-const"?: (
|
|
8986
|
+
"prefer-const"?: (Rule & []) | [boolean, ...Items6[]];
|
|
9020
8987
|
/**
|
|
9021
8988
|
* Recommends a 'for-of' loop over a standard 'for' loop if the index is only used to access the array being iterated.
|
|
9022
8989
|
*/
|
|
9023
|
-
"prefer-for-of"?: (
|
|
8990
|
+
"prefer-for-of"?: (Rule & []) | [boolean];
|
|
9024
8991
|
/**
|
|
9025
8992
|
* Warns for class methods that do not use 'this'.
|
|
9026
8993
|
*/
|
|
9027
|
-
"prefer-function-over-method"?: (
|
|
8994
|
+
"prefer-function-over-method"?: (Rule & []) | [boolean, ...("allow-public" | "allow-protected")[]];
|
|
9028
8995
|
/**
|
|
9029
8996
|
* Prefer `foo(): void` over `foo: () => void` in interfaces and types.
|
|
9030
8997
|
*/
|
|
9031
|
-
"prefer-method-signature"?: (
|
|
8998
|
+
"prefer-method-signature"?: (Rule & []) | [boolean];
|
|
9032
8999
|
/**
|
|
9033
9000
|
* Enforces the use of the ES2015 object spread operator over `Object.assign()` where appropriate.
|
|
9034
9001
|
*/
|
|
9035
|
-
"prefer-object-spread"?: (
|
|
9002
|
+
"prefer-object-spread"?: (Rule & []) | [boolean];
|
|
9036
9003
|
/**
|
|
9037
9004
|
* Prefer a `switch` statement to an `if` statement with simple `===` comparisons.
|
|
9038
9005
|
*/
|
|
9039
|
-
"prefer-switch"?: (
|
|
9006
|
+
"prefer-switch"?: (Rule & []) | [boolean, ...Items7[]];
|
|
9040
9007
|
/**
|
|
9041
9008
|
* Prefer a template expression over string literal concatenation.
|
|
9042
9009
|
*/
|
|
9043
|
-
"prefer-template"?: (
|
|
9010
|
+
"prefer-template"?: (Rule & []) | [boolean, ..."allow-single-concat"[]];
|
|
9044
9011
|
/**
|
|
9045
9012
|
* Prefer while loops instead of for loops without an initializer and incrementor.
|
|
9046
9013
|
*/
|
|
9047
|
-
"prefer-while"?: (
|
|
9048
|
-
/**
|
|
9049
|
-
* Force functions marked async contain an await or return statement
|
|
9050
|
-
* https://palantir.github.io/tslint/rules/no-async-without-await/
|
|
9051
|
-
*/
|
|
9052
|
-
"no-async-without-await"?: (Rule1 & []) | [boolean];
|
|
9014
|
+
"prefer-while"?: (Rule & []) | [boolean];
|
|
9053
9015
|
/**
|
|
9054
9016
|
* Requires any function or method that returns a promise to be marked async.
|
|
9055
9017
|
*/
|
|
9056
|
-
"promise-function-async"?: (
|
|
9018
|
+
"promise-function-async"?: (Rule & []) | [boolean];
|
|
9057
9019
|
/**
|
|
9058
9020
|
* Requires single or double quotes for string literals.
|
|
9059
9021
|
*/
|
|
9060
9022
|
quotemark?:
|
|
9061
|
-
| (
|
|
9023
|
+
| (Rule & [])
|
|
9062
9024
|
| [boolean, ...("single" | "double" | "jsx-single" | "jsx-double" | "avoid-escape" | "avoid-template")[]];
|
|
9063
9025
|
/**
|
|
9064
9026
|
* Requires the radix parameter to be specified when calling `parseInt`.
|
|
9065
9027
|
*/
|
|
9066
|
-
radix?: (
|
|
9028
|
+
radix?: (Rule & []) | [boolean];
|
|
9067
9029
|
/**
|
|
9068
9030
|
* When adding two variables, operands must both be of type number or of type string.
|
|
9069
9031
|
*/
|
|
9070
|
-
"restrict-plus-operands"?: (
|
|
9032
|
+
"restrict-plus-operands"?: (Rule & []) | [boolean];
|
|
9071
9033
|
/**
|
|
9072
9034
|
* Prefer `return;` in void functions and `return undefined;` in value-returning functions.
|
|
9073
9035
|
*/
|
|
9074
|
-
"return-undefined"?: (
|
|
9036
|
+
"return-undefined"?: (Rule & []) | [boolean];
|
|
9075
9037
|
/**
|
|
9076
9038
|
* Enforces consistent semicolon usage at the end of every statement.
|
|
9077
9039
|
*/
|
|
9078
9040
|
semicolon?:
|
|
9079
|
-
| (
|
|
9041
|
+
| (Rule & [])
|
|
9080
9042
|
| [boolean]
|
|
9081
9043
|
| [boolean, "always" | "never"]
|
|
9082
9044
|
| [boolean, "always" | "never", "ignore-interfaces" | "ignore-bound-class-methods" | "strict-bound-class-methods"];
|
|
9083
9045
|
/**
|
|
9084
9046
|
* Require or disallow a space before function parenthesis
|
|
9085
9047
|
*/
|
|
9086
|
-
"space-before-function-paren"?: (
|
|
9048
|
+
"space-before-function-paren"?: (Rule & []) | [boolean, ...Items8[]];
|
|
9087
9049
|
/**
|
|
9088
9050
|
* Enforces spaces within parentheses or disallow them.
|
|
9089
9051
|
*/
|
|
9090
|
-
"space-within-parens"?: (
|
|
9052
|
+
"space-within-parens"?: (Rule & []) | [boolean, ...number[]];
|
|
9091
9053
|
/**
|
|
9092
9054
|
* Require a `default` case in all `switch` statements.
|
|
9093
9055
|
*/
|
|
9094
|
-
"switch-default"?: (
|
|
9056
|
+
"switch-default"?: (Rule & []) | [boolean];
|
|
9095
9057
|
/**
|
|
9096
9058
|
* Checks whether the final clause of a switch statement ends in `break;`.
|
|
9097
9059
|
*/
|
|
9098
|
-
"switch-final-break"?: (
|
|
9060
|
+
"switch-final-break"?: (Rule & []) | [boolean, ..."always"[]];
|
|
9099
9061
|
/**
|
|
9100
9062
|
* Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and function parameters.
|
|
9101
9063
|
*/
|
|
9102
|
-
"trailing-comma"?: (
|
|
9064
|
+
"trailing-comma"?: (Rule & []) | [boolean, ...Items9[]];
|
|
9103
9065
|
/**
|
|
9104
9066
|
* Requires `===` and `!==` in place of `==` and `!=`.
|
|
9105
9067
|
*/
|
|
9106
|
-
"triple-equals"?: (
|
|
9068
|
+
"triple-equals"?: (Rule & []) | [boolean, ...("allow-null-check" | "allow-undefined-check")[]];
|
|
9107
9069
|
/**
|
|
9108
9070
|
* Makes sure result of `typeof` is compared to correct string values
|
|
9109
9071
|
*/
|
|
9110
|
-
"typeof-compare"?: (
|
|
9072
|
+
"typeof-compare"?: (Rule & []) | [boolean];
|
|
9111
9073
|
/**
|
|
9112
9074
|
* Enforces use of the `isNaN()` function to check for NaN references instead of a comparison to the `NaN` constant.
|
|
9113
9075
|
*/
|
|
9114
|
-
"use-isnan"?: (
|
|
9076
|
+
"use-isnan"?: (Rule & []) | [boolean];
|
|
9115
9077
|
/**
|
|
9116
9078
|
* Checks variable names for various errors.
|
|
9117
9079
|
*/
|
|
9118
9080
|
"variable-name"?:
|
|
9119
|
-
| (
|
|
9081
|
+
| (Rule & [])
|
|
9120
9082
|
| [
|
|
9121
9083
|
boolean,
|
|
9122
9084
|
...(
|
|
@@ -9133,7 +9095,7 @@ export interface Rules1 {
|
|
|
9133
9095
|
* Enforces whitespace style conventions.
|
|
9134
9096
|
*/
|
|
9135
9097
|
whitespace?:
|
|
9136
|
-
| (
|
|
9098
|
+
| (Rule & [])
|
|
9137
9099
|
| [
|
|
9138
9100
|
boolean,
|
|
9139
9101
|
...(
|