xo 0.49.0 → 0.52.0
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/cli.js +1 -1
- package/config/plugins.cjs +24 -24
- package/index.js +7 -2
- package/lib/constants.js +6 -6
- package/lib/options-manager.js +92 -9
- package/lib/report.js +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/README.md +2 -149
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/eslint-recommended.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js +2 -6
- package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +22 -9
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +70 -63
- 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/ban-tslint-comment.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-tslint-comment.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-types.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js +11 -11
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js +100 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js +2 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-definitions.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-exports.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js +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/index.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js +18 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.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/method-signature-style.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/method-signature-style.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js +2 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-confusing-void-expression.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-duplicate-imports.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-imports.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.js +11 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-function.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 +3 -2
- 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 +5 -1
- 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 +9 -4
- 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-inferrable-types.js +10 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.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-misused-promises.js +29 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +3 -1
- 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-nullish-coalescing.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js +1 -2
- 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 +1 -2
- 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-require-imports.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js +38 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.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 +10 -1
- 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 +3 -1
- 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 +3 -1
- 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-qualifier.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +2 -1
- 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 +4 -2
- 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 +8 -8
- 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-unsafe-assignment.js +8 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js +4 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js +4 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.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/no-var-requires.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js +1 -2
- 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 +6 -6
- 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 +32 -24
- 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 +6 -2
- 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 +1 -2
- 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-for-of.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +134 -5
- 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/prefer-readonly-parameter-types.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js +8 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +3 -1
- 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 +2 -1
- 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 +3 -1
- 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 +21 -6
- 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 +2 -2
- 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 +4 -1
- 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/space-before-blocks.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-blocks.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-before-function-paren.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops.js +22 -26
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js +1 -2
- 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/triple-slash-reference.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js +24 -20
- 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 +2 -1
- 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 +2 -1
- 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/dist/util/misc.js +36 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +4 -141
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +3 -38
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +6 -33
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +30 -33
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +77 -101
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +6 -30
- 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 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +10 -36
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +73 -0
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +19 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +9 -34
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +15 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +9 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +9 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +8 -32
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +10 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +9 -43
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +9 -40
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +12 -57
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +11 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +8 -32
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +6 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +34 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +6 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +8 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +6 -50
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +10 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +9 -33
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +20 -34
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +252 -50
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +6 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +13 -28
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +6 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +11 -39
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +6 -34
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +6 -32
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +7 -11
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +62 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +10 -25
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +11 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +6 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +24 -50
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +25 -37
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +22 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +6 -34
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +8 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +6 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +7 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +10 -39
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +6 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +48 -10
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +18 -25
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +8 -25
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +6 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +6 -44
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +6 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +6 -28
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +6 -36
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +6 -35
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +6 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +6 -53
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +10 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +6 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +7 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +6 -34
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +9 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +8 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +12 -40
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -35
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +11 -29
- package/node_modules/@typescript-eslint/eslint-plugin/package.json +7 -7
- package/node_modules/@typescript-eslint/parser/README.md +15 -11
- package/node_modules/@typescript-eslint/parser/dist/parser.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/parser/dist/parser.js +1 -8
- package/node_modules/@typescript-eslint/parser/dist/parser.js.map +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +8 -7
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts +9 -9
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js +44 -4
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js +2 -11
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js +3 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts +3 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js +11 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js.map +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js +2 -11
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js +13 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js.map +1 -1
- 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 +12 -4
- 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/referencer/TypeVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js +13 -7
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.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 +6 -6
- package/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js +27 -27
- package/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js.map +1 -1
- package/node_modules/@typescript-eslint/type-utils/package.json +6 -6
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +412 -68
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js +1 -0
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/lib.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +5 -4
- package/node_modules/@typescript-eslint/typescript-estree/README.md +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +34 -13
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js +2 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js +34 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts +5 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js +72 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js.map +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts +1 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js +8 -23
- package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.js +1 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/index.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts +3 -0
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js +21 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js +6 -3
- package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts +3 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/package.json +8 -7
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +2 -2
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts +7 -7
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts +6 -2
- package/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts.map +1 -1
- 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/applyDefault.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js +2 -0
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.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/CLIEngine.d.ts +3 -3
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/CLIEngine.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts +2 -2
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts.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/dist/ts-eslint/SourceCode.d.ts +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/Definition.d.ts +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/Definition.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/Reference.d.ts +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/Reference.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/analyze.d.ts +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint-scope/analyze.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/package.json +7 -7
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +2 -1
- package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -1
- package/node_modules/@typescript-eslint/visitor-keys/package.json +6 -5
- 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 +13 -13
- package/readme.md +1 -1
|
@@ -1,15 +1,26 @@
|
|
|
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
|
-
This rule warns when a class
|
|
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
|
|
|
7
11
|
## Rule Details
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Users who come from a [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) paradigm may wrap their utility functions in an extra class, instead of putting them at the top level of an ECMAScript module.
|
|
14
|
+
Doing so is generally unnecessary in JavaScript and TypeScript projects.
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
- Wrapper classes add extra cognitive complexity to code without adding any structural improvements
|
|
17
|
+
- Whatever would be put on them, such as utility functions, are already organized by virtue of being in a module.
|
|
18
|
+
- As an alternative, you can always `import * as ...` the module to get all of them in a single object.
|
|
19
|
+
- IDEs can't provide as good suggestions for static class or namespace imported properties when you start typing property names
|
|
20
|
+
- It's more difficult to statically analyze code for unused variables, etc. when they're all on the class (see: [Finding dead code (and dead types) in TypeScript](https://effectivetypescript.com/2020/10/20/tsprune)).
|
|
21
|
+
|
|
22
|
+
This rule also flags classes that have only a constructor and no fields.
|
|
23
|
+
Those classes can generally be replaced with a standalone function.
|
|
13
24
|
|
|
14
25
|
Examples of code for this rule:
|
|
15
26
|
|
|
@@ -18,18 +29,16 @@ Examples of code for this rule:
|
|
|
18
29
|
### ❌ Incorrect
|
|
19
30
|
|
|
20
31
|
```ts
|
|
21
|
-
class
|
|
32
|
+
class StaticConstants {
|
|
33
|
+
static readonly version = 42;
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
foo();
|
|
35
|
+
static isProduction() {
|
|
36
|
+
return process.env.NODE_ENV === 'production';
|
|
26
37
|
}
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
static version = 42;
|
|
32
|
-
static hello() {
|
|
40
|
+
class HelloWorldLogger {
|
|
41
|
+
constructor() {
|
|
33
42
|
console.log('Hello, world!');
|
|
34
43
|
}
|
|
35
44
|
}
|
|
@@ -38,57 +47,250 @@ class StaticOnly {
|
|
|
38
47
|
### ✅ Correct
|
|
39
48
|
|
|
40
49
|
```ts
|
|
41
|
-
|
|
50
|
+
export const version = 42;
|
|
51
|
+
|
|
52
|
+
export function isProduction() {
|
|
53
|
+
return process.env.NODE_ENV === 'production';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function logHelloWorld() {
|
|
57
|
+
console.log('Hello, world!');
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Alternatives
|
|
62
|
+
|
|
63
|
+
### Individual Exports (Recommended)
|
|
64
|
+
|
|
65
|
+
Instead of using a static utility class we recommend you individually export the utilities from your module.
|
|
66
|
+
|
|
67
|
+
<!--tabs-->
|
|
68
|
+
|
|
69
|
+
#### ❌ Incorrect
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
export class Utilities {
|
|
73
|
+
static util1() {
|
|
74
|
+
return Utilities.util3();
|
|
75
|
+
}
|
|
42
76
|
|
|
43
|
-
|
|
44
|
-
|
|
77
|
+
static util2() {
|
|
78
|
+
/* ... */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static util3() {
|
|
82
|
+
/* ... */
|
|
83
|
+
}
|
|
45
84
|
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### ✅ Correct
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
export function util1() {
|
|
91
|
+
return util3();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function util2() {
|
|
95
|
+
/* ... */
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function util3() {
|
|
99
|
+
/* ... */
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Namespace Imports (Not Recommended)
|
|
104
|
+
|
|
105
|
+
If you strongly prefer to have all constructs from a module available as properties of a single object, you can `import * as` the module.
|
|
106
|
+
This is known as a "namespace import".
|
|
107
|
+
Namespace imports are sometimes preferable because they keep all properties nested and don't need to be changed as you start or stop using various properties from the module.
|
|
46
108
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
109
|
+
However, namespace imports are impacted by these downsides:
|
|
110
|
+
|
|
111
|
+
- They also don't play as well with tree shaking in modern bundlers
|
|
112
|
+
- They require a name prefix before each property's usage
|
|
113
|
+
|
|
114
|
+
<!--tabs-->
|
|
115
|
+
|
|
116
|
+
#### ❌ Incorrect
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
// utilities.ts
|
|
120
|
+
export class Utilities {
|
|
121
|
+
static sayHello() {
|
|
50
122
|
console.log('Hello, world!');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// consumers.ts
|
|
127
|
+
import { Utilities } from './utilities';
|
|
128
|
+
|
|
129
|
+
Utilities.sayHello();
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### ⚠️ Namespace Imports
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
// utilities.ts
|
|
136
|
+
export function sayHello() {
|
|
137
|
+
console.log('Hello, world!');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// consumers.ts
|
|
141
|
+
import * as utilities from './utilities';
|
|
142
|
+
|
|
143
|
+
utilities.sayHello();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### ✅ Standalone Imports
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
// utilities.ts
|
|
150
|
+
export function sayHello() {
|
|
151
|
+
console.log('Hello, world!');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// consumers.ts
|
|
155
|
+
import { sayHello } from './utilities';
|
|
156
|
+
|
|
157
|
+
sayHello();
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Notes on Mutating Variables
|
|
161
|
+
|
|
162
|
+
One case you need to be careful of is exporting mutable variables.
|
|
163
|
+
While class properties can be mutated externally, exported variables are always constant.
|
|
164
|
+
This means that importers can only ever read the first value they are assigned and cannot write to the variables.
|
|
165
|
+
|
|
166
|
+
Needing to write to an exported variable is very rare and is generally considered a code smell.
|
|
167
|
+
If you do need it you can accomplish it using getter and setter functions:
|
|
168
|
+
|
|
169
|
+
<!--tabs-->
|
|
170
|
+
|
|
171
|
+
#### ❌ Incorrect
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
export class Utilities {
|
|
175
|
+
static mutableCount = 1;
|
|
176
|
+
|
|
177
|
+
static incrementCount() {
|
|
178
|
+
Utilities.mutableCount += 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### ✅ Correct
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
let mutableCount = 1;
|
|
187
|
+
|
|
188
|
+
export function getMutableCount() {
|
|
189
|
+
return mutableField;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function incrementCount() {
|
|
193
|
+
mutableField += 1;
|
|
194
|
+
}
|
|
53
195
|
```
|
|
54
196
|
|
|
55
197
|
## Options
|
|
56
198
|
|
|
57
|
-
This rule
|
|
199
|
+
This rule normally bans classes that are empty (have no constructor or fields).
|
|
200
|
+
The rule's options each add an exemption for a specific type of class.
|
|
201
|
+
|
|
202
|
+
### `allowConstructorOnly`
|
|
203
|
+
|
|
204
|
+
`allowConstructorOnly` adds an exemption for classes that have only a constructor and no fields.
|
|
205
|
+
|
|
206
|
+
<!--tabs-->
|
|
207
|
+
|
|
208
|
+
#### ❌ Incorrect
|
|
58
209
|
|
|
59
210
|
```ts
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
allowConstructorOnly?: boolean;
|
|
63
|
-
// allow extraneous classes if they have no body (i.e. are empty)
|
|
64
|
-
allowEmpty?: boolean;
|
|
65
|
-
// allow extraneous classes if they only contain static members
|
|
66
|
-
allowStaticOnly?: boolean;
|
|
67
|
-
// allow extraneous classes if they have a decorator
|
|
68
|
-
allowWithDecorator?: boolean;
|
|
69
|
-
};
|
|
211
|
+
class NoFields {}
|
|
212
|
+
```
|
|
70
213
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
214
|
+
#### ✅ Correct
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
class NoFields {
|
|
218
|
+
constructor() {
|
|
219
|
+
console.log('Hello, world!');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
77
222
|
```
|
|
78
223
|
|
|
79
|
-
|
|
224
|
+
### `allowEmpty`
|
|
80
225
|
|
|
81
|
-
|
|
82
|
-
team or if you use classes as namespaces.
|
|
226
|
+
The `allowEmpty` option adds an exemption for classes that are entirely empty.
|
|
83
227
|
|
|
84
|
-
|
|
228
|
+
<!--tabs-->
|
|
85
229
|
|
|
86
|
-
|
|
230
|
+
#### ❌ Incorrect
|
|
87
231
|
|
|
88
|
-
|
|
232
|
+
```ts
|
|
233
|
+
class NoFields {
|
|
234
|
+
constructor() {
|
|
235
|
+
console.log('Hello, world!');
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### ✅ Correct
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
class NoFields {}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### `allowStaticOnly`
|
|
247
|
+
|
|
248
|
+
The `allowStaticOnly` option adds an exemption for classes that only contain static members.
|
|
249
|
+
|
|
250
|
+
:::caution
|
|
251
|
+
We strongly recommend against the `allowStaticOnly` exemption.
|
|
252
|
+
It works against this rule's primary purpose of discouraging classes used only for static members.
|
|
253
|
+
:::
|
|
254
|
+
|
|
255
|
+
<!--tabs-->
|
|
256
|
+
|
|
257
|
+
#### ❌ Incorrect
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
class EmptyClass {}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
#### ✅ Correct
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
class NotEmptyClass {
|
|
267
|
+
static version = 42;
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### `allowWithDecorator`
|
|
272
|
+
|
|
273
|
+
The `allowWithDecorator` option adds an exemption for classes that contain a member decorated with a `@` decorator.
|
|
274
|
+
|
|
275
|
+
<!--tabs-->
|
|
276
|
+
|
|
277
|
+
#### ❌ Incorrect
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
class Constants {
|
|
281
|
+
static readonly version = 42;
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### ✅ Correct
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
class Constants {
|
|
289
|
+
@logOnRead()
|
|
290
|
+
static readonly version = 42;
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## When Not To Use It
|
|
89
295
|
|
|
90
|
-
-
|
|
91
|
-
- [ ] ✅ Recommended
|
|
92
|
-
- [x] 🔒 Strict
|
|
93
|
-
- [ ] 🔧 Fixable
|
|
94
|
-
- [ ] 💭 Requires type information
|
|
296
|
+
You can disable this rule if you are unable -or unwilling- to switch off using classes as namespaces.
|
|
@@ -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.
|
|
@@ -118,12 +106,3 @@ If you do not use Promise-like values in your codebase, or want to allow them to
|
|
|
118
106
|
## Related To
|
|
119
107
|
|
|
120
108
|
- [`no-misused-promises`](./no-misused-promises.md)
|
|
121
|
-
- TSLint: ['no-floating-promises'](https://palantir.github.io/tslint/rules/no-floating-promises/)
|
|
122
|
-
|
|
123
|
-
## Attributes
|
|
124
|
-
|
|
125
|
-
- Configs:
|
|
126
|
-
- [x] ✅ Recommended
|
|
127
|
-
- [x] 🔒 Strict
|
|
128
|
-
- [ ] 🔧 Fixable
|
|
129
|
-
- [x] 💭 Requires type information
|
|
@@ -1,13 +1,15 @@
|
|
|
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
|
|
|
7
11
|
## Rule Details
|
|
8
12
|
|
|
9
|
-
Rationale from TSLint:
|
|
10
|
-
|
|
11
13
|
A for-in loop (`for (var k in o)`) iterates over the properties of an Object.
|
|
12
14
|
While it is legal to use for-in loops with array types, it is not common.
|
|
13
15
|
for-in will iterate over the indices of the array as strings, omitting any "holes" in
|
|
@@ -41,31 +43,6 @@ for (const x in { a: 3, b: 4, c: 5 }) {
|
|
|
41
43
|
}
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
## Options
|
|
45
|
-
|
|
46
|
-
```jsonc
|
|
47
|
-
// .eslintrc.json
|
|
48
|
-
{
|
|
49
|
-
"rules": {
|
|
50
|
-
"@typescript-eslint/no-for-in-array": "error"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
This rule is not configurable.
|
|
56
|
-
|
|
57
46
|
## When Not To Use It
|
|
58
47
|
|
|
59
48
|
If you want to iterate through a loop using the indices in an array as strings, you can turn off this rule.
|
|
60
|
-
|
|
61
|
-
## Related To
|
|
62
|
-
|
|
63
|
-
- TSLint: ['no-for-in-array'](https://palantir.github.io/tslint/rules/no-for-in-array/)
|
|
64
|
-
|
|
65
|
-
## Attributes
|
|
66
|
-
|
|
67
|
-
- Configs:
|
|
68
|
-
- [x] ✅ Recommended
|
|
69
|
-
- [x] 🔒 Strict
|
|
70
|
-
- [ ] 🔧 Fixable
|
|
71
|
-
- [x] 💭 Requires type information
|
|
@@ -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
|
|
|
@@ -8,6 +17,8 @@ By default, TypeScript will type a catch clause variable as `any`, so explicitly
|
|
|
8
17
|
|
|
9
18
|
The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons, however you can use `useUnknownInCatchVariables` (part of `strict`) instead of this rule.
|
|
10
19
|
|
|
20
|
+
## DEPRECATED
|
|
21
|
+
|
|
11
22
|
## Rule Details
|
|
12
23
|
|
|
13
24
|
This rule requires an explicit type to be declared on a catch clause variable.
|
|
@@ -43,26 +54,10 @@ try {
|
|
|
43
54
|
|
|
44
55
|
## Options
|
|
45
56
|
|
|
46
|
-
The rule accepts an options object with the following properties:
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
type Options = {
|
|
50
|
-
// if false, disallow specifying `: any` as the error type as well. See also `no-explicit-any`
|
|
51
|
-
allowExplicitAny: boolean;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const defaults = {
|
|
55
|
-
allowExplicitAny: false,
|
|
56
|
-
};
|
|
57
|
-
```
|
|
58
|
-
|
|
59
57
|
### `allowExplicitAny`
|
|
60
58
|
|
|
61
59
|
The follow is is **_not_** considered a warning with `{ allowExplicitAny: true }`
|
|
62
60
|
|
|
63
|
-
<!-- TODO: prettier currently removes the type annotations, re-enable this once prettier is updated -->
|
|
64
|
-
<!-- prettier-ignore-start -->
|
|
65
|
-
|
|
66
61
|
```ts
|
|
67
62
|
try {
|
|
68
63
|
// ...
|
|
@@ -71,8 +66,6 @@ try {
|
|
|
71
66
|
}
|
|
72
67
|
```
|
|
73
68
|
|
|
74
|
-
<!-- prettier-ignore-end -->
|
|
75
|
-
|
|
76
69
|
## When Not To Use It
|
|
77
70
|
|
|
78
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.
|
|
@@ -80,11 +73,3 @@ If you are not using TypeScript 4.0 (or greater), then you will not be able to u
|
|
|
80
73
|
## Further Reading
|
|
81
74
|
|
|
82
75
|
- [TypeScript 4.0 Release Notes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#unknown-on-catch)
|
|
83
|
-
|
|
84
|
-
## Attributes
|
|
85
|
-
|
|
86
|
-
- Configs:
|
|
87
|
-
- [ ] ✅ Recommended
|
|
88
|
-
- [ ] 🔒 Strict
|
|
89
|
-
- [x] 🔧 Fixable
|
|
90
|
-
- [ ] 💭 Requires type information
|
|
@@ -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,30 +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>
|
|
116
|
-
|
|
117
|
-
## Attributes
|
|
118
|
-
|
|
119
|
-
- Configs:
|
|
120
|
-
- [x] ✅ Recommended
|
|
121
|
-
- [x] 🔒 Strict
|
|
122
|
-
- [ ] 🔧 Fixable
|
|
123
|
-
- [x] 💭 Requires type information
|
|
@@ -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:
|
|
@@ -148,15 +132,3 @@ If you do not want to enforce inferred types.
|
|
|
148
132
|
## Further Reading
|
|
149
133
|
|
|
150
134
|
TypeScript [Inference](https://www.typescriptlang.org/docs/handbook/type-inference.html)
|
|
151
|
-
|
|
152
|
-
## Related To
|
|
153
|
-
|
|
154
|
-
TSLint: [no-inferrable-types](https://palantir.github.io/tslint/rules/no-inferrable-types/)
|
|
155
|
-
|
|
156
|
-
## Attributes
|
|
157
|
-
|
|
158
|
-
- Configs:
|
|
159
|
-
- [x] ✅ Recommended
|
|
160
|
-
- [x] 🔒 Strict
|
|
161
|
-
- [x] 🔧 Fixable
|
|
162
|
-
- [ ] 💭 Requires type information
|
|
@@ -1,40 +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>
|
|
33
|
-
|
|
34
|
-
## Attributes
|
|
35
|
-
|
|
36
|
-
- Configs:
|
|
37
|
-
- [ ] ✅ Recommended
|
|
38
|
-
- [ ] 🔒 Strict
|
|
39
|
-
- [ ] 🔧 Fixable
|
|
40
|
-
- [ ] 💭 Requires type information
|