xo 0.51.0 → 0.52.2
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/lib/options-manager.js +104 -8
- package/node_modules/@typescript-eslint/eslint-plugin/README.md +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +21 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +37 -31
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js +10 -10
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js +17 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js +14 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js +133 -43
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js +12 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +9 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js +2 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +8 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js +4 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js +8 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js +8 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js +42 -12
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js +6 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js +1 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js +5 -5
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js +31 -23
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js +5 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +133 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +166 -86
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js +20 -5
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +3 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +3 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js +27 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js +9 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js +9 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +3 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +6 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +8 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +74 -95
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +9 -5
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +9 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +11 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +19 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +9 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +15 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +9 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +9 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +8 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +10 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +7 -33
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +7 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +7 -43
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +11 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +8 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +34 -9
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +7 -11
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +6 -38
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +10 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +8 -28
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +6 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +11 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +11 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +6 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +10 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +11 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +6 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +25 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +6 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +8 -4
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +10 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +48 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +16 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +6 -4
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +6 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +6 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +6 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +6 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +6 -45
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +10 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +6 -25
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +9 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +8 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +11 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +12 -18
- package/node_modules/@typescript-eslint/eslint-plugin/package.json +5 -5
- package/node_modules/@typescript-eslint/parser/README.md +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +5 -5
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +6 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
- package/node_modules/@typescript-eslint/type-utils/package.json +4 -4
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +1 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js +2 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js +3 -4
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts +4 -0
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/package.json +5 -5
- package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
- package/node_modules/eslint-config-xo-typescript/index.js +27 -11
- package/node_modules/eslint-config-xo-typescript/package.json +5 -4
- package/package.json +10 -10
- package/node_modules/@typescript-eslint/parser/_ts3.4/dist/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/parser/_ts3.4/dist/parser.d.ts +0 -20
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/containsAllTypesByName.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getConstrainedTypeAtLocation.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getContextualType.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getDeclaration.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getSourceFileOfNode.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTokenAtPosition.d.ts +0 -3
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeArguments.d.ts +0 -3
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeName.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/index.d.ts +0 -15
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isTypeReadonly.d.ts +0 -20
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isUnsafeAssignment.d.ts +0 -17
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/predicates.d.ts +0 -52
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/propertyTypes.d.ts +0 -4
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/requiresQuoting.d.ts +0 -4
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/typeFlagUtils.d.ts +0 -11
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +0 -1732
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/index.d.ts +0 -5
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +0 -3
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +0 -35
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/ts-estree.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ast-converter.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert-comments.d.ts +0 -11
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert.d.ts +0 -157
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createDefaultProgram.d.ts +0 -12
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createIsolatedProgram.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createProjectProgram.d.ts +0 -11
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createSourceFile.d.ts +0 -5
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createWatchProgram.d.ts +0 -19
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/getScriptKind.d.ts +0 -5
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +0 -22
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/useProvidedPrograms.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/index.d.ts +0 -10
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/jsx/xhtml-entities.d.ts +0 -2
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/node-utils.d.ts +0 -230
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +0 -188
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +0 -25
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/semantic-or-syntactic-errors.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +0 -175
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +0 -18
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/version-check.d.ts +0 -3
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts +0 -6
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/helpers.d.ts +0 -47
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/index.d.ts +0 -5
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/misc.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/predicates.d.ts +0 -180
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts +0 -35
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +0 -18
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts +0 -10
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts +0 -17
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +0 -9
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/nullThrows.d.ts +0 -14
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/index.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/json-schema.d.ts +0 -2
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/AST.d.ts +0 -9
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts +0 -137
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ESLint.d.ts +0 -376
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Linter.d.ts +0 -326
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts +0 -2
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Rule.d.ts +0 -389
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +0 -154
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Scope.d.ts +0 -44
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts +0 -342
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/index.d.ts +0 -10
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts +0 -19
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts +0 -15
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts +0 -28
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts +0 -55
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts +0 -103
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts +0 -17
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts +0 -16
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/index.d.ts +0 -11
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-estree.d.ts +0 -3
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/get-keys.d.ts +0 -4
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/index.d.ts +0 -3
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/visitor-keys.d.ts +0 -6
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow extra non-null assertion.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-extra-non-null-assertion** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -45,16 +49,3 @@ function foo(bar?: { n: number }) {
|
|
|
45
49
|
return bar?.n;
|
|
46
50
|
}
|
|
47
51
|
```
|
|
48
|
-
|
|
49
|
-
## Options
|
|
50
|
-
|
|
51
|
-
```jsonc
|
|
52
|
-
// .eslintrc.json
|
|
53
|
-
{
|
|
54
|
-
"rules": {
|
|
55
|
-
"@typescript-eslint/no-extra-non-null-assertion": "error"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
This rule is not configurable.
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow unnecessary parentheses.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-extra-parens** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule.
|
|
8
12
|
It adds support for TypeScript type assertions.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"no-extra-parens": "off",
|
|
16
|
-
"@typescript-eslint/no-extra-parens": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/no-extra-parens` options](https://eslint.org/docs/rules/no-extra-parens#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-extra-parens.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow unnecessary semicolons.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-extra-semi** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/no-extra-semi`](https://eslint.org/docs/rules/no-extra-semi) rule.
|
|
8
12
|
It adds support for class properties.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"no-extra-semi": "off",
|
|
16
|
-
"@typescript-eslint/no-extra-semi": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/no-extra-semi` options](https://eslint.org/docs/rules/no-extra-semi#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-extra-semi.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow classes used as namespaces.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-extraneous-class** for documentation.
|
|
4
8
|
|
|
5
9
|
This rule warns when a class has no non-static members, such as for a class used exclusively as a static namespace.
|
|
6
10
|
|
|
@@ -192,28 +196,6 @@ export function incrementCount() {
|
|
|
192
196
|
|
|
193
197
|
## Options
|
|
194
198
|
|
|
195
|
-
This rule accepts a single object option.
|
|
196
|
-
|
|
197
|
-
```ts
|
|
198
|
-
type Options = {
|
|
199
|
-
// allow extraneous classes if they only contain a constructor
|
|
200
|
-
allowConstructorOnly?: boolean;
|
|
201
|
-
// allow extraneous classes if they have no body (i.e. are empty)
|
|
202
|
-
allowEmpty?: boolean;
|
|
203
|
-
// allow extraneous classes if they only contain static members
|
|
204
|
-
allowStaticOnly?: boolean;
|
|
205
|
-
// allow extraneous classes if they have a decorator
|
|
206
|
-
allowWithDecorator?: boolean;
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const defaultOptions: Options = {
|
|
210
|
-
allowConstructorOnly: false,
|
|
211
|
-
allowEmpty: false,
|
|
212
|
-
allowStaticOnly: false,
|
|
213
|
-
allowWithDecorator: false,
|
|
214
|
-
};
|
|
215
|
-
```
|
|
216
|
-
|
|
217
199
|
This rule normally bans classes that are empty (have no constructor or fields).
|
|
218
200
|
The rule's options each add an exemption for a specific type of class.
|
|
219
201
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require Promise-like statements to be handled appropriately.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-floating-promises** for documentation.
|
|
4
8
|
|
|
5
9
|
A "floating" Promise is one that is created without any code set up to handle any errors it might throw.
|
|
6
10
|
|
|
@@ -61,22 +65,6 @@ Promise.reject('value').finally(() => {});
|
|
|
61
65
|
|
|
62
66
|
## Options
|
|
63
67
|
|
|
64
|
-
The rule accepts an options object with the following properties:
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
type Options = {
|
|
68
|
-
// if true, checking void expressions will be skipped
|
|
69
|
-
ignoreVoid?: boolean;
|
|
70
|
-
// if true, checking for async iife will be skipped
|
|
71
|
-
ignoreIIFE?: boolean;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const defaults = {
|
|
75
|
-
ignoreVoid: true,
|
|
76
|
-
ignoreIIFE: false,
|
|
77
|
-
};
|
|
78
|
-
```
|
|
79
|
-
|
|
80
68
|
### `ignoreVoid`
|
|
81
69
|
|
|
82
70
|
This allows you to stop the rule reporting promises consumed with void operator.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow iterating over an array with a for-in loop.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-for-in-array** for documentation.
|
|
4
8
|
|
|
5
9
|
This rule prohibits iterating over an array with a for-in loop.
|
|
6
10
|
|
|
@@ -39,19 +43,6 @@ for (const x in { a: 3, b: 4, c: 5 }) {
|
|
|
39
43
|
}
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
## Options
|
|
43
|
-
|
|
44
|
-
```jsonc
|
|
45
|
-
// .eslintrc.json
|
|
46
|
-
{
|
|
47
|
-
"rules": {
|
|
48
|
-
"@typescript-eslint/no-for-in-array": "error"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
This rule is not configurable.
|
|
54
|
-
|
|
55
46
|
## When Not To Use It
|
|
56
47
|
|
|
57
48
|
If you want to iterate through a loop using the indices in an array as strings, you can turn off this rule.
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow usage of the implicit `any` type in catch clauses.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-implicit-any-catch** for documentation.
|
|
8
|
+
|
|
9
|
+
:::danger Deprecated
|
|
10
|
+
|
|
11
|
+
This rule has been deprecated as TypeScript versions >=4 includes a `useUnknownInCatchVariables` compiler option with the same check.
|
|
12
|
+
:::
|
|
4
13
|
|
|
5
14
|
TypeScript 4.0 added support for adding an explicit `any` or `unknown` type annotation on a catch clause variable.
|
|
6
15
|
|
|
@@ -45,26 +54,10 @@ try {
|
|
|
45
54
|
|
|
46
55
|
## Options
|
|
47
56
|
|
|
48
|
-
The rule accepts an options object with the following properties:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
type Options = {
|
|
52
|
-
// if false, disallow specifying `: any` as the error type as well. See also `no-explicit-any`
|
|
53
|
-
allowExplicitAny: boolean;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const defaults = {
|
|
57
|
-
allowExplicitAny: false,
|
|
58
|
-
};
|
|
59
|
-
```
|
|
60
|
-
|
|
61
57
|
### `allowExplicitAny`
|
|
62
58
|
|
|
63
59
|
The follow is is **_not_** considered a warning with `{ allowExplicitAny: true }`
|
|
64
60
|
|
|
65
|
-
<!-- TODO: prettier currently removes the type annotations, re-enable this once prettier is updated -->
|
|
66
|
-
<!-- prettier-ignore-start -->
|
|
67
|
-
|
|
68
61
|
```ts
|
|
69
62
|
try {
|
|
70
63
|
// ...
|
|
@@ -73,8 +66,6 @@ try {
|
|
|
73
66
|
}
|
|
74
67
|
```
|
|
75
68
|
|
|
76
|
-
<!-- prettier-ignore-end -->
|
|
77
|
-
|
|
78
69
|
## When Not To Use It
|
|
79
70
|
|
|
80
71
|
If you are not using TypeScript 4.0 (or greater), then you will not be able to use this rule, annotations on catch clauses is not supported.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow the use of `eval()`-like methods.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-implied-eval** for documentation.
|
|
4
8
|
|
|
5
9
|
It's considered a good practice to avoid using `eval()`. There are security and performance implications involved with doing so, which is why many linters recommend disallowing `eval()`. However, there are some other ways to pass a string and have it interpreted as JavaScript code that have similar concerns.
|
|
6
10
|
|
|
@@ -94,22 +98,6 @@ class Foo {
|
|
|
94
98
|
setTimeout(Foo.fn, 100);
|
|
95
99
|
```
|
|
96
100
|
|
|
97
|
-
## How to Use
|
|
98
|
-
|
|
99
|
-
```jsonc
|
|
100
|
-
{
|
|
101
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
102
|
-
"no-implied-eval": "off",
|
|
103
|
-
"@typescript-eslint/no-implied-eval": ["error"]
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
101
|
## When Not To Use It
|
|
108
102
|
|
|
109
103
|
If you want to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can safely disable this rule.
|
|
110
|
-
|
|
111
|
-
<sup>
|
|
112
|
-
|
|
113
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-implied-eval.md)
|
|
114
|
-
|
|
115
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-inferrable-types** for documentation.
|
|
4
8
|
|
|
5
9
|
Explicit types where they can be easily inferred may add unnecessary verbosity.
|
|
6
10
|
|
|
@@ -9,33 +13,11 @@ Explicit types where they can be easily inferred may add unnecessary verbosity.
|
|
|
9
13
|
This rule disallows explicit type declarations on parameters, variables
|
|
10
14
|
and properties where the type can be easily inferred from its value.
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
This rule accepts the following options:
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
interface Options {
|
|
18
|
-
ignoreParameters?: boolean;
|
|
19
|
-
ignoreProperties?: boolean;
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Default
|
|
24
|
-
|
|
25
|
-
The default options are:
|
|
26
|
-
|
|
27
|
-
```json
|
|
28
|
-
{
|
|
29
|
-
"ignoreParameters": false,
|
|
30
|
-
"ignoreProperties": false
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
With these options, the following patterns are:
|
|
16
|
+
Examples of code with the default options:
|
|
35
17
|
|
|
36
18
|
<!--tabs-->
|
|
37
19
|
|
|
38
|
-
|
|
20
|
+
### ❌ Incorrect
|
|
39
21
|
|
|
40
22
|
```ts
|
|
41
23
|
const a: bigint = 10n;
|
|
@@ -76,7 +58,7 @@ class Foo {
|
|
|
76
58
|
function fn(a: number = 5, b: boolean = true) {}
|
|
77
59
|
```
|
|
78
60
|
|
|
79
|
-
|
|
61
|
+
### ✅ Correct
|
|
80
62
|
|
|
81
63
|
```ts
|
|
82
64
|
const a = 10n;
|
|
@@ -121,6 +103,8 @@ function fn(a: number, b: boolean, c: string) {}
|
|
|
121
103
|
|
|
122
104
|
<!--/tabs-->
|
|
123
105
|
|
|
106
|
+
## Options
|
|
107
|
+
|
|
124
108
|
### `ignoreParameters`
|
|
125
109
|
|
|
126
110
|
When set to true, the following pattern is considered valid:
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow `this` keywords outside of classes or class-like objects.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-invalid-this** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) rule.
|
|
8
12
|
It adds support for TypeScript's `this` parameters.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"no-invalid-this": "off",
|
|
16
|
-
"@typescript-eslint/no-invalid-this": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/no-invalid-this` options](https://eslint.org/docs/rules/no-invalid-this#options).
|
|
23
|
-
|
|
24
|
-
## When Not To Use It
|
|
25
|
-
|
|
26
|
-
When you are indifferent as to how your variables are initialized.
|
|
27
|
-
|
|
28
|
-
<sup>
|
|
29
|
-
|
|
30
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-invalid-this.md)
|
|
31
|
-
|
|
32
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow `void` type outside of generic or return types.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-invalid-void-type** for documentation.
|
|
4
8
|
|
|
5
9
|
Disallows usage of `void` type outside of return types or generic type arguments.
|
|
6
10
|
If `void` is used as return type, it shouldn’t be a part of intersection/union type with most other types.
|
|
@@ -57,18 +61,6 @@ type stillVoid = void | never;
|
|
|
57
61
|
|
|
58
62
|
## Options
|
|
59
63
|
|
|
60
|
-
```ts
|
|
61
|
-
interface Options {
|
|
62
|
-
allowInGenericTypeArguments?: boolean | string[];
|
|
63
|
-
allowAsThisParameter?: boolean;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const defaultOptions: Options = {
|
|
67
|
-
allowInGenericTypeArguments: true,
|
|
68
|
-
allowAsThisParameter: false,
|
|
69
|
-
};
|
|
70
|
-
```
|
|
71
|
-
|
|
72
64
|
### `allowInGenericTypeArguments`
|
|
73
65
|
|
|
74
66
|
This option lets you control if `void` can be used as a valid value for generic type parameters.
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow function declarations that contain unsafe references inside loop statements.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-loop-func** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule.
|
|
8
12
|
It adds support for TypeScript types.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"no-loop-func": "off",
|
|
16
|
-
"@typescript-eslint/no-loop-func": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/no-loop-func` options](https://eslint.org/docs/rules/no-loop-func#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-loop-func.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow literal numbers that lose precision.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-loss-of-precision** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision) rule.
|
|
8
12
|
It adds support for [numeric separators](https://github.com/tc39/proposal-numeric-separator).
|
|
9
|
-
Note that this rule requires ESLint v7.
|
|
10
|
-
|
|
11
|
-
## How to Use
|
|
12
|
-
|
|
13
|
-
```jsonc
|
|
14
|
-
{
|
|
15
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
16
|
-
"no-loss-of-precision": "off",
|
|
17
|
-
"@typescript-eslint/no-loss-of-precision": ["error"]
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
<sup>
|
|
22
|
-
|
|
23
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-loss-of-precision.md)
|
|
24
|
-
|
|
25
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow magic numbers.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-magic-numbers** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -11,24 +15,8 @@ It adds support for:
|
|
|
11
15
|
- `enum` members (`enum Foo { bar = 1 }`),
|
|
12
16
|
- `readonly` class properties (`class Foo { readonly bar = 1 }`).
|
|
13
17
|
|
|
14
|
-
## How to Use
|
|
15
|
-
|
|
16
|
-
```jsonc
|
|
17
|
-
{
|
|
18
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
19
|
-
"no-magic-numbers": "off",
|
|
20
|
-
"@typescript-eslint/no-magic-numbers": [
|
|
21
|
-
"error",
|
|
22
|
-
{
|
|
23
|
-
/* options */
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
18
|
## Options
|
|
30
19
|
|
|
31
|
-
See [`eslint/no-magic-numbers` options](https://eslint.org/docs/rules/no-magic-numbers#options).
|
|
32
20
|
This rule adds the following options:
|
|
33
21
|
|
|
34
22
|
```ts
|
|
@@ -141,9 +129,3 @@ Examples of **correct** code for the `{ "ignoreTypeIndexes": true }` option:
|
|
|
141
129
|
type Foo = Bar[0];
|
|
142
130
|
type Baz = Parameters<Foo>[2];
|
|
143
131
|
```
|
|
144
|
-
|
|
145
|
-
<sup>
|
|
146
|
-
|
|
147
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-magic-numbers.md)
|
|
148
|
-
|
|
149
|
-
</sup>
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow the `void` operator except when used to discard a value.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-meaningless-void-operator** for documentation.
|
|
4
8
|
|
|
5
9
|
Disallows the `void` operator when its argument is already of type `void` or `undefined`.
|
|
6
10
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce valid definition of `new` and `constructor`.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-misused-new** for documentation.
|
|
4
8
|
|
|
5
9
|
Warns on apparent attempts to define constructors for interfaces or `new` for classes.
|
|
6
10
|
|
|
@@ -33,16 +37,3 @@ interface I {
|
|
|
33
37
|
new (): C;
|
|
34
38
|
}
|
|
35
39
|
```
|
|
36
|
-
|
|
37
|
-
## Options
|
|
38
|
-
|
|
39
|
-
```jsonc
|
|
40
|
-
// .eslintrc.json
|
|
41
|
-
{
|
|
42
|
-
"rules": {
|
|
43
|
-
"@typescript-eslint/no-misused-new": "error"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
This rule is not configurable.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow Promises in places not designed to handle them.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-misused-promises** for documentation.
|
|
4
8
|
|
|
5
9
|
This rule forbids providing Promises to logical locations such as if statements in places where the TypeScript compiler allows them but they are not handled properly.
|
|
6
10
|
These situations can often arise due to a missing `await` keyword or just a misunderstanding of the way async
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow custom TypeScript modules and namespaces.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/no-namespace** for documentation.
|
|
4
8
|
|
|
5
9
|
Custom TypeScript modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated
|
|
6
10
|
ways to organize TypeScript code. ES2015 module syntax is now preferred (`import`/`export`).
|
|
@@ -11,16 +15,7 @@ This rule still allows the use of TypeScript module declarations to describe ext
|
|
|
11
15
|
|
|
12
16
|
This rule aims to standardize the way modules are declared.
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
This rule, in its default state, does not require any argument. If you would like to enable one
|
|
17
|
-
or more of the following you may pass an object with the options set as follows:
|
|
18
|
-
|
|
19
|
-
- `allowDeclarations` set to `true` will allow you to `declare` custom TypeScript modules and namespaces (Default: `false`).
|
|
20
|
-
- `allowDefinitionFiles` set to `true` will allow you to `declare` and use custom TypeScript modules and namespaces
|
|
21
|
-
inside definition files (Default: `true`).
|
|
22
|
-
|
|
23
|
-
Examples of code for the default `{ "allowDeclarations": false, "allowDefinitionFiles": true }` options:
|
|
18
|
+
Examples of code with the default options:
|
|
24
19
|
|
|
25
20
|
<!--tabs-->
|
|
26
21
|
|
|
@@ -44,9 +39,11 @@ declare module 'foo' {}
|
|
|
44
39
|
|
|
45
40
|
<!--/tabs-->
|
|
46
41
|
|
|
42
|
+
## Options
|
|
43
|
+
|
|
47
44
|
### `allowDeclarations`
|
|
48
45
|
|
|
49
|
-
Examples of code
|
|
46
|
+
Examples of code with the `{ "allowDeclarations": true }` option:
|
|
50
47
|
|
|
51
48
|
<!--tabs-->
|
|
52
49
|
|