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/lib/options-manager.js
CHANGED
|
@@ -2,6 +2,7 @@ import {existsSync, promises as fs} from 'node:fs';
|
|
|
2
2
|
import process from 'node:process';
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
+
import {createRequire} from 'node:module';
|
|
5
6
|
import arrify from 'arrify';
|
|
6
7
|
import {mergeWith, flow, pick} from 'lodash-es';
|
|
7
8
|
import {findUpSync} from 'find-up';
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
CACHE_DIR_NAME,
|
|
28
29
|
} from './constants.js';
|
|
29
30
|
|
|
30
|
-
const {__dirname,
|
|
31
|
+
const {__dirname, require} = createEsmUtils(import.meta);
|
|
31
32
|
const {normalizePackageName} = Legacy.naming;
|
|
32
33
|
const resolveModule = Legacy.ModuleResolver.resolve;
|
|
33
34
|
|
|
@@ -161,7 +162,7 @@ const handleTSConfig = async options => {
|
|
|
161
162
|
|
|
162
163
|
if (tsConfigProjectPath) {
|
|
163
164
|
options.tsConfigPath = path.resolve(options.cwd, tsConfigProjectPath);
|
|
164
|
-
options.tsConfig = await
|
|
165
|
+
options.tsConfig = JSON5.parse(await fs.readFile(options.tsConfigPath));
|
|
165
166
|
} else {
|
|
166
167
|
const tsConfigExplorer = cosmiconfig([], {
|
|
167
168
|
searchPlaces: ['tsconfig.json'],
|
|
@@ -173,12 +174,40 @@ const handleTSConfig = async options => {
|
|
|
173
174
|
options.tsConfig = searchResults.config;
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
if (options.tsConfig) {
|
|
178
|
+
// If the tsconfig extends from another file, we need to ensure that the file is covered by the tsconfig
|
|
179
|
+
// or not. The basefile could have includes/excludes/files properties that should be applied to the final tsconfig representation.
|
|
180
|
+
options.tsConfig = await recursiveBuildTsConfig(options.tsConfig, options.tsConfigPath);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let hasMatch;
|
|
184
|
+
|
|
185
|
+
// If there is no files or include property - ts uses **/* as default so all TS files are matched
|
|
186
|
+
// in tsconfig, excludes override includes - so we need to prioritize that matching logic
|
|
187
|
+
if (
|
|
188
|
+
options.tsConfig
|
|
189
|
+
&& !options.tsConfig.include
|
|
190
|
+
&& !options.tsConfig.files
|
|
191
|
+
) {
|
|
192
|
+
// If we have an excludes property, we need to check it
|
|
193
|
+
// If we match on excluded, then we definitively know that there is no tsconfig match
|
|
194
|
+
if (Array.isArray(options.tsConfig.exclude)) {
|
|
195
|
+
const exclude = options.tsConfig && Array.isArray(options.tsConfig.exclude) ? options.tsConfig.exclude : [];
|
|
196
|
+
hasMatch = !micromatch.contains(options.filePath, exclude);
|
|
197
|
+
} else {
|
|
198
|
+
// Not explicitly excluded and included by tsconfig defaults
|
|
199
|
+
hasMatch = true;
|
|
200
|
+
}
|
|
201
|
+
} else {
|
|
202
|
+
// We have either and include or a files property in tsconfig
|
|
203
|
+
const include = options.tsConfig && Array.isArray(options.tsConfig.include) ? options.tsConfig.include : [];
|
|
204
|
+
const files = options.tsConfig && Array.isArray(options.tsConfig.files) ? options.tsConfig.files : [];
|
|
205
|
+
const exclude = options.tsConfig && Array.isArray(options.tsConfig.exclude) ? options.tsConfig.exclude : [];
|
|
206
|
+
// If we also have an exlcude we need to check all the arrays, (files, include, exclude)
|
|
207
|
+
// this check not excluded and included in one of the file/include array
|
|
208
|
+
hasMatch = !micromatch.contains(options.filePath, exclude)
|
|
209
|
+
&& micromatch.contains(options.filePath, [...include, ...files]);
|
|
210
|
+
}
|
|
182
211
|
|
|
183
212
|
if (!hasMatch) {
|
|
184
213
|
// Only use our default tsconfig if no other tsconfig is found - otherwise extend the found config for linting
|
|
@@ -607,6 +636,72 @@ const getOptionGroups = async (files, options) => {
|
|
|
607
636
|
return optionGroups;
|
|
608
637
|
};
|
|
609
638
|
|
|
639
|
+
async function recursiveBuildTsConfig(tsConfig, tsConfigPath) {
|
|
640
|
+
tsConfig = tsConfigResolvePaths(tsConfig, tsConfigPath);
|
|
641
|
+
|
|
642
|
+
if (!tsConfig.extends || (typeof tsConfig.extends === 'string' && tsConfig.extends.includes('node_modules'))) {
|
|
643
|
+
return tsConfig;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
// If any of the following are missing, then we need to look up the base config as it could apply
|
|
647
|
+
const require = createRequire(tsConfigPath);
|
|
648
|
+
|
|
649
|
+
let basePath;
|
|
650
|
+
try {
|
|
651
|
+
basePath = require.resolve(tsConfig.extends);
|
|
652
|
+
} catch (error) {
|
|
653
|
+
// Tsconfig resolution is odd, It allows behavior that is not exactly like node resolution
|
|
654
|
+
// therefore we attempt to smooth this out here with this hack
|
|
655
|
+
try {
|
|
656
|
+
basePath = require.resolve(path.join(tsConfig.extends, 'tsconfig.json'));
|
|
657
|
+
} catch {
|
|
658
|
+
// Throw the orginal resolution error to let the user know their extends block is invalid
|
|
659
|
+
throw error;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const baseTsConfig = JSON5.parse(await fs.readFile(basePath));
|
|
664
|
+
|
|
665
|
+
delete tsConfig.extends;
|
|
666
|
+
|
|
667
|
+
tsConfig = {
|
|
668
|
+
compilerOptions: {
|
|
669
|
+
...baseTsConfig.compilerOptions,
|
|
670
|
+
...tsConfig.compilerOptions,
|
|
671
|
+
},
|
|
672
|
+
...baseTsConfig,
|
|
673
|
+
...tsConfig,
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
return recursiveBuildTsConfig(tsConfig, basePath);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Convert all include, files, and exclude to absolute paths
|
|
680
|
+
// and or globs. This works because ts only allows simple glob subset
|
|
681
|
+
const tsConfigResolvePaths = (tsConfig, tsConfigPath) => {
|
|
682
|
+
const tsConfigDirectory = path.dirname(tsConfigPath);
|
|
683
|
+
|
|
684
|
+
if (Array.isArray(tsConfig.files)) {
|
|
685
|
+
tsConfig.files = tsConfig.files.map(
|
|
686
|
+
filePath => path.resolve(tsConfigDirectory, filePath),
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
if (Array.isArray(tsConfig.include)) {
|
|
691
|
+
tsConfig.include = tsConfig.include.map(
|
|
692
|
+
globPath => path.resolve(tsConfigDirectory, globPath),
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
if (Array.isArray(tsConfig.exclude)) {
|
|
697
|
+
tsConfig.exclude = tsConfig.exclude.map(
|
|
698
|
+
globPath => path.resolve(tsConfigDirectory, globPath),
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return tsConfig;
|
|
703
|
+
};
|
|
704
|
+
|
|
610
705
|
export {
|
|
611
706
|
parseOptions,
|
|
612
707
|
getIgnores,
|
|
@@ -620,4 +715,5 @@ export {
|
|
|
620
715
|
buildConfig,
|
|
621
716
|
getOptionGroups,
|
|
622
717
|
handleTSConfig,
|
|
718
|
+
tsConfigResolvePaths,
|
|
623
719
|
};
|
|
@@ -85,7 +85,7 @@ Some highly valuable rules require type-checking in order to be implemented corr
|
|
|
85
85
|
|
|
86
86
|
Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking).
|
|
87
87
|
|
|
88
|
-
**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/
|
|
88
|
+
**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/typed-linting)**
|
|
89
89
|
|
|
90
90
|
## Supported Rules
|
|
91
91
|
|
|
@@ -91,7 +91,6 @@ function typeNeedsParentheses(node) {
|
|
|
91
91
|
return false;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const arrayOption = { enum: ['array', 'generic', 'array-simple'] };
|
|
95
94
|
exports.default = util.createRule({
|
|
96
95
|
name: 'array-type',
|
|
97
96
|
meta: {
|
|
@@ -107,15 +106,29 @@ exports.default = util.createRule({
|
|
|
107
106
|
errorStringArraySimple: "Array type using '{{className}}<{{type}}>' is forbidden for simple types. Use '{{readonlyPrefix}}{{type}}[]' instead.",
|
|
108
107
|
errorStringGenericSimple: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.",
|
|
109
108
|
},
|
|
110
|
-
schema:
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
default: arrayOption,
|
|
115
|
-
readonly: arrayOption,
|
|
109
|
+
schema: {
|
|
110
|
+
$defs: {
|
|
111
|
+
arrayOption: {
|
|
112
|
+
enum: ['array', 'generic', 'array-simple'],
|
|
116
113
|
},
|
|
117
114
|
},
|
|
118
|
-
|
|
115
|
+
prefixItems: [
|
|
116
|
+
{
|
|
117
|
+
properties: {
|
|
118
|
+
default: {
|
|
119
|
+
$ref: '#/$defs/arrayOption',
|
|
120
|
+
description: 'The array type expected for mutable cases...',
|
|
121
|
+
},
|
|
122
|
+
readonly: {
|
|
123
|
+
$ref: '#/$defs/arrayOption',
|
|
124
|
+
description: 'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
type: 'object',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
type: 'array',
|
|
131
|
+
},
|
|
119
132
|
},
|
|
120
133
|
defaultOptions: [
|
|
121
134
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array-type.js","sourceRoot":"","sources":["../../src/rules/array-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,8CAAgC;AAEhC;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAmB;IACvC,QAAQ,IAAI,CAAC,IAAI,EAAE;QACjB,KAAK,sBAAc,CAAC,UAAU,CAAC;QAC/B,KAAK,sBAAc,CAAC,YAAY,CAAC;QACjC,KAAK,sBAAc,CAAC,gBAAgB,CAAC;QACrC,KAAK,sBAAc,CAAC,cAAc,CAAC;QACnC,KAAK,sBAAc,CAAC,eAAe,CAAC;QACpC,KAAK,sBAA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CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;4BAC7D,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;yBAC5D,CAAC;oBACJ,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -26,23 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.defaultMinimumDescriptionLength = void 0;
|
|
27
27
|
const utils_1 = require("@typescript-eslint/utils");
|
|
28
28
|
const util = __importStar(require("../util"));
|
|
29
|
-
const directiveConfigSchema = {
|
|
30
|
-
oneOf: [
|
|
31
|
-
{
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
default: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
enum: ['allow-with-description'],
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
type: 'object',
|
|
40
|
-
properties: {
|
|
41
|
-
descriptionFormat: { type: 'string' },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|
|
46
29
|
exports.defaultMinimumDescriptionLength = 3;
|
|
47
30
|
exports.default = util.createRule({
|
|
48
31
|
name: 'ban-ts-comment',
|
|
@@ -57,22 +40,45 @@ exports.default = util.createRule({
|
|
|
57
40
|
tsDirectiveCommentRequiresDescription: 'Include a description after the "@ts-{{directive}}" directive to explain why the @ts-{{directive}} is necessary. The description must be {{minimumDescriptionLength}} characters or longer.',
|
|
58
41
|
tsDirectiveCommentDescriptionNotMatchPattern: 'The description for the "@ts-{{directive}}" directive must match the {{format}} format.',
|
|
59
42
|
},
|
|
60
|
-
schema:
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
43
|
+
schema: {
|
|
44
|
+
$defs: {
|
|
45
|
+
directiveConfigSchema: {
|
|
46
|
+
oneOf: [
|
|
47
|
+
{
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
default: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
enum: ['allow-with-description'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
descriptionFormat: { type: 'string' },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
72
61
|
},
|
|
73
|
-
additionalProperties: false,
|
|
74
62
|
},
|
|
75
|
-
|
|
63
|
+
prefixItems: [
|
|
64
|
+
{
|
|
65
|
+
properties: {
|
|
66
|
+
'ts-expect-error': {
|
|
67
|
+
$ref: '#/$defs/directiveConfigSchema',
|
|
68
|
+
},
|
|
69
|
+
'ts-ignore': { $ref: '#/$defs/directiveConfigSchema' },
|
|
70
|
+
'ts-nocheck': { $ref: '#/$defs/directiveConfigSchema' },
|
|
71
|
+
'ts-check': { $ref: '#/$defs/directiveConfigSchema' },
|
|
72
|
+
minimumDescriptionLength: {
|
|
73
|
+
type: 'number',
|
|
74
|
+
default: exports.defaultMinimumDescriptionLength,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
additionalProperties: false,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
type: 'array',
|
|
81
|
+
},
|
|
76
82
|
},
|
|
77
83
|
defaultOptions: [
|
|
78
84
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ban-ts-comment.js","sourceRoot":"","sources":["../../src/rules/ban-ts-comment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA2D;AAC3D,8CAAgC;
|
|
1
|
+
{"version":3,"file":"ban-ts-comment.js","sourceRoot":"","sources":["../../src/rules/ban-ts-comment.ts"],"names":[],"mapp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AAE;wBACnB,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,EAAE,EAAE,SAAS,EAAE;4BACnB,IAAI,EAAE,OAAO;4BACb,SAAS,EAAE,oBAAoB;yBAChC,CAAC,CAAC;qBACJ;oBAED,IACE,MAAM,KAAK,wBAAwB;wBACnC,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,iBAAiB,CAAC,EACxD;wBACA,MAAM,EACJ,wBAAwB,GAAG,uCAA+B,GAC3D,GAAG,OAAO,CAAC;wBACZ,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;wBACrD,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,wBAAwB,EAAE;4BACxD,OAAO,CAAC,MAAM,CAAC;gCACb,IAAI,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE;gCAC7C,IAAI,EAAE,OAAO;gCACb,SAAS,EAAE,uCAAuC;6BACnD,CAAC,CAAC;yBACJ;6BAAM,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;4BAC9C,OAAO,CAAC,MAAM,CAAC;gCACb,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;gCAC1C,IAAI,EAAE,OAAO;gCACb,SAAS,EAAE,8CAA8C;6BAC1D,CAAC,CAAC;yBACJ;qBACF;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -59,7 +59,7 @@ exports.default = util.createRule({
|
|
|
59
59
|
extendsBaseRule: true,
|
|
60
60
|
},
|
|
61
61
|
schema: {
|
|
62
|
-
|
|
62
|
+
$defs: {
|
|
63
63
|
value: {
|
|
64
64
|
enum: OPTION_VALUE_SCHEME,
|
|
65
65
|
},
|
|
@@ -72,19 +72,19 @@ exports.default = util.createRule({
|
|
|
72
72
|
{
|
|
73
73
|
oneOf: [
|
|
74
74
|
{
|
|
75
|
-
$ref: '
|
|
75
|
+
$ref: '#/$defs/value',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
type: 'object',
|
|
79
79
|
properties: {
|
|
80
|
-
arrays: { $ref: '
|
|
81
|
-
objects: { $ref: '
|
|
82
|
-
imports: { $ref: '
|
|
83
|
-
exports: { $ref: '
|
|
84
|
-
functions: { $ref: '
|
|
85
|
-
enums: { $ref: '
|
|
86
|
-
generics: { $ref: '
|
|
87
|
-
tuples: { $ref: '
|
|
80
|
+
arrays: { $ref: '#/$defs/valueWithIgnore' },
|
|
81
|
+
objects: { $ref: '#/$defs/valueWithIgnore' },
|
|
82
|
+
imports: { $ref: '#/$defs/valueWithIgnore' },
|
|
83
|
+
exports: { $ref: '#/$defs/valueWithIgnore' },
|
|
84
|
+
functions: { $ref: '#/$defs/valueWithIgnore' },
|
|
85
|
+
enums: { $ref: '#/$defs/valueWithIgnore' },
|
|
86
|
+
generics: { $ref: '#/$defs/valueWithIgnore' },
|
|
87
|
+
tuples: { $ref: '#/$defs/valueWithIgnore' },
|
|
88
88
|
},
|
|
89
89
|
additionalProperties: false,
|
|
90
90
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comma-dangle.js","sourceRoot":"","sources":["../../src/rules/comma-dangle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAChC,iEAA8D;AAC9D,oDAAoE;AAEpE,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,cAAc,CAAC,CAAC;AAUnD,MAAM,mBAAmB,GAAG;IAC1B,kBAAkB;IAClB,QAAQ;IACR,OAAO;IACP,gBAAgB;CACjB,CAAC;AAEF,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC,SAAS,gBAAgB,CAAC,OAAe;;IACvC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO;YACL,KAAK,EAAE,OAAO;YACd,Q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qBAAqB,CAAC,IAAmB;YAChD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;gBACrB,UAAU,CAAC,IAAI,CAAC,CAAC;aAClB;iBAAM;gBACL,WAAW,CAAC,IAAI,CAAC,CAAC;aACnB;QACH,CAAC;QAED,uCACK,KAAK,KACR,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,EACrD,0BAA0B,EAAE,SAAS,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EACjE,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAChD;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js
CHANGED
|
@@ -25,10 +25,12 @@ exports.default = (0, util_1.createRule)({
|
|
|
25
25
|
create(context, [mode]) {
|
|
26
26
|
const sourceCode = context.getSourceCode();
|
|
27
27
|
return {
|
|
28
|
-
VariableDeclarator(node) {
|
|
28
|
+
'VariableDeclarator,PropertyDefinition'(node) {
|
|
29
29
|
var _a, _b;
|
|
30
|
-
const lhs = (_a = node.id.typeAnnotation) === null || _a === void 0 ? void 0 : _a.typeAnnotation;
|
|
31
|
-
const rhs = node.
|
|
30
|
+
const lhs = (_a = (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator ? node.id : node).typeAnnotation) === null || _a === void 0 ? void 0 : _a.typeAnnotation;
|
|
31
|
+
const rhs = node.type === utils_1.AST_NODE_TYPES.VariableDeclarator
|
|
32
|
+
? node.init
|
|
33
|
+
: node.value;
|
|
32
34
|
if (!rhs ||
|
|
33
35
|
rhs.type !== utils_1.AST_NODE_TYPES.NewExpression ||
|
|
34
36
|
rhs.callee.type !== utils_1.AST_NODE_TYPES.Identifier) {
|
|
@@ -48,9 +50,20 @@ exports.default = (0, util_1.createRule)({
|
|
|
48
50
|
node,
|
|
49
51
|
messageId: 'preferTypeAnnotation',
|
|
50
52
|
fix(fixer) {
|
|
53
|
+
function getIDToAttachAnnotation() {
|
|
54
|
+
if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) {
|
|
55
|
+
return node.id;
|
|
56
|
+
}
|
|
57
|
+
if (!node.computed) {
|
|
58
|
+
return node.key;
|
|
59
|
+
}
|
|
60
|
+
// If the property's computed, we have to attach the
|
|
61
|
+
// annotation after the square bracket, not the enclosed expression
|
|
62
|
+
return sourceCode.getTokenAfter(node.key);
|
|
63
|
+
}
|
|
51
64
|
return [
|
|
52
65
|
fixer.remove(typeParameters),
|
|
53
|
-
fixer.insertTextAfter(
|
|
66
|
+
fixer.insertTextAfter(getIDToAttachAnnotation(), ': ' + typeAnnotation),
|
|
54
67
|
];
|
|
55
68
|
},
|
|
56
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consistent-generic-constructors.js","sourceRoot":"","sources":["../../src/rules/consistent-generic-constructors.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"consistent-generic-constructors.js","sourceRoot":"","sources":["../../src/rules/consistent-generic-constructors.ts"],"names":[],"mappings":";;AAAA,oDAAoE;AACpE,kCAAqC;AAKrC,kBAAe,IAAA,iBAAU,EAAsB;IAC7C,IAAI,EAAE,iCAAiC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,wGAAwG;YAC1G,WAAW,EAAE,QAAQ;SACtB;QACD,QAAQ,EAAE;YACR,oBAAoB,EAClB,gFAAgF;YAClF,iBAAiB,EACf,2FAA2F;SAC9F;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC;aACzC;SACF;KACF;IACD,cAAc,EAAE,CAAC,aAAa,CAAC;IAC/B,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;QACpB,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3C,OAAO;YACL,uCAAu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,CAC5B,CAAC;iCACH;gCACD,MAAM,KAAK,CAAC,eAAe,CACzB,GAAG,CAAC,MAAM,EACV,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CACvC,CAAC;gCACF,IAAI,CAAC,SAAS,EAAE;oCACd,MAAM,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;iCAC/C;4BACH,CAAC;yBACF,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js
CHANGED
|
@@ -41,26 +41,32 @@ exports.default = util.createRule({
|
|
|
41
41
|
{
|
|
42
42
|
type: 'object',
|
|
43
43
|
properties: {
|
|
44
|
-
|
|
44
|
+
allowConciseArrowFunctionExpressionsStartingWithVoid: {
|
|
45
|
+
description: 'Whether to allow arrow functions that start with the `void` keyword.',
|
|
45
46
|
type: 'boolean',
|
|
46
47
|
},
|
|
47
|
-
|
|
48
|
+
allowExpressions: {
|
|
49
|
+
description: 'Whether to ignore function expressions (functions which are not part of a declaration).',
|
|
48
50
|
type: 'boolean',
|
|
49
51
|
},
|
|
50
52
|
allowHigherOrderFunctions: {
|
|
53
|
+
description: 'Whether to ignore functions immediately returning another function expression.',
|
|
51
54
|
type: 'boolean',
|
|
52
55
|
},
|
|
53
|
-
|
|
56
|
+
allowTypedFunctionExpressions: {
|
|
57
|
+
description: 'Whether to ignore type annotations on the variable of function expressions.',
|
|
54
58
|
type: 'boolean',
|
|
55
59
|
},
|
|
56
|
-
|
|
60
|
+
allowDirectConstAssertionInArrowFunctions: {
|
|
61
|
+
description: 'Whether to ignore arrow functions immediately returning a `as const` value.',
|
|
57
62
|
type: 'boolean',
|
|
58
63
|
},
|
|
59
64
|
allowedNames: {
|
|
60
|
-
|
|
65
|
+
description: 'An array of function/method names that will not have their arguments or return values checked.',
|
|
61
66
|
items: {
|
|
62
67
|
type: 'string',
|
|
63
68
|
},
|
|
69
|
+
type: 'array',
|
|
64
70
|
},
|
|
65
71
|
},
|
|
66
72
|
additionalProperties: false,
|
|
@@ -80,15 +86,15 @@ exports.default = util.createRule({
|
|
|
80
86
|
create(context, [options]) {
|
|
81
87
|
const sourceCode = context.getSourceCode();
|
|
82
88
|
function isAllowedName(node) {
|
|
83
|
-
var _a;
|
|
84
|
-
if (!options.allowedNames ||
|
|
89
|
+
var _a, _b;
|
|
90
|
+
if (!((_a = options.allowedNames) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
85
91
|
return false;
|
|
86
92
|
}
|
|
87
93
|
if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
|
|
88
94
|
node.type === utils_1.AST_NODE_TYPES.FunctionExpression) {
|
|
89
95
|
const parent = node.parent;
|
|
90
96
|
let funcName;
|
|
91
|
-
if ((
|
|
97
|
+
if ((_b = node.id) === null || _b === void 0 ? void 0 : _b.name) {
|
|
92
98
|
funcName = node.id.name;
|
|
93
99
|
}
|
|
94
100
|
else if (parent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explicit-function-return-type.js","sourceRoot":"","sources":["../../src/rules/explicit-function-return-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,8CAAgC;AAChC,6EAIyC;AAczC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,8DAA8D;YAChE,WAAW,EAAE,KAAK;SACnB;QACD,QAAQ,EAAE;YACR,iBAAiB,EAAE,kCAAkC;SACtD;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,
|
|
1
|
+
{"version":3,"file":"explicit-function-return-type.js","sourceRoot":"","sources":["../../src/rules/explicit-function-return-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