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/consistent-type-definitions.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce type definitions to consistently use either `interface` or `type`.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/consistent-type-definitions** for documentation.
|
|
4
8
|
|
|
5
9
|
There are two ways to define a type.
|
|
6
10
|
|
|
@@ -20,35 +24,26 @@ interface T2 {
|
|
|
20
24
|
|
|
21
25
|
## Options
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- `"interface"`: enforce using `interface`s for object type definitions.
|
|
27
|
+
- `"interface"` _(default)_: enforce using `interface`s for object type definitions.
|
|
26
28
|
- `"type"`: enforce using `type`s for object type definitions.
|
|
27
29
|
|
|
28
|
-
For example:
|
|
29
|
-
|
|
30
|
-
```jsonc
|
|
31
|
-
{
|
|
32
|
-
// Use type for object definitions
|
|
33
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
30
|
### `interface`
|
|
38
31
|
|
|
39
|
-
Examples of code with `interface` option.
|
|
40
|
-
|
|
41
32
|
<!--tabs-->
|
|
42
33
|
|
|
43
34
|
#### ❌ Incorrect
|
|
44
35
|
|
|
45
36
|
```ts
|
|
37
|
+
/* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */
|
|
38
|
+
|
|
46
39
|
type T = { x: number };
|
|
47
40
|
```
|
|
48
41
|
|
|
49
42
|
#### ✅ Correct
|
|
50
43
|
|
|
51
44
|
```ts
|
|
45
|
+
/* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */
|
|
46
|
+
|
|
52
47
|
type T = string;
|
|
53
48
|
type Foo = string | {};
|
|
54
49
|
|
|
@@ -59,13 +54,13 @@ interface T {
|
|
|
59
54
|
|
|
60
55
|
### `type`
|
|
61
56
|
|
|
62
|
-
Examples of code with `type` option.
|
|
63
|
-
|
|
64
57
|
<!--tabs-->
|
|
65
58
|
|
|
66
59
|
#### ❌ Incorrect
|
|
67
60
|
|
|
68
61
|
```ts
|
|
62
|
+
/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */
|
|
63
|
+
|
|
69
64
|
interface T {
|
|
70
65
|
x: number;
|
|
71
66
|
}
|
|
@@ -74,6 +69,8 @@ interface T {
|
|
|
74
69
|
#### ✅ Correct
|
|
75
70
|
|
|
76
71
|
```ts
|
|
72
|
+
/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */
|
|
73
|
+
|
|
77
74
|
type T = { x: number };
|
|
78
75
|
```
|
|
79
76
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce consistent usage of type exports.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/consistent-type-exports** for documentation.
|
|
6
8
|
|
|
7
9
|
Type-only exports allow you to specify that 1 or more named exports are exported as type-only. This allows
|
|
8
10
|
transpilers to drop exports without knowing the types of the dependencies.
|
|
9
11
|
|
|
10
12
|
## Rule Details
|
|
11
13
|
|
|
12
|
-
This rule aims to standardize the use of type exports style
|
|
14
|
+
This rule aims to standardize the use of type exports style.
|
|
13
15
|
|
|
14
16
|
Given a class `Button`, and an interface `ButtonProps`, examples of code:
|
|
15
17
|
|
|
@@ -21,11 +23,13 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code:
|
|
|
21
23
|
interface ButtonProps {
|
|
22
24
|
onClick: () => void;
|
|
23
25
|
}
|
|
26
|
+
|
|
24
27
|
class Button implements ButtonProps {
|
|
25
28
|
onClick() {
|
|
26
29
|
console.log('button!');
|
|
27
30
|
}
|
|
28
31
|
}
|
|
32
|
+
|
|
29
33
|
export { Button, ButtonProps };
|
|
30
34
|
```
|
|
31
35
|
|
|
@@ -46,16 +50,6 @@ export type { ButtonProps };
|
|
|
46
50
|
|
|
47
51
|
## Options
|
|
48
52
|
|
|
49
|
-
```ts
|
|
50
|
-
interface Options {
|
|
51
|
-
fixMixedExportsWithInlineTypeSpecifier?: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const defaultOptions: Options = {
|
|
55
|
-
fixMixedExportsWithInlineTypeSpecifier: false,
|
|
56
|
-
};
|
|
57
|
-
```
|
|
58
|
-
|
|
59
53
|
### `fixMixedExportsWithInlineTypeSpecifier`
|
|
60
54
|
|
|
61
55
|
When this is set to true, the rule will autofix "mixed" export cases using TS 4.5's "inline type specifier".
|
|
@@ -106,6 +100,5 @@ export { Button, type ButtonProps } from 'some-library';
|
|
|
106
100
|
|
|
107
101
|
## When Not To Use It
|
|
108
102
|
|
|
109
|
-
- If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported.
|
|
110
103
|
- If you specifically want to use both export kinds for stylistic reasons, you can disable this rule.
|
|
111
104
|
- If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule.
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce consistent usage of type imports.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/consistent-type-imports** for documentation.
|
|
4
8
|
|
|
5
|
-
TypeScript 3.8 added support for type-only imports.
|
|
6
9
|
Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers.
|
|
7
10
|
|
|
8
11
|
## Rule Details
|
|
9
12
|
|
|
10
|
-
This rule aims to standardize the use of type imports style
|
|
13
|
+
This rule aims to standardize the use of type imports style.
|
|
11
14
|
|
|
12
15
|
## Options
|
|
13
16
|
|
|
14
|
-
```ts
|
|
15
|
-
type Options = {
|
|
16
|
-
prefer: 'type-imports' | 'no-type-imports';
|
|
17
|
-
disallowTypeAnnotations: boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const defaultOptions: Options = {
|
|
21
|
-
prefer: 'type-imports',
|
|
22
|
-
disallowTypeAnnotations: true,
|
|
23
|
-
};
|
|
24
|
-
```
|
|
25
|
-
|
|
26
17
|
### `prefer`
|
|
27
18
|
|
|
28
19
|
This option defines the expected import kind for type-only imports. Valid values for `prefer` are:
|
|
@@ -50,10 +41,10 @@ const x: Bar = 1;
|
|
|
50
41
|
|
|
51
42
|
### `disallowTypeAnnotations`
|
|
52
43
|
|
|
53
|
-
If `true`, type imports in type annotations (`import()`)
|
|
44
|
+
If `true`, type imports in type annotations (`import()`) are not allowed.
|
|
54
45
|
Default is `true`.
|
|
55
46
|
|
|
56
|
-
Examples of **incorrect** code with `{disallowTypeAnnotations: true}
|
|
47
|
+
Examples of **incorrect** code with `{disallowTypeAnnotations: true}`:
|
|
57
48
|
|
|
58
49
|
```ts
|
|
59
50
|
type T = import('Foo').Foo;
|
|
@@ -62,5 +53,4 @@ const x: import('Bar') = 1;
|
|
|
62
53
|
|
|
63
54
|
## When Not To Use It
|
|
64
55
|
|
|
65
|
-
- If you are not using TypeScript 3.8 (or greater), then you will not be able to use this rule, as type-only imports are not allowed.
|
|
66
56
|
- If you specifically want to use both import kinds for stylistic reasons, you can disable this rule.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce default parameters to be last.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/default-param-last** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -12,7 +16,7 @@ It adds support for optional parameters.
|
|
|
12
16
|
### ❌ Incorrect
|
|
13
17
|
|
|
14
18
|
```ts
|
|
15
|
-
/* eslint @typescript-eslint/default-param-last:
|
|
19
|
+
/* eslint @typescript-eslint/default-param-last: "error" */
|
|
16
20
|
|
|
17
21
|
function f(a = 0, b: number) {}
|
|
18
22
|
function f(a: number, b = 0, c: number) {}
|
|
@@ -28,7 +32,7 @@ class Foo {
|
|
|
28
32
|
### ✅ Correct
|
|
29
33
|
|
|
30
34
|
```ts
|
|
31
|
-
/* eslint @typescript-eslint/default-param-last:
|
|
35
|
+
/* eslint @typescript-eslint/default-param-last: "error" */
|
|
32
36
|
|
|
33
37
|
function f(a = 0) {}
|
|
34
38
|
function f(a: number, b = 0) {}
|
|
@@ -42,23 +46,3 @@ class Foo {
|
|
|
42
46
|
constructor(public a, private b?: number) {}
|
|
43
47
|
}
|
|
44
48
|
```
|
|
45
|
-
|
|
46
|
-
## How to Use
|
|
47
|
-
|
|
48
|
-
```jsonc
|
|
49
|
-
{
|
|
50
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
51
|
-
"default-param-last": "off",
|
|
52
|
-
"@typescript-eslint/default-param-last": ["error"]
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Options
|
|
57
|
-
|
|
58
|
-
See [`eslint/default-param-last` options](https://eslint.org/docs/rules/default-param-last#options).
|
|
59
|
-
|
|
60
|
-
<sup>
|
|
61
|
-
|
|
62
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/default-param-last.md)
|
|
63
|
-
|
|
64
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce dot notation whenever possible.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/dot-notation** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -10,19 +14,8 @@ It adds:
|
|
|
10
14
|
- Support for optionally ignoring computed `private` and/or `protected` member access.
|
|
11
15
|
- Compatibility with TypeScript's `noPropertyAccessFromIndexSignature` option.
|
|
12
16
|
|
|
13
|
-
## How to Use
|
|
14
|
-
|
|
15
|
-
```jsonc
|
|
16
|
-
{
|
|
17
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
18
|
-
"dot-notation": "off",
|
|
19
|
-
"@typescript-eslint/dot-notation": ["error"]
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
17
|
## Options
|
|
24
18
|
|
|
25
|
-
See [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation#options) options.
|
|
26
19
|
This rule adds the following options:
|
|
27
20
|
|
|
28
21
|
```ts
|
|
@@ -31,6 +24,7 @@ interface Options extends BaseDotNotationOptions {
|
|
|
31
24
|
allowProtectedClassPropertyAccess?: boolean;
|
|
32
25
|
allowIndexSignaturePropertyAccess?: boolean;
|
|
33
26
|
}
|
|
27
|
+
|
|
34
28
|
const defaultOptions: Options = {
|
|
35
29
|
...baseDotNotationDefaultOptions,
|
|
36
30
|
allowPrivateClassPropertyAccess: false,
|
|
@@ -43,7 +37,7 @@ If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to
|
|
|
43
37
|
|
|
44
38
|
### `allowPrivateClassPropertyAccess`
|
|
45
39
|
|
|
46
|
-
Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true
|
|
40
|
+
Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true`:
|
|
47
41
|
|
|
48
42
|
```ts
|
|
49
43
|
class X {
|
|
@@ -56,7 +50,7 @@ x['priv_prop'] = 123;
|
|
|
56
50
|
|
|
57
51
|
### `allowProtectedClassPropertyAccess`
|
|
58
52
|
|
|
59
|
-
Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true
|
|
53
|
+
Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true`:
|
|
60
54
|
|
|
61
55
|
```ts
|
|
62
56
|
class X {
|
|
@@ -69,7 +63,7 @@ x['protected_prop'] = 123;
|
|
|
69
63
|
|
|
70
64
|
### `allowIndexSignaturePropertyAccess`
|
|
71
65
|
|
|
72
|
-
Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true
|
|
66
|
+
Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true`:
|
|
73
67
|
|
|
74
68
|
```ts
|
|
75
69
|
class X {
|
|
@@ -81,9 +75,3 @@ x['hello'] = 123;
|
|
|
81
75
|
```
|
|
82
76
|
|
|
83
77
|
If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to `true`, then the above code is always allowed, even if `allowIndexSignaturePropertyAccess` is `false`.
|
|
84
|
-
|
|
85
|
-
<sup>
|
|
86
|
-
|
|
87
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/dot-notation.md)
|
|
88
|
-
|
|
89
|
-
</sup>
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require explicit return types on functions and class methods.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/explicit-function-return-type** for documentation.
|
|
4
8
|
|
|
5
9
|
Explicit types for function return values makes it clear to any calling code what type is returned.
|
|
6
10
|
This ensures that the return value is assigned to a variable of the correct type; or in the case
|
|
@@ -63,36 +67,6 @@ class Test {
|
|
|
63
67
|
|
|
64
68
|
## Options
|
|
65
69
|
|
|
66
|
-
The rule accepts an options object with the following properties:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
type Options = {
|
|
70
|
-
// if true, only functions which are part of a declaration will be checked
|
|
71
|
-
allowExpressions?: boolean;
|
|
72
|
-
// if true, type annotations are also allowed on the variable of a function expression rather than on the function directly
|
|
73
|
-
allowTypedFunctionExpressions?: boolean;
|
|
74
|
-
// if true, functions immediately returning another function expression will not be checked
|
|
75
|
-
allowHigherOrderFunctions?: boolean;
|
|
76
|
-
// if true, arrow functions immediately returning a `as const` value will not be checked
|
|
77
|
-
allowDirectConstAssertionInArrowFunctions?: boolean;
|
|
78
|
-
// if true, concise arrow functions that start with the void keyword will not be checked
|
|
79
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* An array of function/method names that will not have their arguments or their return values checked.
|
|
82
|
-
*/
|
|
83
|
-
allowedNames?: string[];
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const defaults = {
|
|
87
|
-
allowExpressions: false,
|
|
88
|
-
allowTypedFunctionExpressions: true,
|
|
89
|
-
allowHigherOrderFunctions: true,
|
|
90
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
91
|
-
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
|
|
92
|
-
allowedNames: [],
|
|
93
|
-
};
|
|
94
|
-
```
|
|
95
|
-
|
|
96
70
|
### Configuring in a mixed JS/TS codebase
|
|
97
71
|
|
|
98
72
|
If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
|
|
@@ -108,7 +82,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
|
|
|
108
82
|
// enable the rule specifically for TypeScript files
|
|
109
83
|
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
|
|
110
84
|
"rules": {
|
|
111
|
-
"@typescript-eslint/explicit-function-return-type":
|
|
85
|
+
"@typescript-eslint/explicit-function-return-type": "error"
|
|
112
86
|
}
|
|
113
87
|
}
|
|
114
88
|
]
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require explicit accessibility modifiers on class properties and methods.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.
|
|
4
8
|
|
|
5
9
|
Leaving off accessibility modifier and making everything public can make
|
|
6
10
|
your interface hard to use by others.
|
|
@@ -14,29 +18,6 @@ which properties.
|
|
|
14
18
|
|
|
15
19
|
## Options
|
|
16
20
|
|
|
17
|
-
```ts
|
|
18
|
-
type AccessibilityLevel =
|
|
19
|
-
| 'explicit' // require an accessor (including public)
|
|
20
|
-
| 'no-public' // don't require public
|
|
21
|
-
| 'off'; // don't check
|
|
22
|
-
|
|
23
|
-
type Options = {
|
|
24
|
-
accessibility?: AccessibilityLevel;
|
|
25
|
-
ignoredMethodNames?: string[];
|
|
26
|
-
overrides?: {
|
|
27
|
-
accessors?: AccessibilityLevel;
|
|
28
|
-
constructors?: AccessibilityLevel;
|
|
29
|
-
methods?: AccessibilityLevel;
|
|
30
|
-
properties?: AccessibilityLevel;
|
|
31
|
-
parameterProperties?: AccessibilityLevel;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const defaultOptions: Options = {
|
|
36
|
-
accessibility: 'explicit',
|
|
37
|
-
};
|
|
38
|
-
```
|
|
39
|
-
|
|
40
21
|
### Configuring in a mixed JS/TS codebase
|
|
41
22
|
|
|
42
23
|
If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
|
|
@@ -52,7 +33,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
|
|
|
52
33
|
// enable the rule specifically for TypeScript files
|
|
53
34
|
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
|
|
54
35
|
"rules": {
|
|
55
|
-
"@typescript-eslint/explicit-member-accessibility":
|
|
36
|
+
"@typescript-eslint/explicit-member-accessibility": "error"
|
|
56
37
|
}
|
|
57
38
|
}
|
|
58
39
|
]
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Require explicit return and argument types on exported functions' and classes' public class methods."
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation.
|
|
4
8
|
|
|
5
9
|
Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output.
|
|
6
10
|
|
|
@@ -68,46 +72,6 @@ class Test {
|
|
|
68
72
|
|
|
69
73
|
## Options
|
|
70
74
|
|
|
71
|
-
The rule accepts an options object with the following properties:
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
type Options = {
|
|
75
|
-
/**
|
|
76
|
-
* If true, the rule will not report for arguments that are explicitly typed as `any`
|
|
77
|
-
*/
|
|
78
|
-
allowArgumentsExplicitlyTypedAsAny?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* If true, body-less arrow functions that return an `as const` type assertion will not
|
|
81
|
-
* require an explicit return value annotation.
|
|
82
|
-
* You must still type the parameters of the function.
|
|
83
|
-
*/
|
|
84
|
-
allowDirectConstAssertionInArrowFunctions?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* An array of function/method names that will not have their arguments or their return values checked.
|
|
87
|
-
*/
|
|
88
|
-
allowedNames?: string[];
|
|
89
|
-
/**
|
|
90
|
-
* If true, functions immediately returning another function expression will not
|
|
91
|
-
* require an explicit return value annotation.
|
|
92
|
-
* You must still type the parameters of the function.
|
|
93
|
-
*/
|
|
94
|
-
allowHigherOrderFunctions?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* If true, type annotations are also allowed on the variable of a function expression
|
|
97
|
-
* rather than on the function arguments/return value directly.
|
|
98
|
-
*/
|
|
99
|
-
allowTypedFunctionExpressions?: boolean;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const defaults = {
|
|
103
|
-
allowArgumentsExplicitlyTypedAsAny: false,
|
|
104
|
-
allowDirectConstAssertionInArrowFunctions: true,
|
|
105
|
-
allowedNames: [],
|
|
106
|
-
allowHigherOrderFunctions: true,
|
|
107
|
-
allowTypedFunctionExpressions: true,
|
|
108
|
-
};
|
|
109
|
-
```
|
|
110
|
-
|
|
111
75
|
### Configuring in a mixed JS/TS codebase
|
|
112
76
|
|
|
113
77
|
If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
|
|
@@ -123,7 +87,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
|
|
|
123
87
|
// enable the rule specifically for TypeScript files
|
|
124
88
|
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
|
|
125
89
|
"rules": {
|
|
126
|
-
"@typescript-eslint/explicit-module-boundary-types":
|
|
90
|
+
"@typescript-eslint/explicit-module-boundary-types": "error"
|
|
127
91
|
}
|
|
128
92
|
}
|
|
129
93
|
]
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require or disallow spacing between function identifiers and their invocations.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule.
|
|
8
12
|
It adds support for generic type parameters on function calls.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"func-call-spacing": "off",
|
|
16
|
-
"@typescript-eslint/func-call-spacing": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/func-call-spacing` options](https://eslint.org/docs/rules/func-call-spacing#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/func-call-spacing.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce consistent indentation.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/indent** for documentation.
|
|
4
8
|
|
|
5
9
|
## Warning
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
:::warning
|
|
12
|
+
|
|
13
|
+
Please read [Issue #1824: Problems with the indent rule](https://github.com/typescript-eslint/typescript-eslint/issues/1824) before using this rule!
|
|
14
|
+
|
|
15
|
+
:::
|
|
8
16
|
|
|
9
17
|
## Rule Details
|
|
10
18
|
|
|
11
19
|
This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule.
|
|
12
20
|
It adds support for TypeScript nodes.
|
|
13
|
-
|
|
14
|
-
## How to Use
|
|
15
|
-
|
|
16
|
-
```jsonc
|
|
17
|
-
{
|
|
18
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
19
|
-
"indent": "off",
|
|
20
|
-
"@typescript-eslint/indent": ["error"]
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Options
|
|
25
|
-
|
|
26
|
-
See [`eslint/indent` options](https://eslint.org/docs/rules/indent#options).
|
|
27
|
-
|
|
28
|
-
<sup>
|
|
29
|
-
|
|
30
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/indent.md)
|
|
31
|
-
|
|
32
|
-
</sup>
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require or disallow initialization in variable declarations.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/init-declarations** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
|
|
8
12
|
It adds support for TypeScript's `declare` variables.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"init-declarations": "off",
|
|
16
|
-
"@typescript-eslint/init-declarations": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/init-declarations` options](https://eslint.org/docs/rules/init-declarations#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/init-declarations.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce consistent spacing before and after keywords.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule.
|
|
8
12
|
This version adds support for generic type parameters on function calls.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"keyword-spacing": "off",
|
|
16
|
-
"@typescript-eslint/keyword-spacing": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/keyword-spacing` options](https://eslint.org/docs/rules/keyword-spacing#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/keyword-spacing.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|