eslint-plugin-typefest 1.0.1
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/CHANGELOG.md +1814 -0
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/dist/_internal/array-like-expression.d.ts +67 -0
- package/dist/_internal/array-like-expression.d.ts.map +1 -0
- package/dist/_internal/array-like-expression.js +179 -0
- package/dist/_internal/array-like-expression.js.map +1 -0
- package/dist/_internal/array-method-call-rule.d.ts +34 -0
- package/dist/_internal/array-method-call-rule.d.ts.map +1 -0
- package/dist/_internal/array-method-call-rule.js +49 -0
- package/dist/_internal/array-method-call-rule.js.map +1 -0
- package/dist/_internal/ast-node.d.ts +23 -0
- package/dist/_internal/ast-node.d.ts.map +1 -0
- package/dist/_internal/ast-node.js +38 -0
- package/dist/_internal/ast-node.js.map +1 -0
- package/dist/_internal/bounded-cache.d.ts +42 -0
- package/dist/_internal/bounded-cache.d.ts.map +1 -0
- package/dist/_internal/bounded-cache.js +57 -0
- package/dist/_internal/bounded-cache.js.map +1 -0
- package/dist/_internal/constrained-type-at-location.d.ts +31 -0
- package/dist/_internal/constrained-type-at-location.d.ts.map +1 -0
- package/dist/_internal/constrained-type-at-location.js +61 -0
- package/dist/_internal/constrained-type-at-location.js.map +1 -0
- package/dist/_internal/cycle-safe-linked-search.d.ts +48 -0
- package/dist/_internal/cycle-safe-linked-search.d.ts.map +1 -0
- package/dist/_internal/cycle-safe-linked-search.js +70 -0
- package/dist/_internal/cycle-safe-linked-search.js.map +1 -0
- package/dist/_internal/expression-boolean-memoizer.d.ts +17 -0
- package/dist/_internal/expression-boolean-memoizer.d.ts.map +1 -0
- package/dist/_internal/expression-boolean-memoizer.js +23 -0
- package/dist/_internal/expression-boolean-memoizer.js.map +1 -0
- package/dist/_internal/filter-callback.d.ts +56 -0
- package/dist/_internal/filter-callback.d.ts.map +1 -0
- package/dist/_internal/filter-callback.js +100 -0
- package/dist/_internal/filter-callback.js.map +1 -0
- package/dist/_internal/global-identifier-member-call.d.ts +23 -0
- package/dist/_internal/global-identifier-member-call.d.ts.map +1 -0
- package/dist/_internal/global-identifier-member-call.js +25 -0
- package/dist/_internal/global-identifier-member-call.js.map +1 -0
- package/dist/_internal/global-member-call-rule.d.ts +36 -0
- package/dist/_internal/global-member-call-rule.d.ts.map +1 -0
- package/dist/_internal/global-member-call-rule.js +52 -0
- package/dist/_internal/global-member-call-rule.js.map +1 -0
- package/dist/_internal/import-analysis.d.ts +45 -0
- package/dist/_internal/import-analysis.d.ts.map +1 -0
- package/dist/_internal/import-analysis.js +113 -0
- package/dist/_internal/import-analysis.js.map +1 -0
- package/dist/_internal/import-aware-fixes.d.ts +31 -0
- package/dist/_internal/import-aware-fixes.d.ts.map +1 -0
- package/dist/_internal/import-aware-fixes.js +38 -0
- package/dist/_internal/import-aware-fixes.js.map +1 -0
- package/dist/_internal/import-fix-coordinator.d.ts +43 -0
- package/dist/_internal/import-fix-coordinator.d.ts.map +1 -0
- package/dist/_internal/import-fix-coordinator.js +71 -0
- package/dist/_internal/import-fix-coordinator.js.map +1 -0
- package/dist/_internal/import-insertion.d.ts +27 -0
- package/dist/_internal/import-insertion.d.ts.map +1 -0
- package/dist/_internal/import-insertion.js +295 -0
- package/dist/_internal/import-insertion.js.map +1 -0
- package/dist/_internal/imported-type-aliases.d.ts +140 -0
- package/dist/_internal/imported-type-aliases.d.ts.map +1 -0
- package/dist/_internal/imported-type-aliases.js +316 -0
- package/dist/_internal/imported-type-aliases.js.map +1 -0
- package/dist/_internal/imported-value-symbols.d.ts +157 -0
- package/dist/_internal/imported-value-symbols.d.ts.map +1 -0
- package/dist/_internal/imported-value-symbols.js +478 -0
- package/dist/_internal/imported-value-symbols.js.map +1 -0
- package/dist/_internal/member-call.d.ts +53 -0
- package/dist/_internal/member-call.d.ts.map +1 -0
- package/dist/_internal/member-call.js +48 -0
- package/dist/_internal/member-call.js.map +1 -0
- package/dist/_internal/module-source.d.ts +11 -0
- package/dist/_internal/module-source.d.ts.map +1 -0
- package/dist/_internal/module-source.js +11 -0
- package/dist/_internal/module-source.js.map +1 -0
- package/dist/_internal/normalize-expression-text.d.ts +26 -0
- package/dist/_internal/normalize-expression-text.d.ts.map +1 -0
- package/dist/_internal/normalize-expression-text.js +182 -0
- package/dist/_internal/normalize-expression-text.js.map +1 -0
- package/dist/_internal/nullish-comparison.d.ts +43 -0
- package/dist/_internal/nullish-comparison.d.ts.map +1 -0
- package/dist/_internal/nullish-comparison.js +147 -0
- package/dist/_internal/nullish-comparison.js.map +1 -0
- package/dist/_internal/plugin-settings.d.ts +32 -0
- package/dist/_internal/plugin-settings.d.ts.map +1 -0
- package/dist/_internal/plugin-settings.js +118 -0
- package/dist/_internal/plugin-settings.js.map +1 -0
- package/dist/_internal/report-adapter.d.ts +25 -0
- package/dist/_internal/report-adapter.d.ts.map +1 -0
- package/dist/_internal/report-adapter.js +36 -0
- package/dist/_internal/report-adapter.js.map +1 -0
- package/dist/_internal/rule-catalog.d.ts +51 -0
- package/dist/_internal/rule-catalog.d.ts.map +1 -0
- package/dist/_internal/rule-catalog.js +162 -0
- package/dist/_internal/rule-catalog.js.map +1 -0
- package/dist/_internal/rule-docs-metadata.d.ts +37 -0
- package/dist/_internal/rule-docs-metadata.d.ts.map +1 -0
- package/dist/_internal/rule-docs-metadata.js +192 -0
- package/dist/_internal/rule-docs-metadata.js.map +1 -0
- package/dist/_internal/rule-docs-url.d.ts +15 -0
- package/dist/_internal/rule-docs-url.d.ts.map +1 -0
- package/dist/_internal/rule-docs-url.js +15 -0
- package/dist/_internal/rule-docs-url.js.map +1 -0
- package/dist/_internal/rule-reporting.d.ts +71 -0
- package/dist/_internal/rule-reporting.d.ts.map +1 -0
- package/dist/_internal/rule-reporting.js +89 -0
- package/dist/_internal/rule-reporting.js.map +1 -0
- package/dist/_internal/rules-registry.d.ts +14 -0
- package/dist/_internal/rules-registry.d.ts.map +1 -0
- package/dist/_internal/rules-registry.js +165 -0
- package/dist/_internal/rules-registry.js.map +1 -0
- package/dist/_internal/safe-type-operation.d.ts +89 -0
- package/dist/_internal/safe-type-operation.d.ts.map +1 -0
- package/dist/_internal/safe-type-operation.js +147 -0
- package/dist/_internal/safe-type-operation.js.map +1 -0
- package/dist/_internal/scope-resolution.d.ts +20 -0
- package/dist/_internal/scope-resolution.d.ts.map +1 -0
- package/dist/_internal/scope-resolution.js +21 -0
- package/dist/_internal/scope-resolution.js.map +1 -0
- package/dist/_internal/scope-variable.d.ts +17 -0
- package/dist/_internal/scope-variable.d.ts.map +1 -0
- package/dist/_internal/scope-variable.js +30 -0
- package/dist/_internal/scope-variable.js.map +1 -0
- package/dist/_internal/set-membership.d.ts +6 -0
- package/dist/_internal/set-membership.d.ts.map +1 -0
- package/dist/_internal/set-membership.js +11 -0
- package/dist/_internal/set-membership.js.map +1 -0
- package/dist/_internal/text-character.d.ts +18 -0
- package/dist/_internal/text-character.d.ts.map +1 -0
- package/dist/_internal/text-character.js +69 -0
- package/dist/_internal/text-character.js.map +1 -0
- package/dist/_internal/throw-consequent.d.ts +22 -0
- package/dist/_internal/throw-consequent.d.ts.map +1 -0
- package/dist/_internal/throw-consequent.js +48 -0
- package/dist/_internal/throw-consequent.js.map +1 -0
- package/dist/_internal/throw-type-error.d.ts +19 -0
- package/dist/_internal/throw-type-error.d.ts.map +1 -0
- package/dist/_internal/throw-type-error.js +24 -0
- package/dist/_internal/throw-type-error.js.map +1 -0
- package/dist/_internal/type-checker-compat.d.ts +80 -0
- package/dist/_internal/type-checker-compat.d.ts.map +1 -0
- package/dist/_internal/type-checker-compat.js +104 -0
- package/dist/_internal/type-checker-compat.js.map +1 -0
- package/dist/_internal/type-predicate-autofix-safety.d.ts +20 -0
- package/dist/_internal/type-predicate-autofix-safety.d.ts.map +1 -0
- package/dist/_internal/type-predicate-autofix-safety.js +58 -0
- package/dist/_internal/type-predicate-autofix-safety.js.map +1 -0
- package/dist/_internal/type-reference-node.d.ts +19 -0
- package/dist/_internal/type-reference-node.d.ts.map +1 -0
- package/dist/_internal/type-reference-node.js +14 -0
- package/dist/_internal/type-reference-node.js.map +1 -0
- package/dist/_internal/typed-member-call-rule.d.ts +35 -0
- package/dist/_internal/typed-member-call-rule.d.ts.map +1 -0
- package/dist/_internal/typed-member-call-rule.js +50 -0
- package/dist/_internal/typed-member-call-rule.js.map +1 -0
- package/dist/_internal/typed-path-telemetry.d.ts +58 -0
- package/dist/_internal/typed-path-telemetry.d.ts.map +1 -0
- package/dist/_internal/typed-path-telemetry.js +114 -0
- package/dist/_internal/typed-path-telemetry.js.map +1 -0
- package/dist/_internal/typed-rule.d.ts +142 -0
- package/dist/_internal/typed-rule.d.ts.map +1 -0
- package/dist/_internal/typed-rule.js +197 -0
- package/dist/_internal/typed-rule.js.map +1 -0
- package/dist/_internal/typefest-config-references.d.ts +45 -0
- package/dist/_internal/typefest-config-references.d.ts.map +1 -0
- package/dist/_internal/typefest-config-references.js +98 -0
- package/dist/_internal/typefest-config-references.js.map +1 -0
- package/dist/_internal/typescript-eslint-node-autofix.d.ts +32 -0
- package/dist/_internal/typescript-eslint-node-autofix.d.ts.map +1 -0
- package/dist/_internal/typescript-eslint-node-autofix.js +495 -0
- package/dist/_internal/typescript-eslint-node-autofix.js.map +1 -0
- package/dist/_internal/value-rewrite-autofix-safety.d.ts +33 -0
- package/dist/_internal/value-rewrite-autofix-safety.d.ts.map +1 -0
- package/dist/_internal/value-rewrite-autofix-safety.js +103 -0
- package/dist/_internal/value-rewrite-autofix-safety.js.map +1 -0
- package/dist/plugin.cjs +9718 -0
- package/dist/plugin.cjs.map +7 -0
- package/dist/plugin.d.cts +76 -0
- package/dist/plugin.d.ts +76 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +206 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-at.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-at.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-at.js +66 -0
- package/dist/rules/prefer-ts-extras-array-at.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-concat.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-concat.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-concat.js +66 -0
- package/dist/rules/prefer-ts-extras-array-concat.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find-last-index.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-find-last-index.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find-last-index.js +63 -0
- package/dist/rules/prefer-ts-extras-array-find-last-index.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find-last.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-find-last.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find-last.js +66 -0
- package/dist/rules/prefer-ts-extras-array-find-last.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-find.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-find.js +63 -0
- package/dist/rules/prefer-ts-extras-array-find.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-first.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-first.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-first.js +107 -0
- package/dist/rules/prefer-ts-extras-array-first.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-includes.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-includes.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-includes.js +89 -0
- package/dist/rules/prefer-ts-extras-array-includes.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-join.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-array-join.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-join.js +66 -0
- package/dist/rules/prefer-ts-extras-array-join.js.map +1 -0
- package/dist/rules/prefer-ts-extras-array-last.d.ts +8 -0
- package/dist/rules/prefer-ts-extras-array-last.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-array-last.js +132 -0
- package/dist/rules/prefer-ts-extras-array-last.js.map +1 -0
- package/dist/rules/prefer-ts-extras-as-writable.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-as-writable.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-as-writable.js +110 -0
- package/dist/rules/prefer-ts-extras-as-writable.js.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-defined.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-assert-defined.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-defined.js +182 -0
- package/dist/rules/prefer-ts-extras-assert-defined.js.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-error.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-assert-error.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-error.js +152 -0
- package/dist/rules/prefer-ts-extras-assert-error.js.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-present.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-assert-present.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-assert-present.js +266 -0
- package/dist/rules/prefer-ts-extras-assert-present.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-defined-filter.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-defined-filter.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-defined-filter.js +90 -0
- package/dist/rules/prefer-ts-extras-is-defined-filter.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-defined.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-defined.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-defined.js +179 -0
- package/dist/rules/prefer-ts-extras-is-defined.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-empty.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-empty.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-empty.js +116 -0
- package/dist/rules/prefer-ts-extras-is-empty.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-equal-type.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-equal-type.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-equal-type.js +138 -0
- package/dist/rules/prefer-ts-extras-is-equal-type.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-finite.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-finite.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-finite.js +61 -0
- package/dist/rules/prefer-ts-extras-is-finite.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-infinite.d.ts +8 -0
- package/dist/rules/prefer-ts-extras-is-infinite.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-infinite.js +178 -0
- package/dist/rules/prefer-ts-extras-is-infinite.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-integer.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-integer.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-integer.js +61 -0
- package/dist/rules/prefer-ts-extras-is-integer.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-present-filter.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-present-filter.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-present-filter.js +216 -0
- package/dist/rules/prefer-ts-extras-is-present-filter.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-present.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-present.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-present.js +217 -0
- package/dist/rules/prefer-ts-extras-is-present.js.map +1 -0
- package/dist/rules/prefer-ts-extras-is-safe-integer.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-is-safe-integer.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-is-safe-integer.js +61 -0
- package/dist/rules/prefer-ts-extras-is-safe-integer.js.map +1 -0
- package/dist/rules/prefer-ts-extras-key-in.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-key-in.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-key-in.js +124 -0
- package/dist/rules/prefer-ts-extras-key-in.js.map +1 -0
- package/dist/rules/prefer-ts-extras-not.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-not.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-not.js +136 -0
- package/dist/rules/prefer-ts-extras-not.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-entries.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-entries.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-entries.js +59 -0
- package/dist/rules/prefer-ts-extras-object-entries.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-from-entries.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-from-entries.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-from-entries.js +59 -0
- package/dist/rules/prefer-ts-extras-object-from-entries.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-has-in.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-has-in.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-has-in.js +79 -0
- package/dist/rules/prefer-ts-extras-object-has-in.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-has-own.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-has-own.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-has-own.js +82 -0
- package/dist/rules/prefer-ts-extras-object-has-own.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-keys.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-keys.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-keys.js +59 -0
- package/dist/rules/prefer-ts-extras-object-keys.js.map +1 -0
- package/dist/rules/prefer-ts-extras-object-values.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-object-values.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-object-values.js +59 -0
- package/dist/rules/prefer-ts-extras-object-values.js.map +1 -0
- package/dist/rules/prefer-ts-extras-safe-cast-to.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-safe-cast-to.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-safe-cast-to.js +159 -0
- package/dist/rules/prefer-ts-extras-safe-cast-to.js.map +1 -0
- package/dist/rules/prefer-ts-extras-set-has.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-set-has.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-set-has.js +304 -0
- package/dist/rules/prefer-ts-extras-set-has.js.map +1 -0
- package/dist/rules/prefer-ts-extras-string-split.d.ts +13 -0
- package/dist/rules/prefer-ts-extras-string-split.d.ts.map +1 -0
- package/dist/rules/prefer-ts-extras-string-split.js +166 -0
- package/dist/rules/prefer-ts-extras-string-split.js.map +1 -0
- package/dist/rules/prefer-type-fest-abstract-constructor.d.ts +13 -0
- package/dist/rules/prefer-type-fest-abstract-constructor.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-abstract-constructor.js +65 -0
- package/dist/rules/prefer-type-fest-abstract-constructor.js.map +1 -0
- package/dist/rules/prefer-type-fest-arrayable.d.ts +13 -0
- package/dist/rules/prefer-type-fest-arrayable.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-arrayable.js +123 -0
- package/dist/rules/prefer-type-fest-arrayable.js.map +1 -0
- package/dist/rules/prefer-type-fest-async-return-type.d.ts +13 -0
- package/dist/rules/prefer-type-fest-async-return-type.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-async-return-type.js +92 -0
- package/dist/rules/prefer-type-fest-async-return-type.js.map +1 -0
- package/dist/rules/prefer-type-fest-conditional-pick.d.ts +13 -0
- package/dist/rules/prefer-type-fest-conditional-pick.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-conditional-pick.js +74 -0
- package/dist/rules/prefer-type-fest-conditional-pick.js.map +1 -0
- package/dist/rules/prefer-type-fest-constructor.d.ts +13 -0
- package/dist/rules/prefer-type-fest-constructor.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-constructor.js +67 -0
- package/dist/rules/prefer-type-fest-constructor.js.map +1 -0
- package/dist/rules/prefer-type-fest-except.d.ts +13 -0
- package/dist/rules/prefer-type-fest-except.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-except.js +105 -0
- package/dist/rules/prefer-type-fest-except.js.map +1 -0
- package/dist/rules/prefer-type-fest-if.d.ts +13 -0
- package/dist/rules/prefer-type-fest-if.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-if.js +79 -0
- package/dist/rules/prefer-type-fest-if.js.map +1 -0
- package/dist/rules/prefer-type-fest-iterable-element.d.ts +13 -0
- package/dist/rules/prefer-type-fest-iterable-element.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-iterable-element.js +76 -0
- package/dist/rules/prefer-type-fest-iterable-element.js.map +1 -0
- package/dist/rules/prefer-type-fest-json-array.d.ts +13 -0
- package/dist/rules/prefer-type-fest-json-array.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-json-array.js +164 -0
- package/dist/rules/prefer-type-fest-json-array.js.map +1 -0
- package/dist/rules/prefer-type-fest-json-object.d.ts +13 -0
- package/dist/rules/prefer-type-fest-json-object.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-json-object.js +102 -0
- package/dist/rules/prefer-type-fest-json-object.js.map +1 -0
- package/dist/rules/prefer-type-fest-json-primitive.d.ts +13 -0
- package/dist/rules/prefer-type-fest-json-primitive.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-json-primitive.js +112 -0
- package/dist/rules/prefer-type-fest-json-primitive.js.map +1 -0
- package/dist/rules/prefer-type-fest-json-value.d.ts +13 -0
- package/dist/rules/prefer-type-fest-json-value.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-json-value.js +109 -0
- package/dist/rules/prefer-type-fest-json-value.js.map +1 -0
- package/dist/rules/prefer-type-fest-keys-of-union.d.ts +13 -0
- package/dist/rules/prefer-type-fest-keys-of-union.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-keys-of-union.js +74 -0
- package/dist/rules/prefer-type-fest-keys-of-union.js.map +1 -0
- package/dist/rules/prefer-type-fest-literal-union.d.ts +13 -0
- package/dist/rules/prefer-type-fest-literal-union.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-literal-union.js +181 -0
- package/dist/rules/prefer-type-fest-literal-union.js.map +1 -0
- package/dist/rules/prefer-type-fest-merge-exclusive.d.ts +13 -0
- package/dist/rules/prefer-type-fest-merge-exclusive.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-merge-exclusive.js +63 -0
- package/dist/rules/prefer-type-fest-merge-exclusive.js.map +1 -0
- package/dist/rules/prefer-type-fest-non-empty-tuple.d.ts +13 -0
- package/dist/rules/prefer-type-fest-non-empty-tuple.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-non-empty-tuple.js +133 -0
- package/dist/rules/prefer-type-fest-non-empty-tuple.js.map +1 -0
- package/dist/rules/prefer-type-fest-omit-index-signature.d.ts +13 -0
- package/dist/rules/prefer-type-fest-omit-index-signature.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-omit-index-signature.js +74 -0
- package/dist/rules/prefer-type-fest-omit-index-signature.js.map +1 -0
- package/dist/rules/prefer-type-fest-partial-deep.d.ts +13 -0
- package/dist/rules/prefer-type-fest-partial-deep.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-partial-deep.js +63 -0
- package/dist/rules/prefer-type-fest-partial-deep.js.map +1 -0
- package/dist/rules/prefer-type-fest-primitive.d.ts +13 -0
- package/dist/rules/prefer-type-fest-primitive.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-primitive.js +102 -0
- package/dist/rules/prefer-type-fest-primitive.js.map +1 -0
- package/dist/rules/prefer-type-fest-promisable.d.ts +13 -0
- package/dist/rules/prefer-type-fest-promisable.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-promisable.js +167 -0
- package/dist/rules/prefer-type-fest-promisable.js.map +1 -0
- package/dist/rules/prefer-type-fest-readonly-deep.d.ts +13 -0
- package/dist/rules/prefer-type-fest-readonly-deep.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-readonly-deep.js +63 -0
- package/dist/rules/prefer-type-fest-readonly-deep.js.map +1 -0
- package/dist/rules/prefer-type-fest-require-all-or-none.d.ts +13 -0
- package/dist/rules/prefer-type-fest-require-all-or-none.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-require-all-or-none.js +75 -0
- package/dist/rules/prefer-type-fest-require-all-or-none.js.map +1 -0
- package/dist/rules/prefer-type-fest-require-at-least-one.d.ts +13 -0
- package/dist/rules/prefer-type-fest-require-at-least-one.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-require-at-least-one.js +74 -0
- package/dist/rules/prefer-type-fest-require-at-least-one.js.map +1 -0
- package/dist/rules/prefer-type-fest-require-exactly-one.d.ts +13 -0
- package/dist/rules/prefer-type-fest-require-exactly-one.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-require-exactly-one.js +102 -0
- package/dist/rules/prefer-type-fest-require-exactly-one.js.map +1 -0
- package/dist/rules/prefer-type-fest-require-one-or-none.d.ts +13 -0
- package/dist/rules/prefer-type-fest-require-one-or-none.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-require-one-or-none.js +74 -0
- package/dist/rules/prefer-type-fest-require-one-or-none.js.map +1 -0
- package/dist/rules/prefer-type-fest-required-deep.d.ts +13 -0
- package/dist/rules/prefer-type-fest-required-deep.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-required-deep.js +63 -0
- package/dist/rules/prefer-type-fest-required-deep.js.map +1 -0
- package/dist/rules/prefer-type-fest-schema.d.ts +13 -0
- package/dist/rules/prefer-type-fest-schema.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-schema.js +74 -0
- package/dist/rules/prefer-type-fest-schema.js.map +1 -0
- package/dist/rules/prefer-type-fest-set-non-nullable.d.ts +13 -0
- package/dist/rules/prefer-type-fest-set-non-nullable.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-set-non-nullable.js +74 -0
- package/dist/rules/prefer-type-fest-set-non-nullable.js.map +1 -0
- package/dist/rules/prefer-type-fest-set-optional.d.ts +13 -0
- package/dist/rules/prefer-type-fest-set-optional.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-set-optional.js +74 -0
- package/dist/rules/prefer-type-fest-set-optional.js.map +1 -0
- package/dist/rules/prefer-type-fest-set-readonly.d.ts +13 -0
- package/dist/rules/prefer-type-fest-set-readonly.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-set-readonly.js +74 -0
- package/dist/rules/prefer-type-fest-set-readonly.js.map +1 -0
- package/dist/rules/prefer-type-fest-set-required.d.ts +13 -0
- package/dist/rules/prefer-type-fest-set-required.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-set-required.js +74 -0
- package/dist/rules/prefer-type-fest-set-required.js.map +1 -0
- package/dist/rules/prefer-type-fest-simplify.d.ts +13 -0
- package/dist/rules/prefer-type-fest-simplify.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-simplify.js +75 -0
- package/dist/rules/prefer-type-fest-simplify.js.map +1 -0
- package/dist/rules/prefer-type-fest-tagged-brands.d.ts +13 -0
- package/dist/rules/prefer-type-fest-tagged-brands.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-tagged-brands.js +174 -0
- package/dist/rules/prefer-type-fest-tagged-brands.js.map +1 -0
- package/dist/rules/prefer-type-fest-tuple-of.d.ts +14 -0
- package/dist/rules/prefer-type-fest-tuple-of.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-tuple-of.js +132 -0
- package/dist/rules/prefer-type-fest-tuple-of.js.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-array.d.ts +13 -0
- package/dist/rules/prefer-type-fest-unknown-array.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-array.js +111 -0
- package/dist/rules/prefer-type-fest-unknown-array.js.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-map.d.ts +13 -0
- package/dist/rules/prefer-type-fest-unknown-map.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-map.js +82 -0
- package/dist/rules/prefer-type-fest-unknown-map.js.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-record.d.ts +13 -0
- package/dist/rules/prefer-type-fest-unknown-record.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-record.js +77 -0
- package/dist/rules/prefer-type-fest-unknown-record.js.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-set.d.ts +13 -0
- package/dist/rules/prefer-type-fest-unknown-set.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-unknown-set.js +81 -0
- package/dist/rules/prefer-type-fest-unknown-set.js.map +1 -0
- package/dist/rules/prefer-type-fest-unwrap-tagged.d.ts +13 -0
- package/dist/rules/prefer-type-fest-unwrap-tagged.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-unwrap-tagged.js +74 -0
- package/dist/rules/prefer-type-fest-unwrap-tagged.js.map +1 -0
- package/dist/rules/prefer-type-fest-value-of.d.ts +13 -0
- package/dist/rules/prefer-type-fest-value-of.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-value-of.js +74 -0
- package/dist/rules/prefer-type-fest-value-of.js.map +1 -0
- package/dist/rules/prefer-type-fest-writable-deep.d.ts +13 -0
- package/dist/rules/prefer-type-fest-writable-deep.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-writable-deep.js +64 -0
- package/dist/rules/prefer-type-fest-writable-deep.js.map +1 -0
- package/dist/rules/prefer-type-fest-writable.d.ts +13 -0
- package/dist/rules/prefer-type-fest-writable.d.ts.map +1 -0
- package/dist/rules/prefer-type-fest-writable.js +129 -0
- package/dist/rules/prefer-type-fest-writable.js.map +1 -0
- package/docs/rules/getting-started.md +74 -0
- package/docs/rules/guides/adoption-checklist.md +37 -0
- package/docs/rules/guides/preset-selection-strategy.md +87 -0
- package/docs/rules/guides/rollout-and-fix-safety.md +42 -0
- package/docs/rules/guides/snapshot-testing.md +121 -0
- package/docs/rules/guides/type-aware-linting-readiness.md +105 -0
- package/docs/rules/overview.md +49 -0
- package/docs/rules/prefer-ts-extras-array-at.md +132 -0
- package/docs/rules/prefer-ts-extras-array-concat.md +138 -0
- package/docs/rules/prefer-ts-extras-array-find-last-index.md +108 -0
- package/docs/rules/prefer-ts-extras-array-find-last.md +108 -0
- package/docs/rules/prefer-ts-extras-array-find.md +108 -0
- package/docs/rules/prefer-ts-extras-array-first.md +132 -0
- package/docs/rules/prefer-ts-extras-array-includes.md +135 -0
- package/docs/rules/prefer-ts-extras-array-join.md +132 -0
- package/docs/rules/prefer-ts-extras-array-last.md +132 -0
- package/docs/rules/prefer-ts-extras-as-writable.md +124 -0
- package/docs/rules/prefer-ts-extras-assert-defined.md +140 -0
- package/docs/rules/prefer-ts-extras-assert-error.md +147 -0
- package/docs/rules/prefer-ts-extras-assert-present.md +139 -0
- package/docs/rules/prefer-ts-extras-is-defined-filter.md +125 -0
- package/docs/rules/prefer-ts-extras-is-defined.md +147 -0
- package/docs/rules/prefer-ts-extras-is-empty.md +142 -0
- package/docs/rules/prefer-ts-extras-is-equal-type.md +144 -0
- package/docs/rules/prefer-ts-extras-is-finite.md +116 -0
- package/docs/rules/prefer-ts-extras-is-infinite.md +134 -0
- package/docs/rules/prefer-ts-extras-is-integer.md +116 -0
- package/docs/rules/prefer-ts-extras-is-present-filter.md +125 -0
- package/docs/rules/prefer-ts-extras-is-present.md +143 -0
- package/docs/rules/prefer-ts-extras-is-safe-integer.md +116 -0
- package/docs/rules/prefer-ts-extras-key-in.md +150 -0
- package/docs/rules/prefer-ts-extras-not.md +138 -0
- package/docs/rules/prefer-ts-extras-object-entries.md +130 -0
- package/docs/rules/prefer-ts-extras-object-from-entries.md +131 -0
- package/docs/rules/prefer-ts-extras-object-has-in.md +141 -0
- package/docs/rules/prefer-ts-extras-object-has-own.md +137 -0
- package/docs/rules/prefer-ts-extras-object-keys.md +127 -0
- package/docs/rules/prefer-ts-extras-object-values.md +128 -0
- package/docs/rules/prefer-ts-extras-safe-cast-to.md +130 -0
- package/docs/rules/prefer-ts-extras-set-has.md +203 -0
- package/docs/rules/prefer-ts-extras-string-split.md +133 -0
- package/docs/rules/prefer-type-fest-abstract-constructor.md +87 -0
- package/docs/rules/prefer-type-fest-arrayable.md +127 -0
- package/docs/rules/prefer-type-fest-async-return-type.md +117 -0
- package/docs/rules/prefer-type-fest-conditional-pick.md +140 -0
- package/docs/rules/prefer-type-fest-constructor.md +87 -0
- package/docs/rules/prefer-type-fest-except.md +231 -0
- package/docs/rules/prefer-type-fest-if.md +217 -0
- package/docs/rules/prefer-type-fest-iterable-element.md +170 -0
- package/docs/rules/prefer-type-fest-json-array.md +107 -0
- package/docs/rules/prefer-type-fest-json-object.md +107 -0
- package/docs/rules/prefer-type-fest-json-primitive.md +105 -0
- package/docs/rules/prefer-type-fest-json-value.md +107 -0
- package/docs/rules/prefer-type-fest-keys-of-union.md +139 -0
- package/docs/rules/prefer-type-fest-literal-union.md +118 -0
- package/docs/rules/prefer-type-fest-merge-exclusive.md +118 -0
- package/docs/rules/prefer-type-fest-non-empty-tuple.md +115 -0
- package/docs/rules/prefer-type-fest-omit-index-signature.md +196 -0
- package/docs/rules/prefer-type-fest-partial-deep.md +133 -0
- package/docs/rules/prefer-type-fest-primitive.md +106 -0
- package/docs/rules/prefer-type-fest-promisable.md +246 -0
- package/docs/rules/prefer-type-fest-readonly-deep.md +151 -0
- package/docs/rules/prefer-type-fest-require-all-or-none.md +149 -0
- package/docs/rules/prefer-type-fest-require-at-least-one.md +155 -0
- package/docs/rules/prefer-type-fest-require-exactly-one.md +240 -0
- package/docs/rules/prefer-type-fest-require-one-or-none.md +165 -0
- package/docs/rules/prefer-type-fest-required-deep.md +123 -0
- package/docs/rules/prefer-type-fest-schema.md +161 -0
- package/docs/rules/prefer-type-fest-set-non-nullable.md +145 -0
- package/docs/rules/prefer-type-fest-set-optional.md +133 -0
- package/docs/rules/prefer-type-fest-set-readonly.md +136 -0
- package/docs/rules/prefer-type-fest-set-required.md +140 -0
- package/docs/rules/prefer-type-fest-simplify.md +168 -0
- package/docs/rules/prefer-type-fest-tagged-brands.md +278 -0
- package/docs/rules/prefer-type-fest-tuple-of.md +250 -0
- package/docs/rules/prefer-type-fest-unknown-array.md +126 -0
- package/docs/rules/prefer-type-fest-unknown-map.md +123 -0
- package/docs/rules/prefer-type-fest-unknown-record.md +130 -0
- package/docs/rules/prefer-type-fest-unknown-set.md +123 -0
- package/docs/rules/prefer-type-fest-unwrap-tagged.md +133 -0
- package/docs/rules/prefer-type-fest-value-of.md +121 -0
- package/docs/rules/prefer-type-fest-writable-deep.md +113 -0
- package/docs/rules/prefer-type-fest-writable.md +139 -0
- package/docs/rules/presets/all.md +102 -0
- package/docs/rules/presets/index.md +124 -0
- package/docs/rules/presets/minimal.md +37 -0
- package/docs/rules/presets/recommended-type-checked.md +37 -0
- package/docs/rules/presets/recommended.md +116 -0
- package/docs/rules/presets/strict.md +98 -0
- package/docs/rules/presets/ts-extras-type-guards.md +45 -0
- package/docs/rules/presets/type-fest-types.md +68 -0
- package/package.json +574 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/plugin.ts", "../package.json", "../src/_internal/rule-docs-metadata.ts", "../src/_internal/rule-docs-url.ts", "../src/_internal/typefest-config-references.ts", "../src/_internal/array-like-expression.ts", "../src/_internal/ast-node.ts", "../src/_internal/cycle-safe-linked-search.ts", "../src/_internal/constrained-type-at-location.ts", "../src/_internal/safe-type-operation.ts", "../src/_internal/type-checker-compat.ts", "../src/_internal/typed-path-telemetry.ts", "../src/_internal/set-membership.ts", "../src/_internal/imported-value-symbols.ts", "../src/_internal/import-analysis.ts", "../src/_internal/import-aware-fixes.ts", "../src/_internal/import-fix-coordinator.ts", "../src/_internal/plugin-settings.ts", "../src/_internal/import-insertion.ts", "../src/_internal/bounded-cache.ts", "../src/_internal/text-character.ts", "../src/_internal/scope-resolution.ts", "../src/_internal/scope-variable.ts", "../src/_internal/member-call.ts", "../src/_internal/module-source.ts", "../src/_internal/report-adapter.ts", "../src/_internal/rule-reporting.ts", "../src/_internal/array-method-call-rule.ts", "../src/_internal/typed-rule.ts", "../src/_internal/rule-catalog.ts", "../src/rules/prefer-ts-extras-array-at.ts", "../src/rules/prefer-ts-extras-array-concat.ts", "../src/rules/prefer-ts-extras-array-find-last-index.ts", "../src/rules/prefer-ts-extras-array-find-last.ts", "../src/rules/prefer-ts-extras-array-find.ts", "../src/rules/prefer-ts-extras-array-first.ts", "../src/_internal/value-rewrite-autofix-safety.ts", "../src/_internal/type-predicate-autofix-safety.ts", "../src/rules/prefer-ts-extras-array-includes.ts", "../src/rules/prefer-ts-extras-array-join.ts", "../src/rules/prefer-ts-extras-array-last.ts", "../src/_internal/normalize-expression-text.ts", "../src/_internal/imported-type-aliases.ts", "../src/rules/prefer-ts-extras-as-writable.ts", "../src/_internal/throw-consequent.ts", "../src/_internal/throw-type-error.ts", "../src/rules/prefer-ts-extras-assert-defined.ts", "../src/rules/prefer-ts-extras-assert-error.ts", "../src/rules/prefer-ts-extras-assert-present.ts", "../src/_internal/filter-callback.ts", "../src/_internal/nullish-comparison.ts", "../src/rules/prefer-ts-extras-is-defined-filter.ts", "../src/_internal/typescript-eslint-node-autofix.ts", "../src/rules/prefer-ts-extras-is-defined.ts", "../src/rules/prefer-ts-extras-is-empty.ts", "../src/rules/prefer-ts-extras-is-equal-type.ts", "../src/_internal/global-identifier-member-call.ts", "../src/_internal/global-member-call-rule.ts", "../src/rules/prefer-ts-extras-is-finite.ts", "../src/rules/prefer-ts-extras-is-infinite.ts", "../src/rules/prefer-ts-extras-is-integer.ts", "../src/rules/prefer-ts-extras-is-present-filter.ts", "../src/rules/prefer-ts-extras-is-present.ts", "../src/rules/prefer-ts-extras-is-safe-integer.ts", "../src/rules/prefer-ts-extras-key-in.ts", "../src/rules/prefer-ts-extras-not.ts", "../src/rules/prefer-ts-extras-object-entries.ts", "../src/rules/prefer-ts-extras-object-from-entries.ts", "../src/rules/prefer-ts-extras-object-has-in.ts", "../src/rules/prefer-ts-extras-object-has-own.ts", "../src/rules/prefer-ts-extras-object-keys.ts", "../src/rules/prefer-ts-extras-object-values.ts", "../src/rules/prefer-ts-extras-safe-cast-to.ts", "../src/rules/prefer-ts-extras-set-has.ts", "../src/_internal/typed-member-call-rule.ts", "../src/rules/prefer-ts-extras-string-split.ts", "../src/_internal/expression-boolean-memoizer.ts", "../src/rules/prefer-type-fest-abstract-constructor.ts", "../src/_internal/type-reference-node.ts", "../src/rules/prefer-type-fest-arrayable.ts", "../src/rules/prefer-type-fest-async-return-type.ts", "../src/rules/prefer-type-fest-conditional-pick.ts", "../src/rules/prefer-type-fest-constructor.ts", "../src/rules/prefer-type-fest-except.ts", "../src/rules/prefer-type-fest-if.ts", "../src/rules/prefer-type-fest-iterable-element.ts", "../src/rules/prefer-type-fest-json-array.ts", "../src/rules/prefer-type-fest-json-object.ts", "../src/rules/prefer-type-fest-json-primitive.ts", "../src/rules/prefer-type-fest-json-value.ts", "../src/rules/prefer-type-fest-keys-of-union.ts", "../src/rules/prefer-type-fest-literal-union.ts", "../src/rules/prefer-type-fest-merge-exclusive.ts", "../src/rules/prefer-type-fest-non-empty-tuple.ts", "../src/rules/prefer-type-fest-omit-index-signature.ts", "../src/rules/prefer-type-fest-partial-deep.ts", "../src/rules/prefer-type-fest-primitive.ts", "../src/rules/prefer-type-fest-promisable.ts", "../src/rules/prefer-type-fest-readonly-deep.ts", "../src/rules/prefer-type-fest-require-all-or-none.ts", "../src/rules/prefer-type-fest-require-at-least-one.ts", "../src/rules/prefer-type-fest-require-exactly-one.ts", "../src/rules/prefer-type-fest-require-one-or-none.ts", "../src/rules/prefer-type-fest-required-deep.ts", "../src/rules/prefer-type-fest-schema.ts", "../src/rules/prefer-type-fest-set-non-nullable.ts", "../src/rules/prefer-type-fest-set-optional.ts", "../src/rules/prefer-type-fest-set-readonly.ts", "../src/rules/prefer-type-fest-set-required.ts", "../src/rules/prefer-type-fest-simplify.ts", "../src/rules/prefer-type-fest-tagged-brands.ts", "../src/rules/prefer-type-fest-tuple-of.ts", "../src/rules/prefer-type-fest-unknown-array.ts", "../src/rules/prefer-type-fest-unknown-map.ts", "../src/rules/prefer-type-fest-unknown-record.ts", "../src/rules/prefer-type-fest-unknown-set.ts", "../src/rules/prefer-type-fest-unwrap-tagged.ts", "../src/rules/prefer-type-fest-value-of.ts", "../src/rules/prefer-type-fest-writable-deep.ts", "../src/rules/prefer-type-fest-writable.ts", "../src/_internal/rules-registry.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @packageDocumentation\n * Public plugin entrypoint for eslint-plugin-typefest exports and preset wiring.\n */\nimport type { ESLint, Linter } from \"eslint\";\nimport type { Except } from \"type-fest\";\n\nimport typeScriptParser from \"@typescript-eslint/parser\";\nimport {\n isDefined,\n isEmpty,\n objectEntries,\n objectHasIn,\n safeCastTo,\n setHas,\n} from \"ts-extras\";\n\nimport packageJson from \"../package.json\" with { type: \"json\" };\nimport {\n deriveRuleDocsMetadataByName,\n deriveRulePresetMembershipByRuleName,\n deriveTypeCheckedRuleNameSet,\n} from \"./_internal/rule-docs-metadata.js\";\nimport { typefestRules } from \"./_internal/rules-registry.js\";\nimport {\n type TypefestConfigName as InternalTypefestConfigName,\n typefestConfigMetadataByName,\n typefestConfigNames,\n} from \"./_internal/typefest-config-references.js\";\n\n/** ESLint severity used by generated preset rule maps. */\nconst ERROR_SEVERITY = \"error\" as const;\n\n/** Default file globs targeted by plugin presets when `files` is omitted. */\nconst TYPE_SCRIPT_FILES = [\"**/*.{ts,tsx,mts,cts}\"] as const;\n\n/**\n * Canonical flat-config preset keys exposed through `plugin.configs`.\n *\n * @remarks\n * These names are used by consumers when composing presets in ESLint flat\n * config arrays.\n */\nexport type TypefestConfigName = InternalTypefestConfigName;\n\n/**\n * Flat-config preset shape produced by this plugin.\n *\n * @remarks\n * The `rules` map is required so preset composition can always merge concrete\n * rule severity entries without additional null checks.\n */\nexport type TypefestPresetConfig = Linter.Config & {\n rules: NonNullable<Linter.Config[\"rules\"]>;\n};\n\n/** Internal alias for flat config objects handled by preset builders. */\ntype FlatConfig = Linter.Config;\n\n/** Normalized language-options shape for preset composition helpers. */\ntype FlatLanguageOptions = NonNullable<FlatConfig[\"languageOptions\"]>;\n\n/** Normalized parser-options shape for preset composition helpers. */\ntype FlatParserOptions = NonNullable<FlatLanguageOptions[\"parserOptions\"]>;\n\n/** Rule-map type used by preset rule-list expansion helpers. */\ntype RulesConfig = TypefestPresetConfig[\"rules\"];\n\n/** Contract for the `configs` object exported by this plugin. */\ntype TypefestConfigsContract = Record<TypefestConfigName, TypefestPresetConfig>;\n\n/** Fully assembled plugin contract used by the runtime default export. */\ntype TypefestPluginContract = Except<ESLint.Plugin, \"configs\" | \"rules\"> & {\n configs: TypefestConfigsContract;\n meta: {\n name: string;\n namespace: string;\n version: string;\n };\n processors: NonNullable<ESLint.Plugin[\"processors\"]>;\n rules: NonNullable<ESLint.Plugin[\"rules\"]>;\n};\n\n/**\n * Resolve package version from package.json data.\n *\n * @param pkg - Parsed package metadata value.\n *\n * @returns The package version, or `0.0.0` when unavailable.\n */\nfunction getPackageVersion(pkg: unknown): string {\n if (typeof pkg !== \"object\" || pkg === null) {\n return \"0.0.0\";\n }\n\n const version = Reflect.get(pkg, \"version\");\n\n return typeof version === \"string\" ? version : \"0.0.0\";\n}\n\n/** Package metadata used to populate plugin runtime `meta.version`. */\nconst packageJsonValue = safeCastTo<unknown>(packageJson);\n\n/** Parser module reused across preset construction. */\nconst typeScriptParserValue: FlatLanguageOptions[\"parser\"] = typeScriptParser;\n\n/** Default parser options applied when a preset omits parser options. */\nconst defaultParserOptions = {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n} satisfies FlatParserOptions;\n\n/**\n * Normalize unknown parser options into a mutable parser-options object.\n */\nconst normalizeParserOptions = (\n parserOptions: FlatLanguageOptions[\"parserOptions\"]\n): FlatParserOptions =>\n parserOptions !== null &&\n typeof parserOptions === \"object\" &&\n !Array.isArray(parserOptions)\n ? { ...parserOptions }\n : { ...defaultParserOptions };\n\n/**\n * Fully-qualified ESLint rule id used by this plugin.\n *\n * @remarks\n * Consumers typically use this when building strongly typed rule maps or helper\n * utilities that require namespaced rule identifiers.\n */\nexport type TypefestRuleId = `typefest/${TypefestRuleName}`;\n\n/** Unqualified rule name supported by `eslint-plugin-typefest`. */\nexport type TypefestRuleName = keyof typeof typefestRules;\n\n/**\n * ESLint-compatible rule map view of the strongly typed internal rule record.\n */\nconst typefestEslintRules: NonNullable<ESLint.Plugin[\"rules\"]> &\n typeof typefestRules = typefestRules as NonNullable<\n ESLint.Plugin[\"rules\"]\n> &\n typeof typefestRules;\n\nconst isTypefestRuleName = (value: string): value is TypefestRuleName =>\n objectHasIn(typefestRules, value);\n\nconst typefestRuleEntries: readonly (readonly [\n TypefestRuleName,\n (typeof typefestRules)[TypefestRuleName],\n])[] = (() => {\n const entries: (readonly [\n TypefestRuleName,\n (typeof typefestRules)[TypefestRuleName],\n ])[] = [];\n\n for (const [ruleName] of objectEntries(typefestRules)) {\n if (!isTypefestRuleName(ruleName)) {\n continue;\n }\n\n const ruleDefinition = typefestRules[ruleName];\n\n if (ruleDefinition === undefined) {\n continue;\n }\n\n entries.push([ruleName, ruleDefinition]);\n }\n\n return entries;\n})();\n\nconst ruleDocsMetadataByRuleName = deriveRuleDocsMetadataByName(typefestRules);\nconst rulePresetMembership = deriveRulePresetMembershipByRuleName(\n ruleDocsMetadataByRuleName\n);\nconst typeCheckedRuleNames = deriveTypeCheckedRuleNameSet(\n ruleDocsMetadataByRuleName\n);\n\nconst createEmptyPresetRuleMap = (): Record<\n TypefestConfigName,\n TypefestRuleName[]\n> => {\n const presetRuleMap = {} as Record<TypefestConfigName, TypefestRuleName[]>;\n\n for (const configName of typefestConfigNames) {\n presetRuleMap[configName] = [];\n }\n\n return presetRuleMap;\n};\n\nconst dedupeRuleNames = (\n ruleNames: readonly TypefestRuleName[]\n): TypefestRuleName[] => [...new Set(ruleNames)];\n\nconst derivePresetRuleNamesByConfig = (): Readonly<\n Record<TypefestConfigName, readonly TypefestRuleName[]>\n> => {\n const presetRuleNamesByConfig = createEmptyPresetRuleMap();\n\n for (const [ruleName] of typefestRuleEntries) {\n const configNames = rulePresetMembership[ruleName];\n\n if (!isDefined(configNames) || isEmpty(configNames)) {\n throw new TypeError(\n `Rule '${ruleName}' is missing preset membership metadata.`\n );\n }\n\n for (const configName of configNames) {\n presetRuleNamesByConfig[configName].push(ruleName);\n }\n }\n\n return {\n all: dedupeRuleNames(presetRuleNamesByConfig.all),\n minimal: dedupeRuleNames(presetRuleNamesByConfig.minimal),\n recommended: dedupeRuleNames(presetRuleNamesByConfig.recommended),\n \"recommended-type-checked\": dedupeRuleNames(\n presetRuleNamesByConfig[\"recommended-type-checked\"]\n ),\n strict: dedupeRuleNames(presetRuleNamesByConfig.strict),\n \"ts-extras/type-guards\": dedupeRuleNames(\n presetRuleNamesByConfig[\"ts-extras/type-guards\"]\n ),\n \"type-fest/types\": dedupeRuleNames(\n presetRuleNamesByConfig[\"type-fest/types\"]\n ),\n };\n};\n\n/**\n * Build an ESLint rules map that enables each provided rule at error level.\n *\n * @param ruleNames - Rule names to enable.\n *\n * @returns Rules config object compatible with flat config.\n */\nfunction errorRulesFor(ruleNames: readonly TypefestRuleName[]): RulesConfig {\n const rules: RulesConfig = {};\n\n for (const ruleName of ruleNames) {\n rules[`typefest/${ruleName}`] = ERROR_SEVERITY;\n }\n\n return rules;\n}\n\n/**\n * Remove duplicates while preserving first-seen ordering.\n *\n * @param ruleNames - Candidate rule list.\n *\n * @returns Deduplicated rule list.\n */\nconst presetRuleNamesByConfig = derivePresetRuleNamesByConfig();\n\n/** Recommended preset rule list for zero-type-info usage. */\nconst recommendedRuleNames: TypefestRuleName[] = [];\n\nfor (const ruleName of presetRuleNamesByConfig.recommended) {\n if (setHas(typeCheckedRuleNames, ruleName)) {\n continue;\n }\n\n recommendedRuleNames.push(ruleName);\n}\n\n/** Type-aware recommended preset rule list. */\nconst recommendedTypeCheckedRuleNames = dedupeRuleNames([\n ...recommendedRuleNames,\n ...presetRuleNamesByConfig[\"recommended-type-checked\"],\n]);\n\n/** Effective per-preset rule lists after applying derived policy overlays. */\nconst effectivePresetRuleNamesByConfig: Readonly<\n Record<TypefestConfigName, readonly TypefestRuleName[]>\n> = {\n ...presetRuleNamesByConfig,\n recommended: recommendedRuleNames,\n \"recommended-type-checked\": recommendedTypeCheckedRuleNames,\n};\n\n/**\n * Apply parser and plugin metadata required by all plugin presets.\n *\n * @param config - Preset-specific config fragment.\n * @param plugin - Plugin object registered under the `typefest` namespace.\n * @param options - Preset-level wiring options.\n *\n * @returns Normalized preset config.\n */\nfunction withTypefestPlugin(\n config: Readonly<TypefestPresetConfig>,\n plugin: Readonly<ESLint.Plugin>,\n options: Readonly<{ requiresTypeChecking: boolean }>\n): TypefestPresetConfig {\n const existingLanguageOptions = config.languageOptions ?? {};\n const existingParserOptions = existingLanguageOptions[\"parserOptions\"];\n const parserOptions = normalizeParserOptions(existingParserOptions);\n\n if (\n options.requiresTypeChecking &&\n !objectHasIn(parserOptions, \"projectService\")\n ) {\n Reflect.set(parserOptions, \"projectService\", true);\n }\n\n const languageOptions: FlatLanguageOptions = {\n ...existingLanguageOptions,\n parser: existingLanguageOptions[\"parser\"] ?? typeScriptParserValue,\n parserOptions,\n };\n\n return {\n ...config,\n files: config.files ?? [...TYPE_SCRIPT_FILES],\n languageOptions,\n plugins: {\n ...config.plugins,\n typefest: plugin,\n },\n };\n}\n\n/** Minimal plugin object used when assembling flat-config presets. */\nconst pluginForConfigs: ESLint.Plugin = {\n rules: typefestEslintRules,\n};\n\n/**\n * Flat config presets distributed by eslint-plugin-typefest.\n */\nconst createTypefestConfigsDefinition = (): TypefestConfigsContract => {\n const configs = {} as TypefestConfigsContract;\n\n for (const configName of typefestConfigNames) {\n const configMetadata = typefestConfigMetadataByName[configName];\n\n configs[configName] = withTypefestPlugin(\n {\n name: configMetadata.presetName,\n rules: errorRulesFor(\n effectivePresetRuleNamesByConfig[configName]\n ),\n },\n pluginForConfigs,\n {\n requiresTypeChecking: configMetadata.requiresTypeChecking,\n }\n );\n }\n\n return configs;\n};\n\nconst typefestConfigsDefinition = createTypefestConfigsDefinition();\n\n/** Finalized typed view of all exported preset configurations. */\nconst typefestConfigs: TypefestConfigsContract = typefestConfigsDefinition;\n\n/**\n * Runtime type for the plugin's generated config presets.\n *\n * @remarks\n * Mirrors `plugin.configs` and is useful when composing typed preset-aware\n * tooling in external integrations.\n */\nexport type TypefestConfigs = typeof typefestConfigs;\n\n/**\n * Main plugin object exported for ESLint consumption.\n */\nconst typefestPlugin: TypefestPluginContract = {\n configs: typefestConfigs,\n meta: {\n name: \"eslint-plugin-typefest\",\n namespace: \"typefest\",\n version: getPackageVersion(packageJsonValue),\n },\n processors: {},\n rules: typefestEslintRules,\n};\n\n/**\n * Runtime type for the plugin object exported as default.\n *\n * @remarks\n * Includes resolved `meta`, `rules`, and `configs` contracts after plugin\n * assembly.\n */\nexport type TypefestPlugin = typeof typefestPlugin;\n\n/**\n * Default plugin export consumed by ESLint flat config.\n */\nexport default typefestPlugin;\n", "{\n \"$schema\": \"https://www.schemastore.org/package.json\",\n \"name\": \"eslint-plugin-typefest\",\n \"version\": \"1.0.1\",\n \"private\": false,\n \"description\": \"ESLint rules for adopting type-fest and ts-extras conventions.\",\n \"keywords\": [\n \"eslint\",\n \"eslint-plugin\",\n \"eslintplugin\",\n \"type-fest\",\n \"ts-extras\",\n \"typescript\"\n ],\n \"homepage\": \"https://github.com/Nick2bad4u/eslint-plugin-typefest\",\n \"bugs\": {\n \"url\": \"https://github.com/Nick2bad4u/eslint-plugin-typefest/issues\",\n \"email\": \"20943337+Nick2bad4u@users.noreply.github.com\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/Nick2bad4u/eslint-plugin-typefest.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com> (https://nick2bad4u.github.io/eslint-plugin-typefest)\",\n \"contributors\": [\n {\n \"name\": \"Nick2bad4u\",\n \"email\": \"20943337+Nick2bad4u@users.noreply.github.com\",\n \"url\": \"https://nick2bad4u.github.io/eslint-plugin-typefest\"\n }\n ],\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/plugin.d.ts\",\n \"default\": \"./dist/plugin.js\"\n },\n \"require\": {\n \"types\": \"./dist/plugin.d.cts\",\n \"default\": \"./dist/plugin.cjs\"\n },\n \"default\": \"./dist/plugin.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/plugin.cjs\",\n \"types\": \"./dist/plugin.d.ts\",\n \"files\": [\n \"dist\",\n \"docs/rules/**\",\n \"CHANGELOG.md\"\n ],\n \"workspaces\": [\n \"docs/docusaurus\"\n ],\n \"scripts\": {\n \"prebench\": \"npm run build\",\n \"bench\": \"node benchmarks/run-eslint-stats.mjs\",\n \"prebench:compare\": \"npm run build\",\n \"bench:compare\": \"node benchmarks/run-eslint-stats.mjs --iterations=6 --warmup=2 --compare=coverage/benchmarks/eslint-stats.json\",\n \"prebench:eslint:stats\": \"npm run build\",\n \"bench:eslint:stats\": \"node benchmarks/run-eslint-stats.mjs\",\n \"prebench:eslint:timing\": \"npm run build\",\n \"bench:eslint:timing\": \"cross-env TIMING=all eslint --config benchmarks/eslint-timing.config.mjs --stats \\\"test/fixtures/typed/*.invalid.ts\\\"\",\n \"prebench:rule-benchmark\": \"npm run build\",\n \"bench:rule-benchmark\": \"eslint-rule-benchmark run\",\n \"prebench:ui\": \"npm run build\",\n \"bench:ui\": \"vitest bench --ui\",\n \"prebench:watch\": \"npm run build\",\n \"bench:watch\": \"vitest bench\",\n \"build\": \"tsc -p tsconfig.build.json && npm run build:types:cjs && npm run build:cjs\",\n \"build:cjs\": \"esbuild dist/plugin.js --bundle --format=cjs --platform=node --packages=external --sourcemap --outfile=dist/plugin.cjs --footer:js=\\\"module.exports = module.exports.default;\\\"\",\n \"build:clean\": \"node -e \\\"require('node:fs').rmSync('dist',{recursive:true,force:true})\\\"\",\n \"build:eslint-inspector\": \"npx @eslint/config-inspector build --outDir \\\"docs/docusaurus/static/eslint-inspector\\\" --base \\\"/eslint-plugin-typefest/eslint-inspector/\\\"\",\n \"build:eslint-inspector:local\": \"npx @eslint/config-inspector\",\n \"build:types:cjs\": \"node -e \\\"require('node:fs').copyFileSync('dist/plugin.d.ts','dist/plugin.d.cts')\\\"\",\n \"changelog:generate\": \"git-cliff --config cliff.toml --output CHANGELOG.md\",\n \"changelog:preview\": \"git-cliff --config cliff.toml --unreleased\",\n \"changelog:release-notes\": \"git-cliff --config cliff.toml --latest --strip all\",\n \"clean:cache\": \"rimraf dist coverage cache .cache .vite .turbo\",\n \"clean:cache:coverage\": \"rimraf coverage .coverage\",\n \"clean:cache:dist\": \"rimraf dist release\",\n \"clean:cache:eslint\": \"rimraf .cache/.eslintcache\",\n \"clean:cache:ncu\": \"rimraf .cache/.ncu-cache.json\",\n \"clean:cache:prettier\": \"rimraf .cache/.prettier-cache .prettier-cache .prettiercache\",\n \"clean:cache:stryker\": \"rimraf .stryker-tmp\",\n \"clean:cache:stylelint\": \"rimraf .cache/stylelintcache stylelintcache .stylelintcache\",\n \"clean:cache:temp\": \"rimraf \\\".temp/.**\\\" --glob\",\n \"clean:cache:typescript\": \"rimraf .cache/**.tsbuildinfo .cache/builds\",\n \"clean:cache:vite\": \"rimraf .cache/vite .cache/vitest .cache/vitest-zero-coverage .cache/vite-zero-coverage\",\n \"clean:database\": \"rimraf %appdata%/uptime-watcher/uptime-watcher.sqlite\",\n \"clean:docs\": \"rimraf docs/docusaurus/.docusaurus/** docs/docusaurus/build/** docs/docusaurus/site-docs/developer/api/**\",\n \"clean:docusaurus\": \"npm run clean:docs && npm run --workspace docs/docusaurus clear\",\n \"cognitive-complexity\": \"cognitive-complexity-ts --threshold 10\",\n \"commit\": \"git-cz\",\n \"contrib\": \"all-contributors\",\n \"contrib:add\": \"all-contributors add\",\n \"contrib:check\": \"all-contributors check\",\n \"contrib:compare\": \"npm run contrib:check\",\n \"contrib:generate\": \"all-contributors generate\",\n \"coverage\": \"vitest run --coverage\",\n \"docs:api\": \"npm run --workspace docs/docusaurus docs:api\",\n \"docs:api:local\": \"npm run --workspace docs/docusaurus docs:api:local\",\n \"docs:build\": \"npm run --workspace docs/docusaurus build\",\n \"docs:build:local\": \"npm run --workspace docs/docusaurus build:local\",\n \"docs:check-links\": \"npm run docs:api && node ./scripts/check-doc-links.mjs\",\n \"docs:serve\": \"npm run --workspace docs/docusaurus serve\",\n \"docs:start\": \"npm run --workspace docs/docusaurus start\",\n \"docs:toc\": \"remark docs --use remark-toc --output\",\n \"docs:typecheck\": \"npm run --workspace docs/docusaurus typecheck\",\n \"docs:typedoc\": \"npm run --workspace docs/docusaurus docs:api\",\n \"docs:typedoc:local\": \"npm run --workspace docs/docusaurus docs:api:local\",\n \"docs:validate-links\": \"remark docs --use remark-validate-links --frail\",\n \"knip\": \"cross-env NODE_OPTIONS=--max_old_space_size=4096 NODE_NO_WARNINGS=1 npx knip -c knip.config.ts --include-libs --cache --cache-location .cache/knip --tsConfig tsconfig.json\",\n \"lint\": \"cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache\",\n \"lint:action\": \"npm run lint:actions\",\n \"lint:actions\": \"node scripts/lint-actionlint.mjs\",\n \"lint:all\": \"npm run lint && npm run lint:css && npm run lint:prettier && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml && npm run lint:actions && npm run lint:circular\",\n \"lint:all:fix\": \"npm run lint:fix && npm run lint:css:fix && npm run lint:prettier:fix && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml:fix && npm run lint:actions && npm run lint:circular\",\n \"lint:all:fix:quiet\": \"npm run lint:fix:quiet && npm run lint:css:fix && npm run lint:prettier:fix && npm run lint:remark && npm run lint:package && npm run lint:secretlint && npm run lint:yaml:fix && npm run lint:actions && npm run lint:circular\",\n \"lint:circular\": \"npm run madge:circular\",\n \"lint:compat:eslint9\": \"node scripts/eslint9-compat-smoke.mjs\",\n \"lint:config:build\": \"npm run build:eslint-inspector\",\n \"lint:config:inspect\": \"npx eslint --inspect-config\",\n \"lint:css\": \"stylelint --cache --config stylelint.config.mjs --cache-strategy content --cache-location .cache/stylelintcache src/ docs/ --custom-formatter stylelint-formatter-pretty && echo \\\"Stylelint done!\\\"\",\n \"lint:css:fix\": \"stylelint --cache --config stylelint.config.mjs --cache-strategy content --cache-location .cache/stylelintcache src/ docs/ --custom-formatter stylelint-formatter-pretty --fix && echo \\\"Stylelint done!\\\"\",\n \"lint:depcheck\": \"depcheck\",\n \"lint:deps\": \"depcheck && npm run knip\",\n \"lint:dupes\": \"jscpd src/ --config jscpd.json\",\n \"lint:dupes:all\": \"jscpd src/ --config jscpd.json --min-lines 3\",\n \"lint:dupes:skiplocal\": \"jscpd src/ --skipLocal --config jscpd.json\",\n \"lint:dupes:skiplocal:all\": \"jscpd src/ --skipLocal --config jscpd.json --min-lines 3\",\n \"lint:duplicates\": \"npm run lint:dupes\",\n \"lint:exports\": \"ts-unused-exports tsconfig.json src/plugin.ts --excludePathsFromReport=plugin.ts\",\n \"lint:fix\": \"cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix\",\n \"lint:fix:quiet\": \"cross-env ESLINT_PROGRESS=off NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix && echo \\\"Eslint fix done!\\\"\",\n \"lint:grype\": \"grype . -c .grype.yaml --name eslint-plugin-typefest\",\n \"lint:knip\": \"npm run knip\",\n \"lint:knip:exports\": \"npm run knip -- --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\",\n \"lint:knip:unused:exports\": \"npm run knip -- --dependencies --exports\",\n \"lint:leaves\": \"npm run madge:leaves\",\n \"lint:metrics\": \"npm run sloc\",\n \"lint:orphans\": \"npm run madge:orphans\",\n \"lint:package\": \"npm run lint:package-sort && npm run lint:packagelintrc && echo \\\"Package.json lint done!\\\"\",\n \"lint:package:strict\": \"npm run lint:package-sort && npm run lint:package-check && npm run lint:packagelintrc && echo \\\"Package.json lint done!\\\"\",\n \"lint:package-check\": \"publint && attw --pack .\",\n \"lint:package-check:strict\": \"publint && attw --pack . --profile strict\",\n \"lint:package-sort\": \"sort-package-json \\\"./package.json\\\" \\\"./docs/docusaurus/package.json\\\"\",\n \"lint:package-sort-check\": \"sort-package-json --check \\\"./package.json\\\" \\\"./docs/docusaurus/package.json\\\"\",\n \"lint:packagelintrc\": \"npmPkgJsonLint . --config .npmpackagejsonlintrc.json\",\n \"lint:prettier\": \"prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --check\",\n \"lint:prettier:fix\": \"prettier . --log-level warn --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --write\",\n \"lint:publint\": \"publint\",\n \"lint:quiet\": \"cross-env ESLINT_PROGRESS=nofile NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache && echo \\\"Eslint done!\\\"\",\n \"lint:remark\": \"remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \\\"*.{md,mdx}\\\" \\\"docs/**/*.{md,mdx}\\\" --quiet\",\n \"lint:remark:fix\": \"prettier --log-level warn --ignore-path prettierignore.remark --cache --cache-location=.cache/.prettier-cache --cache-strategy=content --no-error-on-unmatched-pattern --write \\\"*.{md,mdx}\\\" \\\"docs/**/*.{md,mdx}\\\" && npm run remark:fix\",\n \"lint:secretlint\": \"secretlint --secretlintrc .secretlintrc.json --secretlintignore .secretlintignore \\\"./*\\\" \\\".vscode/**\\\" \\\"assets/**\\\" \\\"src/**\\\" \\\"electron/**\\\" \\\"shared/**\\\" \\\"config/**\\\" \\\"scripts/**\\\" \\\"playwright/**\\\" \\\"storybook/**\\\" \\\".storybook\\\" \\\"tests/**\\\" \\\"benchmarks/**\\\" \\\".devin/**\\\" \\\"public/**\\\" \\\".github/**\\\" \\\"docs/Architecture/**\\\" \\\"docs/*\\\" \\\"docs/assets/**\\\" \\\"docs/Guides/**\\\" \\\"docs/Testing/**\\\" \\\"docs/TSDoc/**\\\" \\\"docs/docusaurus/src/**\\\" \\\"docs/docusaurus/static/**\\\" \\\"docs/docusaurus/blog/**\\\" \\\"docs/docusaurus/docs/**\\\" \\\"docs/docusaurus/docs/*\\\"\",\n \"lint:secrets\": \"detect-secrets scan\",\n \"lint:unused\": \"npm run knip -- --include unlisted,unresolved,duplicates\",\n \"lint:unused-deps\": \"depcheck --ignores='@types/*,@testing-library/*,@vitest/*'\",\n \"lint:yaml\": \"cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache \\\"**/*.{yml,yaml}\\\" && echo \\\"YAML lint done!\\\"\",\n \"lint:yaml:fix\": \"cross-env NODE_OPTIONS=--max_old_space_size=16384 eslint --cache --cache-strategy content --cache-location .cache/.eslintcache --fix \\\"**/*.{yml,yaml}\\\" && echo \\\"YAML lint (fix) done!\\\"\",\n \"madge:circular\": \"madge --circular --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \\\"(^|[\\\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\\\/])|\\\\.css$\\\"\",\n \"madge:leaves\": \"madge --leaves --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \\\"(^|[\\\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\\\/])|\\\\.css$\\\"\",\n \"madge:orphans\": \"madge --orphans --no-spinner --ts-config tsconfig.json --extensions ts,tsx,js,jsx,mjs,cjs,cts,mts ./src --exclude \\\"(^|[\\\\/])(test|dist|node_modules|cache|.cache|coverage|build|eslint-inspector|temp|.docusaurus)($|[\\\\/])|\\\\.css$\\\"\",\n \"open:coverage\": \"open-cli coverage/index.html\",\n \"prepublishOnly\": \"npm run release:check\",\n \"release:check\": \"npm run release:verify\",\n \"release:verify\": \"npm run build && npm run lint && npm run typecheck && npm run test && npm run sync:readme-rules-table && npm run sync:presets-rules-matrix && npm run docs:check-links && npm pack --dry-run\",\n \"remark:fix\": \"remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail --quiet --output -- \\\"*.{md,mdx}\\\" \\\"docs/**/*.{md,mdx}\\\"\",\n \"remark:test-config\": \"remark --rc-path .remarkrc.mjs --silently-ignore --ignore-path .remarkignore --frail \\\"README.md\\\"\",\n \"sync:peer-eslint-range\": \"node scripts/sync-peer-eslint-range.mjs\",\n \"sync:presets-rules-matrix\": \"node scripts/sync-presets-rules-matrix.mjs\",\n \"sync:readme-rules-table\": \"node scripts/sync-readme-rules-table.mjs\",\n \"pretest\": \"npm run build\",\n \"test\": \"vitest run\",\n \"test:autofix:fixtures\": \"cross-env TYPEFEST_AUTOFIX_SMOKE=1 vitest run test/autofix-fixtures-all-rules-smoke.test.ts\",\n \"test:autofix:fixtures:typed\": \"cross-env TYPEFEST_AUTOFIX_SMOKE=1 TYPEFEST_AUTOFIX_FIXTURE_DIR=test/fixtures/typed vitest run test/autofix-fixtures-all-rules-smoke.test.ts\",\n \"test:ci\": \"cross-env CI=true vitest run --reporter=default\",\n \"test:coverage\": \"vitest run --coverage --reporter=default\",\n \"test:coverage:detailed\": \"vitest run --coverage --reporter=verbose\",\n \"test:coverage:minimal\": \"vitest run --coverage --reporter=dot\",\n \"test:coverage:open\": \"npm run test:coverage && npm run open:coverage\",\n \"test:coverage:quiet\": \"vitest run --coverage --reporter=default --silent\",\n \"test:coverage:verbose\": \"vitest run --coverage --reporter=verbose\",\n \"test:detailed\": \"vitest run --reporter=verbose\",\n \"test:minimal\": \"vitest run --reporter=dot\",\n \"test:open\": \"npm run test:coverage && npm run open:coverage\",\n \"test:quiet\": \"vitest run --reporter=default --silent\",\n \"test:serial\": \"cross-env MAX_THREADS=1 vitest run\",\n \"test:stryker\": \"stryker run --ignoreStatic --concurrency 12 --incrementalFile .cache/stryker/incremental-fast.json\",\n \"test:stryker:ci\": \"cross-env CI=true stryker run --ignoreStatic --concurrency 2 --incrementalFile .cache/stryker/incremental-fast-ci.json\",\n \"test:stryker:full\": \"stryker run --concurrency 12 --incrementalFile .cache/stryker/incremental-full.json\",\n \"test:stryker:full:ci\": \"cross-env CI=true stryker run --concurrency 2 --incrementalFile .cache/stryker/incremental-full-ci.json\",\n \"test:verbose\": \"vitest run --reporter=verbose\",\n \"test:watch\": \"vitest\",\n \"typecheck\": \"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.eslint.json --noEmit && tsc -p tsconfig.js.json --noEmit && npm run --workspace docs/docusaurus typecheck\",\n \"typecheck:all\": \"npm run typecheck\",\n \"types:update\": \"typesync\",\n \"update-deps\": \"npx ncu -i --install never && npm run sync:peer-eslint-range && npm install --force\",\n \"verify:readme-rules-table\": \"npm run build && npm run sync:readme-rules-table\"\n },\n \"overrides\": {\n \"jsonc-eslint-parser\": \"$jsonc-eslint-parser\"\n },\n \"dependencies\": {\n \"@typescript-eslint/parser\": \"^8.57.0\",\n \"@typescript-eslint/type-utils\": \"^8.57.0\",\n \"@typescript-eslint/utils\": \"^8.57.0\",\n \"ts-extras\": \"^0.17.0\",\n \"type-fest\": \"^5.4.4\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/cli\": \"^0.18.2\",\n \"@csstools/stylelint-formatter-github\": \"^2.0.0\",\n \"@docusaurus/eslint-plugin\": \"^3.9.2\",\n \"@double-great/remark-lint-alt-text\": \"^1.1.1\",\n \"@double-great/stylelint-a11y\": \"^3.4.5\",\n \"@eslint-community/eslint-plugin-eslint-comments\": \"^4.7.1\",\n \"@eslint-react/eslint-plugin\": \"^2.13.0\",\n \"@eslint/compat\": \"^2.0.3\",\n \"@eslint/config-helpers\": \"^0.5.3\",\n \"@eslint/config-inspector\": \"^1.5.0\",\n \"@eslint/css\": \"^1.0.0\",\n \"@eslint/js\": \"^10.0.1\",\n \"@eslint/json\": \"^1.1.0\",\n \"@eslint/markdown\": \"^7.5.1\",\n \"@html-eslint/eslint-plugin\": \"^0.58.1\",\n \"@html-eslint/parser\": \"^0.58.1\",\n \"@microsoft/eslint-plugin-sdl\": \"^1.1.0\",\n \"@microsoft/tsdoc-config\": \"^0.18.1\",\n \"@secretlint/secretlint-rule-anthropic\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-aws\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-database-connection-string\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-gcp\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-github\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-no-dotenv\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-no-homedir\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-npm\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-openai\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-pattern\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-preset-recommend\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-privatekey\": \"^11.3.1\",\n \"@secretlint/secretlint-rule-secp256k1-privatekey\": \"^11.3.1\",\n \"@secretlint/types\": \"^11.3.1\",\n \"@softonus/prettier-plugin-duplicate-remover\": \"^1.1.2\",\n \"@stryker-ignorer/console-all\": \"^0.3.2\",\n \"@stryker-mutator/core\": \"^9.6.0\",\n \"@stryker-mutator/typescript-checker\": \"^9.6.0\",\n \"@stryker-mutator/vitest-runner\": \"^9.6.0\",\n \"@stylelint-types/stylelint-order\": \"^7.0.1\",\n \"@stylelint-types/stylelint-stylistic\": \"^5.0.0\",\n \"@stylistic/eslint-plugin\": \"^5.10.0\",\n \"@stylistic/stylelint-plugin\": \"^5.0.1\",\n \"@types/eslint-plugin-jsx-a11y\": \"^6.10.1\",\n \"@types/eslint-plugin-security\": \"^3.0.1\",\n \"@types/htmlhint\": \"^1.1.5\",\n \"@types/madge\": \"^5.0.3\",\n \"@types/node\": \"^25.5.0\",\n \"@types/postcss-clamp\": \"^4.1.3\",\n \"@types/postcss-flexbugs-fixes\": \"^5.0.3\",\n \"@types/postcss-html\": \"^1.5.3\",\n \"@types/postcss-import\": \"^14.0.3\",\n \"@types/postcss-inline-svg\": \"^5.0.4\",\n \"@types/postcss-normalize\": \"^9.0.4\",\n \"@types/postcss-reporter\": \"^7.0.5\",\n \"@types/sloc\": \"^0.2.3\",\n \"@typescript-eslint/eslint-plugin\": \"^8.57.0\",\n \"@typescript-eslint/rule-tester\": \"^8.57.0\",\n \"@vitest/coverage-v8\": \"^4.1.0\",\n \"@vitest/eslint-plugin\": \"^1.6.11\",\n \"@vitest/ui\": \"^4.1.0\",\n \"actionlint\": \"^2.0.6\",\n \"all-contributors-cli\": \"^6.26.1\",\n \"cognitive-complexity-ts\": \"^0.8.1\",\n \"commitlint\": \"^20.4.4\",\n \"commitlint-config-gitmoji\": \"^2.3.1\",\n \"cross-env\": \"^10.1.0\",\n \"depcheck\": \"^1.4.7\",\n \"detect-secrets\": \"^1.0.6\",\n \"eslint\": \"^10.0.3\",\n \"eslint-config-flat-gitignore\": \"^2.2.1\",\n \"eslint-config-prettier\": \"^10.1.8\",\n \"eslint-formatter-unix\": \"^9.0.1\",\n \"eslint-import-resolver-typescript\": \"^4.4.4\",\n \"eslint-plugin-array-func\": \"^5.1.1\",\n \"eslint-plugin-canonical\": \"^5.1.3\",\n \"eslint-plugin-case-police\": \"^2.2.0\",\n \"eslint-plugin-comment-length\": \"^2.3.0\",\n \"eslint-plugin-css-modules\": \"^2.12.0\",\n \"eslint-plugin-de-morgan\": \"^2.1.1\",\n \"eslint-plugin-depend\": \"^1.5.0\",\n \"eslint-plugin-eslint-plugin\": \"^7.3.2\",\n \"eslint-plugin-etc\": \"^2.0.3\",\n \"eslint-plugin-file-progress-2\": \"^3.4.3\",\n \"eslint-plugin-html\": \"^8.1.4\",\n \"eslint-plugin-import-x\": \"^4.16.2\",\n \"eslint-plugin-jsdoc\": \"^62.8.0\",\n \"eslint-plugin-jsonc\": \"^3.1.2\",\n \"eslint-plugin-jsx-a11y\": \"^6.10.2\",\n \"eslint-plugin-listeners\": \"^1.5.1\",\n \"eslint-plugin-loadable-imports\": \"^1.0.1\",\n \"eslint-plugin-math\": \"^0.13.1\",\n \"eslint-plugin-module-interop\": \"^0.3.1\",\n \"eslint-plugin-n\": \"^17.24.0\",\n \"eslint-plugin-nitpick\": \"^0.12.0\",\n \"eslint-plugin-no-barrel-files\": \"^1.2.2\",\n \"eslint-plugin-no-explicit-type-exports\": \"^0.12.1\",\n \"eslint-plugin-no-function-declare-after-return\": \"^1.1.0\",\n \"eslint-plugin-no-lookahead-lookbehind-regexp\": \"^0.4.0\",\n \"eslint-plugin-no-only-tests\": \"^3.3.0\",\n \"eslint-plugin-no-secrets\": \"^2.3.3\",\n \"eslint-plugin-no-unsanitized\": \"^4.1.5\",\n \"eslint-plugin-no-use-extend-native\": \"^0.7.2\",\n \"eslint-plugin-node-dependencies\": \"^2.2.0\",\n \"eslint-plugin-package-json\": \"^0.90.1\",\n \"eslint-plugin-perfectionist\": \"^5.6.0\",\n \"eslint-plugin-prefer-arrow\": \"^1.2.3\",\n \"eslint-plugin-prettier\": \"^5.5.5\",\n \"eslint-plugin-promise\": \"^7.2.1\",\n \"eslint-plugin-redos\": \"^4.5.0\",\n \"eslint-plugin-regexp\": \"^3.1.0\",\n \"eslint-plugin-require-jsdoc\": \"^1.0.4\",\n \"eslint-plugin-security\": \"^4.0.0\",\n \"eslint-plugin-sonarjs\": \"^4.0.2\",\n \"eslint-plugin-sort-class-members\": \"^1.21.0\",\n \"eslint-plugin-testing-library\": \"^7.16.0\",\n \"eslint-plugin-toml\": \"^1.3.1\",\n \"eslint-plugin-total-functions\": \"^7.1.0\",\n \"eslint-plugin-tsdoc\": \"^0.5.2\",\n \"eslint-plugin-tsdoc-require-2\": \"^1.0.2\",\n \"eslint-plugin-undefined-css-classes\": \"^0.1.5\",\n \"eslint-plugin-unicorn\": \"^63.0.0\",\n \"eslint-plugin-unused-imports\": \"^4.4.1\",\n \"eslint-plugin-write-good-comments\": \"^0.2.0\",\n \"eslint-plugin-yml\": \"^3.3.1\",\n \"eslint-rule-benchmark\": \"^0.8.0\",\n \"fast-check\": \"^4.6.0\",\n \"git-cliff\": \"^2.12.0\",\n \"gitleaks-secret-scanner\": \"^2.1.1\",\n \"globals\": \"^17.4.0\",\n \"htmlhint\": \"^1.9.2\",\n \"jscpd\": \"^4.0.8\",\n \"jsonc-eslint-parser\": \"^3.1.0\",\n \"knip\": \"^5.86.0\",\n \"leasot\": \"^14.4.0\",\n \"madge\": \"^8.0.0\",\n \"markdown-link-check\": \"^3.14.2\",\n \"npm-check-updates\": \"^19.6.3\",\n \"npm-package-json-lint\": \"^9.1.0\",\n \"picocolors\": \"^1.1.1\",\n \"postcss\": \"^8.5.8\",\n \"postcss-assets\": \"^6.0.0\",\n \"postcss-clamp\": \"^4.1.0\",\n \"postcss-combine-duplicated-selectors\": \"^10.0.3\",\n \"postcss-flexbugs-fixes\": \"^5.0.2\",\n \"postcss-html\": \"^1.8.1\",\n \"postcss-import\": \"^16.1.1\",\n \"postcss-inline-svg\": \"^6.0.0\",\n \"postcss-logical\": \"^9.0.0\",\n \"postcss-normalize\": \"^13.0.1\",\n \"postcss-reporter\": \"^7.1.0\",\n \"postcss-round-subpixels\": \"^2.0.0\",\n \"postcss-scss\": \"^4.0.9\",\n \"postcss-sort-media-queries\": \"^6.1.0\",\n \"postcss-styled-jsx\": \"^1.0.1\",\n \"postcss-styled-syntax\": \"^0.7.1\",\n \"postcss-viewport-height-correction\": \"^1.1.1\",\n \"prettier\": \"^3.8.1\",\n \"prettier-plugin-ini\": \"^1.3.0\",\n \"prettier-plugin-interpolated-html-tags\": \"^2.0.1\",\n \"prettier-plugin-jsdoc\": \"^1.8.0\",\n \"prettier-plugin-jsdoc-type\": \"^0.2.0\",\n \"prettier-plugin-merge\": \"^0.10.0\",\n \"prettier-plugin-multiline-arrays\": \"^4.1.4\",\n \"prettier-plugin-packagejson\": \"^3.0.2\",\n \"prettier-plugin-properties\": \"^0.3.1\",\n \"prettier-plugin-sort-json\": \"^4.2.0\",\n \"prettier-plugin-toml\": \"^2.0.6\",\n \"publint\": \"^0.3.18\",\n \"recheck-jar\": \"^4.5.0\",\n \"rehype-katex\": \"^7.0.1\",\n \"remark\": \"^15.0.1\",\n \"remark-cli\": \"^12.0.1\",\n \"remark-directive\": \"^4.0.0\",\n \"remark-frontmatter\": \"^5.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"remark-ignore\": \"^3.0.0\",\n \"remark-inline-links\": \"^7.0.0\",\n \"remark-lint\": \"^10.0.1\",\n \"remark-lint-blockquote-indentation\": \"^4.0.1\",\n \"remark-lint-check-toc\": \"^1.0.0\",\n \"remark-lint-checkbox-character-style\": \"^5.0.1\",\n \"remark-lint-checkbox-content-indent\": \"^5.0.1\",\n \"remark-lint-code-block-split-list\": \"^1.0.0\",\n \"remark-lint-code-block-style\": \"^4.0.1\",\n \"remark-lint-correct-media-syntax\": \"^1.0.1\",\n \"remark-lint-definition-case\": \"^4.0.1\",\n \"remark-lint-definition-sort\": \"^1.0.1\",\n \"remark-lint-definition-spacing\": \"^4.0.1\",\n \"remark-lint-directive-attribute-sort\": \"^1.0.1\",\n \"remark-lint-directive-collapsed-attribute\": \"^1.0.1\",\n \"remark-lint-directive-quote-style\": \"^1.0.1\",\n \"remark-lint-directive-shortcut-attribute\": \"^1.0.1\",\n \"remark-lint-directive-unique-attribute-name\": \"^1.0.1\",\n \"remark-lint-emphasis-marker\": \"^4.0.1\",\n \"remark-lint-fenced-code-flag\": \"^4.2.0\",\n \"remark-lint-fenced-code-flag-case\": \"^3.0.0\",\n \"remark-lint-fenced-code-marker\": \"^4.0.1\",\n \"remark-lint-file-extension\": \"^3.0.1\",\n \"remark-lint-final-definition\": \"^4.0.2\",\n \"remark-lint-final-newline\": \"^3.0.1\",\n \"remark-lint-first-heading-level\": \"^4.0.1\",\n \"remark-lint-frontmatter-schema\": \"^3.15.4\",\n \"remark-lint-hard-break-spaces\": \"^4.1.1\",\n \"remark-lint-heading-capitalization\": \"^1.3.0\",\n \"remark-lint-heading-increment\": \"^4.0.1\",\n \"remark-lint-heading-style\": \"^4.0.1\",\n \"remark-lint-heading-whitespace\": \"^1.0.0\",\n \"remark-lint-linebreak-style\": \"^4.0.1\",\n \"remark-lint-link-title-style\": \"^4.0.1\",\n \"remark-lint-list-item-bullet-indent\": \"^5.0.1\",\n \"remark-lint-list-item-content-indent\": \"^4.0.1\",\n \"remark-lint-list-item-indent\": \"^4.0.1\",\n \"remark-lint-list-item-spacing\": \"^5.0.1\",\n \"remark-lint-maximum-heading-length\": \"^4.1.1\",\n \"remark-lint-maximum-line-length\": \"^4.1.1\",\n \"remark-lint-mdx-jsx-attribute-sort\": \"^1.0.1\",\n \"remark-lint-mdx-jsx-no-void-children\": \"^1.0.1\",\n \"remark-lint-mdx-jsx-quote-style\": \"^1.0.1\",\n \"remark-lint-mdx-jsx-self-close\": \"^1.0.1\",\n \"remark-lint-mdx-jsx-shorthand-attribute\": \"^1.0.1\",\n \"remark-lint-mdx-jsx-unique-attribute-name\": \"^1.0.1\",\n \"remark-lint-media-style\": \"^1.0.1\",\n \"remark-lint-no-blockquote-without-marker\": \"^6.0.1\",\n \"remark-lint-no-consecutive-blank-lines\": \"^5.0.1\",\n \"remark-lint-no-dead-urls\": \"^2.0.1\",\n \"remark-lint-no-duplicate-defined-urls\": \"^3.0.1\",\n \"remark-lint-no-duplicate-definitions\": \"^4.0.1\",\n \"remark-lint-no-duplicate-headings\": \"^4.0.1\",\n \"remark-lint-no-duplicate-headings-in-section\": \"^4.0.1\",\n \"remark-lint-no-emphasis-as-heading\": \"^4.0.1\",\n \"remark-lint-no-empty-sections\": \"^4.0.0\",\n \"remark-lint-no-empty-url\": \"^4.0.1\",\n \"remark-lint-no-file-name-articles\": \"^3.0.1\",\n \"remark-lint-no-file-name-consecutive-dashes\": \"^3.0.1\",\n \"remark-lint-no-file-name-irregular-characters\": \"^3.0.1\",\n \"remark-lint-no-file-name-mixed-case\": \"^3.0.1\",\n \"remark-lint-no-file-name-outer-dashes\": \"^3.0.1\",\n \"remark-lint-no-heading-content-indent\": \"^5.0.1\",\n \"remark-lint-no-heading-indent\": \"^5.0.1\",\n \"remark-lint-no-heading-like-paragraph\": \"^4.0.1\",\n \"remark-lint-no-heading-punctuation\": \"^4.0.1\",\n \"remark-lint-no-hidden-table-cell\": \"^1.0.1\",\n \"remark-lint-no-html\": \"^4.0.1\",\n \"remark-lint-no-literal-urls\": \"^4.0.1\",\n \"remark-lint-no-missing-blank-lines\": \"^4.0.1\",\n \"remark-lint-no-multiple-toplevel-headings\": \"^4.0.1\",\n \"remark-lint-no-paragraph-content-indent\": \"^5.0.1\",\n \"remark-lint-no-reference-like-url\": \"^4.0.1\",\n \"remark-lint-no-shell-dollars\": \"^4.0.1\",\n \"remark-lint-no-shortcut-reference-image\": \"^4.0.1\",\n \"remark-lint-no-shortcut-reference-link\": \"^4.0.1\",\n \"remark-lint-no-table-indentation\": \"^5.0.1\",\n \"remark-lint-no-tabs\": \"^4.0.1\",\n \"remark-lint-no-undefined-references\": \"^5.0.2\",\n \"remark-lint-no-unneeded-full-reference-image\": \"^4.0.1\",\n \"remark-lint-no-unneeded-full-reference-link\": \"^4.0.1\",\n \"remark-lint-no-unused-definitions\": \"^4.0.2\",\n \"remark-lint-ordered-list-marker-style\": \"^4.0.1\",\n \"remark-lint-ordered-list-marker-value\": \"^4.0.1\",\n \"remark-lint-rule-style\": \"^4.0.1\",\n \"remark-lint-strikethrough-marker\": \"^3.0.1\",\n \"remark-lint-strong-marker\": \"^4.0.1\",\n \"remark-lint-table-cell-padding\": \"^5.1.1\",\n \"remark-lint-table-pipe-alignment\": \"^4.1.1\",\n \"remark-lint-table-pipes\": \"^5.0.1\",\n \"remark-lint-unordered-list-marker-style\": \"^4.0.1\",\n \"remark-lint-write-good\": \"^1.2.0\",\n \"remark-math\": \"^6.0.0\",\n \"remark-preset-lint-consistent\": \"^6.0.1\",\n \"remark-preset-lint-markdown-style-guide\": \"^6.0.1\",\n \"remark-preset-lint-recommended\": \"^7.0.1\",\n \"remark-preset-prettier\": \"^2.0.2\",\n \"remark-toc\": \"^9.0.0\",\n \"remark-validate-links\": \"^13.1.0\",\n \"remark-wiki-link\": \"^2.0.1\",\n \"rimraf\": \"^6.1.3\",\n \"secretlint\": \"^11.3.1\",\n \"sloc\": \"^0.3.2\",\n \"sort-package-json\": \"^3.6.1\",\n \"stylelint\": \"^17.4.0\",\n \"stylelint-actions-formatters\": \"^16.3.1\",\n \"stylelint-checkstyle-formatter\": \"^0.1.2\",\n \"stylelint-codeframe-formatter\": \"^1.2.0\",\n \"stylelint-config-alphabetical-order\": \"^2.0.0\",\n \"stylelint-config-idiomatic-order\": \"^10.0.0\",\n \"stylelint-config-recess-order\": \"^7.6.1\",\n \"stylelint-config-recommended\": \"^18.0.0\",\n \"stylelint-config-sass-guidelines\": \"^13.0.0\",\n \"stylelint-config-standard\": \"^40.0.0\",\n \"stylelint-config-standard-scss\": \"^17.0.0\",\n \"stylelint-config-tailwindcss\": \"^1.0.1\",\n \"stylelint-declaration-block-no-ignored-properties\": \"^3.0.0\",\n \"stylelint-declaration-strict-value\": \"^1.11.1\",\n \"stylelint-define-config\": \"^17.2.0\",\n \"stylelint-find-new-rules\": \"^6.0.0\",\n \"stylelint-formatter-gitlab-code-quality-report\": \"^1.1.0\",\n \"stylelint-formatter-pretty\": \"^4.0.1\",\n \"stylelint-gamut\": \"^2.0.0\",\n \"stylelint-group-selectors\": \"^1.0.10\",\n \"stylelint-high-performance-animation\": \"^2.0.0\",\n \"stylelint-media-use-custom-media\": \"^4.1.0\",\n \"stylelint-no-browser-hacks\": \"^2.0.0\",\n \"stylelint-no-indistinguishable-colors\": \"^2.3.1\",\n \"stylelint-no-restricted-syntax\": \"^2.2.1\",\n \"stylelint-no-unresolved-module\": \"^2.5.2\",\n \"stylelint-no-unsupported-browser-features\": \"^8.1.1\",\n \"stylelint-order\": \"^8.0.0\",\n \"stylelint-plugin-defensive-css\": \"^2.6.0\",\n \"stylelint-plugin-logical-css\": \"^2.0.2\",\n \"stylelint-plugin-use-baseline\": \"^1.2.7\",\n \"stylelint-prettier\": \"^5.0.3\",\n \"stylelint-react-native\": \"^2.7.0\",\n \"stylelint-scales\": \"^5.0.0\",\n \"stylelint-selector-bem-pattern\": \"^4.0.1\",\n \"stylelint-use-nesting\": \"^6.0.2\",\n \"stylelint-value-no-unknown-custom-properties\": \"^6.1.1\",\n \"toml-eslint-parser\": \"^1.0.3\",\n \"ts-unused-exports\": \"^11.0.1\",\n \"typedoc\": \"^0.28.17\",\n \"typescript\": \"^5.9.3\",\n \"typescript-eslint\": \"^8.57.0\",\n \"typesync\": \"^0.14.3\",\n \"vfile\": \"^6.0.3\",\n \"vite\": \"^8.0.0\",\n \"vite-tsconfig-paths\": \"^6.1.1\",\n \"vitest\": \"^4.1.0\",\n \"yaml-eslint-parser\": \"^2.0.0\",\n \"yamllint-js\": \"^0.2.4\"\n },\n \"peerDependencies\": {\n \"eslint\": \"^9.0.0 || ^10.0.3\",\n \"typescript\": \">=5.0.0\"\n },\n \"packageManager\": \"npm@11.11.1\",\n \"engines\": {\n \"node\": \">=20.19.0\"\n },\n \"devEngines\": {\n \"runtime\": {\n \"name\": \"node\",\n \"version\": \">=20.19.0\",\n \"onFail\": \"error\"\n },\n \"packageManager\": {\n \"name\": \"npm\",\n \"version\": \">=11.0.0\",\n \"onFail\": \"error\"\n }\n },\n \"os\": [\n \"darwin\",\n \"linux\",\n \"win32\"\n ],\n \"publishConfig\": {\n \"provenance\": true\n },\n \"readme\": \"README.md\"\n}\n", "/**\n * @packageDocumentation\n * Derivation helpers for canonical rule docs metadata.\n */\nimport type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray, UnknownRecord } from \"type-fest\";\n\nimport {\n arrayIncludes,\n isDefined,\n isEmpty,\n isInteger,\n objectEntries,\n} from \"ts-extras\";\n\nimport type { TypefestRuleNamePattern } from \"./rules-registry.js\";\n\nimport { createRuleDocsUrl } from \"./rule-docs-url.js\";\nimport {\n isTypefestConfigReference,\n type TypefestConfigName,\n type TypefestConfigReference,\n typefestConfigReferenceToName,\n} from \"./typefest-config-references.js\";\n\n/** Normalized docs metadata derived for each rule. */\nexport type RuleDocsMetadata = Readonly<{\n description: string;\n recommended: boolean;\n requiresTypeChecking: boolean;\n ruleId: string;\n ruleNumber: number;\n typefestConfigNames: readonly TypefestConfigName[];\n typefestConfigReferences: readonly TypefestConfigReference[];\n url: string;\n}>;\n\n/** Rule-name keyed metadata map derived from static docs contracts. */\nexport type RuleDocsMetadataByName = Readonly<\n Record<TypefestRuleNamePattern, RuleDocsMetadata>\n>;\n\n/** Rule-map contract accepted by docs metadata derivation helpers. */\ntype RuleMap = Readonly<\n Record<\n TypefestRuleNamePattern,\n TSESLint.RuleModule<string, Readonly<UnknownArray>>\n >\n>;\n\n/**\n * Canonical docs contract required on every plugin rule.\n */\ntype TypefestRuleDocsContract = Readonly<{\n description: string;\n recommended: boolean;\n requiresTypeChecking: boolean;\n ruleId: string;\n ruleNumber: number;\n typefestConfigs:\n | readonly TypefestConfigReference[]\n | TypefestConfigReference;\n url: string;\n}>;\n\nconst RULE_ID_PREFIX = \"R\" as const;\nconst RULE_ID_LENGTH = 4 as const;\nconst RULE_ID_DIGIT_START_INDEX = 1 as const;\nconst RULE_ID_DIGIT_END_INDEX = 4 as const;\nconst ASCII_ZERO_CODE_POINT = 48 as const;\nconst ASCII_NINE_CODE_POINT = 57 as const;\n\n/**\n * Guard dynamic rule ids to the canonical `R###` identifier contract.\n */\nconst isRuleIdInCanonicalFormat = (value: string): boolean => {\n if (value.length !== RULE_ID_LENGTH || !value.startsWith(RULE_ID_PREFIX)) {\n return false;\n }\n\n for (\n let index = RULE_ID_DIGIT_START_INDEX;\n index < RULE_ID_DIGIT_END_INDEX;\n index += 1\n ) {\n const codePoint = value.codePointAt(index);\n\n if (!isDefined(codePoint)) {\n return false;\n }\n\n if (\n codePoint < ASCII_ZERO_CODE_POINT ||\n codePoint > ASCII_NINE_CODE_POINT\n ) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * Guard dynamic values to object-shaped records.\n */\nconst isUnknownRecord = (value: unknown): value is Readonly<UnknownRecord> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/**\n * Guard dynamic rule ids to the plugin naming contract.\n */\nconst isTypefestRuleNamePattern = (\n value: string\n): value is TypefestRuleNamePattern => value.startsWith(\"prefer-\");\n\n/**\n * Convert rule docs `typefestConfigs` into a normalized, deduped reference\n * list.\n */\nconst normalizeTypefestConfigReferences = (\n ruleName: string,\n typefestConfigs: TypefestRuleDocsContract[\"typefestConfigs\"]\n): readonly TypefestConfigReference[] => {\n const candidates =\n typeof typefestConfigs === \"string\"\n ? [typefestConfigs]\n : [...typefestConfigs];\n\n const references: TypefestConfigReference[] = [];\n\n for (const candidate of candidates) {\n if (!isTypefestConfigReference(candidate)) {\n throw new TypeError(\n `Rule '${ruleName}' has invalid docs.typefestConfigs reference '${String(candidate)}'.`\n );\n }\n\n if (arrayIncludes(references, candidate)) {\n continue;\n }\n\n references.push(candidate);\n }\n\n if (isEmpty(references)) {\n throw new TypeError(\n `Rule '${ruleName}' must declare at least one docs.typefestConfigs reference.`\n );\n }\n\n return references;\n};\n\n/**\n * Validate and narrow dynamic `meta.docs` values to the plugin docs contract.\n */\nconst getRuleDocsContract = (\n ruleName: string,\n docs: unknown\n): TypefestRuleDocsContract => {\n if (!isUnknownRecord(docs)) {\n throw new TypeError(`Rule '${ruleName}' must declare meta.docs.`);\n }\n\n const description = docs[\"description\"];\n const recommended = docs[\"recommended\"];\n const requiresTypeChecking = docs[\"requiresTypeChecking\"];\n const ruleId = docs[\"ruleId\"];\n const ruleNumber = docs[\"ruleNumber\"];\n const typefestConfigs = docs[\"typefestConfigs\"];\n const url = docs[\"url\"];\n\n if (typeof description !== \"string\" || description.trim().length === 0) {\n throw new TypeError(\n `Rule '${ruleName}' must declare a non-empty docs.description.`\n );\n }\n\n if (typeof url !== \"string\" || url.trim().length === 0) {\n throw new TypeError(\n `Rule '${ruleName}' must declare a non-empty docs.url.`\n );\n }\n\n const expectedRuleDocsUrl = createRuleDocsUrl(ruleName);\n if (url !== expectedRuleDocsUrl) {\n throw new TypeError(\n `Rule '${ruleName}' must declare docs.url as '${expectedRuleDocsUrl}'.`\n );\n }\n\n if (typeof recommended !== \"boolean\") {\n throw new TypeError(\n `Rule '${ruleName}' must declare boolean docs.recommended.`\n );\n }\n\n if (typeof requiresTypeChecking !== \"boolean\") {\n throw new TypeError(\n `Rule '${ruleName}' must declare boolean docs.requiresTypeChecking.`\n );\n }\n\n if (\n typeof ruleId !== \"string\" ||\n !isRuleIdInCanonicalFormat(ruleId) ||\n ruleId.trim().length === 0\n ) {\n throw new TypeError(\n `Rule '${ruleName}' must declare docs.ruleId using the 'R###' format.`\n );\n }\n\n if (\n typeof ruleNumber !== \"number\" ||\n !isInteger(ruleNumber) ||\n ruleNumber < 1\n ) {\n throw new TypeError(\n `Rule '${ruleName}' must declare positive integer docs.ruleNumber.`\n );\n }\n\n if (typeof typefestConfigs === \"string\") {\n if (!isTypefestConfigReference(typefestConfigs)) {\n throw new TypeError(\n `Rule '${ruleName}' has invalid docs.typefestConfigs reference '${typefestConfigs}'.`\n );\n }\n\n return {\n description,\n recommended,\n requiresTypeChecking,\n ruleId,\n ruleNumber,\n typefestConfigs,\n url,\n };\n }\n\n if (!Array.isArray(typefestConfigs)) {\n throw new TypeError(\n `Rule '${ruleName}' must declare docs.typefestConfigs as a preset reference or array.`\n );\n }\n\n const normalizedTypefestConfigs: TypefestConfigReference[] = [];\n\n for (const candidate of typefestConfigs) {\n if (\n typeof candidate !== \"string\" ||\n !isTypefestConfigReference(candidate)\n ) {\n throw new TypeError(\n `Rule '${ruleName}' has invalid docs.typefestConfigs reference '${String(candidate)}'.`\n );\n }\n\n normalizedTypefestConfigs.push(candidate);\n }\n\n return {\n description,\n recommended,\n requiresTypeChecking,\n ruleId,\n ruleNumber,\n typefestConfigs: normalizedTypefestConfigs,\n url,\n };\n};\n\n/**\n * Derive normalized docs metadata for all plugin rules.\n */\nexport const deriveRuleDocsMetadataByName = (\n rules: RuleMap\n): RuleDocsMetadataByName => {\n const metadataByRuleName: Record<\n TypefestRuleNamePattern,\n RuleDocsMetadata\n > = {};\n\n for (const [ruleName, ruleModule] of objectEntries(rules)) {\n if (!isTypefestRuleNamePattern(ruleName)) {\n throw new TypeError(\n `Unexpected rule id '${ruleName}' while deriving docs metadata.`\n );\n }\n\n const ruleDocs = getRuleDocsContract(ruleName, ruleModule.meta?.docs);\n const typefestConfigReferences = normalizeTypefestConfigReferences(\n ruleName,\n ruleDocs.typefestConfigs\n );\n const typefestConfigNames = typefestConfigReferences.map(\n (reference) => typefestConfigReferenceToName[reference]\n );\n\n metadataByRuleName[ruleName] = {\n description: ruleDocs.description,\n recommended: ruleDocs.recommended,\n requiresTypeChecking: ruleDocs.requiresTypeChecking,\n ruleId: ruleDocs.ruleId,\n ruleNumber: ruleDocs.ruleNumber,\n typefestConfigNames,\n typefestConfigReferences,\n url: ruleDocs.url,\n };\n }\n\n return metadataByRuleName;\n};\n\n/**\n * Derive a typed-rule set from normalized docs metadata.\n */\nexport const deriveTypeCheckedRuleNameSet = (\n ruleDocsMetadataByName: RuleDocsMetadataByName\n): ReadonlySet<TypefestRuleNamePattern> => {\n const ruleNames: TypefestRuleNamePattern[] = [];\n\n for (const [ruleName, metadata] of objectEntries(ruleDocsMetadataByName)) {\n if (!metadata.requiresTypeChecking) {\n continue;\n }\n\n if (!isTypefestRuleNamePattern(ruleName)) {\n throw new TypeError(\n `Unexpected rule id '${ruleName}' while deriving typed-rule metadata.`\n );\n }\n\n ruleNames.push(ruleName);\n }\n\n return new Set(ruleNames);\n};\n\n/**\n * Derive canonical preset-membership map from normalized docs metadata.\n */\nexport const deriveRulePresetMembershipByRuleName = (\n ruleDocsMetadataByName: RuleDocsMetadataByName\n): Readonly<Record<TypefestRuleNamePattern, readonly TypefestConfigName[]>> => {\n const membershipByRuleName: Record<\n TypefestRuleNamePattern,\n readonly TypefestConfigName[]\n > = {};\n\n for (const [ruleName, metadata] of objectEntries(ruleDocsMetadataByName)) {\n if (!isTypefestRuleNamePattern(ruleName)) {\n throw new TypeError(\n `Unexpected rule id '${ruleName}' while deriving preset membership.`\n );\n }\n\n membershipByRuleName[ruleName] = metadata.typefestConfigNames;\n }\n\n if (isEmpty(objectEntries(membershipByRuleName))) {\n throw new TypeError(\n \"Rule metadata derivation produced no membership entries.\"\n );\n }\n\n return membershipByRuleName;\n};\n", "/**\n * @packageDocumentation\n * Canonical rule documentation URL helpers.\n */\n\n/** Stable docs host/prefix for generated rule docs links. */\nexport const RULE_DOCS_URL_BASE =\n \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/\" as const;\n\n/**\n * Build the canonical documentation URL for one rule id.\n *\n * @param ruleName - Rule id (for example `prefer-ts-extras-array-at`).\n *\n * @returns Canonical docs URL for the rule page.\n */\nexport const createRuleDocsUrl = (ruleName: string): string =>\n `${RULE_DOCS_URL_BASE}${ruleName}`;\n", "/**\n * @packageDocumentation\n * Shared typefest preset/config reference constants and type guards.\n */\nimport { objectHasOwn } from \"ts-extras\";\n\n/** Canonical flat-config preset keys exposed through `plugin.configs`. */\nexport const typefestConfigNames = [\n \"all\",\n \"minimal\",\n \"recommended\",\n \"recommended-type-checked\",\n \"strict\",\n \"ts-extras/type-guards\",\n \"type-fest/types\",\n] as const;\n\n/** Metadata contract shared across preset wiring, docs, and README rendering. */\nexport type TypefestConfigMetadata = Readonly<{\n icon: string;\n presetName: `typefest:${TypefestConfigName}`;\n readmeOrder: number;\n requiresTypeChecking: boolean;\n}>;\n\n/** Canonical flat-config preset key type exposed through `plugin.configs`. */\nexport type TypefestConfigName = (typeof typefestConfigNames)[number];\n\n/**\n * Canonical metadata for every exported `typefest` preset key.\n *\n * @remarks\n * This is the single source of truth for:\n *\n * - Preset display order in generated README tables,\n * - Preset icon mapping,\n * - Preset runtime flat-config names, and\n * - Preset type-checking requirements.\n */\nexport const typefestConfigMetadataByName: Readonly<\n Record<TypefestConfigName, TypefestConfigMetadata>\n> = {\n all: {\n icon: \"\uD83D\uDFE3\",\n presetName: \"typefest:all\",\n readmeOrder: 5,\n requiresTypeChecking: true,\n },\n minimal: {\n icon: \"\uD83D\uDFE2\",\n presetName: \"typefest:minimal\",\n readmeOrder: 1,\n requiresTypeChecking: false,\n },\n recommended: {\n icon: \"\uD83D\uDFE1\",\n presetName: \"typefest:recommended\",\n readmeOrder: 2,\n requiresTypeChecking: false,\n },\n \"recommended-type-checked\": {\n icon: \"\uD83D\uDFE0\",\n presetName: \"typefest:recommended-type-checked\",\n readmeOrder: 3,\n requiresTypeChecking: true,\n },\n strict: {\n icon: \"\uD83D\uDD34\",\n presetName: \"typefest:strict\",\n readmeOrder: 4,\n requiresTypeChecking: true,\n },\n \"ts-extras/type-guards\": {\n icon: \"\u2734\uFE0F\",\n presetName: \"typefest:ts-extras/type-guards\",\n readmeOrder: 7,\n requiresTypeChecking: true,\n },\n \"type-fest/types\": {\n icon: \"\uD83D\uDCA0\",\n presetName: \"typefest:type-fest/types\",\n readmeOrder: 6,\n requiresTypeChecking: false,\n },\n};\n\n/** Stable README legend/rendering order for preset icons. */\nexport const typefestConfigNamesByReadmeOrder: readonly TypefestConfigName[] = [\n \"minimal\",\n \"recommended\",\n \"recommended-type-checked\",\n \"strict\",\n \"all\",\n \"type-fest/types\",\n \"ts-extras/type-guards\",\n];\n\n/** Metadata references supported in `meta.docs.recommended`. */\nexport const typefestConfigReferenceToName: Readonly<{\n \"typefest.configs.all\": \"all\";\n \"typefest.configs.minimal\": \"minimal\";\n \"typefest.configs.recommended\": \"recommended\";\n \"typefest.configs.recommended-type-checked\": \"recommended-type-checked\";\n \"typefest.configs.strict\": \"strict\";\n \"typefest.configs.ts-extras/type-guards\": \"ts-extras/type-guards\";\n \"typefest.configs.type-fest/types\": \"type-fest/types\";\n 'typefest.configs[\"recommended-type-checked\"]': \"recommended-type-checked\";\n 'typefest.configs[\"ts-extras/type-guards\"]': \"ts-extras/type-guards\";\n 'typefest.configs[\"type-fest/types\"]': \"type-fest/types\";\n}> = {\n \"typefest.configs.all\": \"all\",\n \"typefest.configs.minimal\": \"minimal\",\n \"typefest.configs.recommended\": \"recommended\",\n \"typefest.configs.recommended-type-checked\": \"recommended-type-checked\",\n \"typefest.configs.strict\": \"strict\",\n \"typefest.configs.ts-extras/type-guards\": \"ts-extras/type-guards\",\n \"typefest.configs.type-fest/types\": \"type-fest/types\",\n 'typefest.configs[\"recommended-type-checked\"]': \"recommended-type-checked\",\n 'typefest.configs[\"ts-extras/type-guards\"]': \"ts-extras/type-guards\",\n 'typefest.configs[\"type-fest/types\"]': \"type-fest/types\",\n};\n\n/** Fully-qualified preset reference type accepted in docs metadata. */\nexport type TypefestConfigReference =\n keyof typeof typefestConfigReferenceToName;\n\n/**\n * Check whether a string is a supported `meta.docs.recommended` reference.\n */\nexport const isTypefestConfigReference = (\n value: string\n): value is TypefestConfigReference =>\n objectHasOwn(typefestConfigReferenceToName, value);\n", "/**\n * @packageDocumentation\n * Helpers for determining whether expressions/types are array-like in typed\n * rule analysis.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\nimport type ts from \"typescript\";\n\nimport {\n isTypeAnyType,\n isTypeArrayTypeOrUnionOfArrayTypes,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport { isDefined } from \"ts-extras\";\n\nimport { getParentNode } from \"./ast-node.js\";\nimport { getConstrainedTypeAtLocationWithFallback } from \"./constrained-type-at-location.js\";\nimport { safeTypeOperation } from \"./safe-type-operation.js\";\nimport { setContainsValue } from \"./set-membership.js\";\nimport {\n getTypeCheckerApparentType,\n getTypeCheckerBaseConstraintType,\n getTypeCheckerIsArrayTypeResult,\n getTypeCheckerIsTupleTypeResult,\n} from \"./type-checker-compat.js\";\nimport { recordTypedPathPrefilterEvaluation } from \"./typed-path-telemetry.js\";\n\n/**\n * Shared inputs required to evaluate whether an ESTree expression is array-like\n * using TypeScript type information.\n */\ninterface ArrayLikeExpressionCheckerOptions {\n /**\n * TypeScript checker instance used for type resolution.\n */\n readonly checker: ts.TypeChecker;\n\n /**\n * Parser services map for converting ESTree nodes to TypeScript nodes.\n */\n readonly parserServices: {\n readonly esTreeNodeToTSNodeMap: {\n readonly get: (key: Readonly<TSESTree.Node>) => ts.Node | undefined;\n };\n };\n\n /**\n * Optional file path used by telemetry counters.\n */\n readonly telemetryFilePath?: string;\n\n /**\n * How union members should be matched.\n *\n * @default \"some\"\n */\n readonly unionMatchMode?: UnionArrayLikeMatchMode;\n}\n\n/**\n * Determines how union member types are evaluated for array-likeness.\n */\ntype UnionArrayLikeMatchMode = \"every\" | \"some\";\n\nconst evaluateIsArrayLikeType = ({\n candidateType,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n}: Readonly<{\n candidateType: Readonly<ts.Type>;\n checker: Readonly<ts.TypeChecker>;\n resolutionCache: Map<Readonly<ts.Type>, boolean>;\n seenTypes: Set<Readonly<ts.Type>>;\n unionMatchMode: UnionArrayLikeMatchMode;\n}>): boolean => {\n const cachedResult = resolutionCache.get(candidateType);\n\n if (isDefined(cachedResult)) {\n return cachedResult;\n }\n\n if (setContainsValue(seenTypes, candidateType)) {\n return false;\n }\n\n seenTypes.add(candidateType);\n\n if (isTypeAnyType(candidateType) || isTypeUnknownType(candidateType)) {\n resolutionCache.set(candidateType, false);\n\n return false;\n }\n\n if (isTypeArrayTypeOrUnionOfArrayTypes(candidateType, checker)) {\n resolutionCache.set(candidateType, true);\n\n return true;\n }\n\n if (\n getTypeCheckerIsArrayTypeResult(checker, candidateType) === true ||\n getTypeCheckerIsTupleTypeResult(checker, candidateType) === true\n ) {\n resolutionCache.set(candidateType, true);\n\n return true;\n }\n\n if (candidateType.isUnion()) {\n const isArrayLike =\n unionMatchMode === \"every\"\n ? candidateType.types.every((partType) =>\n evaluateIsArrayLikeType({\n candidateType: partType,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n })\n )\n : candidateType.types.some((partType) =>\n evaluateIsArrayLikeType({\n candidateType: partType,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n })\n );\n\n resolutionCache.set(candidateType, isArrayLike);\n\n return isArrayLike;\n }\n\n if (candidateType.isIntersection()) {\n const isArrayLike = candidateType.types.some((partType) =>\n evaluateIsArrayLikeType({\n candidateType: partType,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n })\n );\n\n resolutionCache.set(candidateType, isArrayLike);\n\n return isArrayLike;\n }\n\n const baseConstraint = getTypeCheckerBaseConstraintType(\n checker,\n candidateType\n );\n if (\n isDefined(baseConstraint) &&\n baseConstraint !== candidateType &&\n evaluateIsArrayLikeType({\n candidateType: baseConstraint,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n })\n ) {\n resolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const apparentType = getTypeCheckerApparentType(checker, candidateType);\n if (isDefined(apparentType) && apparentType !== candidateType) {\n const isArrayLike = evaluateIsArrayLikeType({\n candidateType: apparentType,\n checker,\n resolutionCache,\n seenTypes,\n unionMatchMode,\n });\n\n resolutionCache.set(candidateType, isArrayLike);\n\n return isArrayLike;\n }\n\n resolutionCache.set(candidateType, false);\n\n return false;\n};\n\n/**\n * Determine whether a TypeScript type resolves to an array-like shape.\n *\n * @param checker - Type checker used to inspect and unwrap candidate types.\n * @param type - Candidate type to evaluate.\n * @param unionMatchMode - Strategy for union members (`\"some\"` or `\"every\"`).\n *\n * @returns `true` when the candidate resolves to an array/tuple-like type.\n */\nexport const isArrayLikeType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>,\n unionMatchMode: UnionArrayLikeMatchMode = \"some\"\n): boolean =>\n evaluateIsArrayLikeType({\n candidateType: type,\n checker,\n resolutionCache: new Map<Readonly<ts.Type>, boolean>(),\n seenTypes: new Set<Readonly<ts.Type>>(),\n unionMatchMode,\n });\n\nconst getArrayLikeExpressionPrefilterResult = (\n expression: Readonly<TSESTree.Expression>\n): boolean | undefined => {\n if (expression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSSatisfiesExpression\"\n ) {\n return getArrayLikeExpressionPrefilterResult(expression.expression);\n }\n\n return undefined;\n};\n\n/**\n * Build a safe ESTree expression predicate for array-like type checks.\n *\n * @param options - Type checker and parser-service dependencies.\n *\n * @returns Function that returns `true` when the expression is array-like.\n */\nexport const createIsArrayLikeExpressionChecker = ({\n checker,\n parserServices,\n telemetryFilePath,\n unionMatchMode = \"some\",\n}: Readonly<ArrayLikeExpressionCheckerOptions>) => {\n const arrayLikeTypeResolutionCache = new Map<Readonly<ts.Type>, boolean>();\n\n return (expression: Readonly<TSESTree.Expression>): boolean => {\n const prefilterResult =\n getArrayLikeExpressionPrefilterResult(expression);\n\n recordTypedPathPrefilterEvaluation({\n filePath: telemetryFilePath,\n prefilterHit: isDefined(prefilterResult),\n });\n\n if (isDefined(prefilterResult)) {\n return prefilterResult;\n }\n\n const result = safeTypeOperation({\n operation: () => {\n const expressionType = getConstrainedTypeAtLocationWithFallback(\n checker,\n expression,\n parserServices,\n \"array-like-expression-type-resolution-failed\"\n );\n\n if (!isDefined(expressionType)) {\n return false;\n }\n\n return evaluateIsArrayLikeType({\n candidateType: expressionType,\n checker,\n resolutionCache: arrayLikeTypeResolutionCache,\n seenTypes: new Set<Readonly<ts.Type>>(),\n unionMatchMode,\n });\n },\n reason: \"array-like-expression-check-failed\",\n });\n\n if (!result.ok) {\n return false;\n }\n\n return result.value;\n };\n};\n\n/**\n * Check whether a member expression is used as a write target.\n *\n * @param node - Member expression candidate.\n *\n * @returns `true` for assignment LHS, `delete` target, or update operand.\n */\nexport const isWriteTargetMemberExpression = (\n node: Readonly<TSESTree.MemberExpression>\n): boolean => {\n const parentNode = getParentNode(node);\n\n if (parentNode === undefined) {\n return false;\n }\n\n if (parentNode.type === \"AssignmentExpression\") {\n return parentNode.left === node;\n }\n\n if (parentNode.type === \"UnaryExpression\") {\n return parentNode.operator === \"delete\";\n }\n\n if (parentNode.type === \"UpdateExpression\") {\n return parentNode.argument === node;\n }\n\n return false;\n};\n", "/**\n * @packageDocumentation\n * AST parent-chain traversal helpers used by multiple rule utilities.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { keyIn } from \"ts-extras\";\n\nimport { resolveFirstValueInLinkedStructure } from \"./cycle-safe-linked-search.js\";\n\n/**\n * AST node shape that may carry a parser-populated `parent` reference.\n */\ntype NodeWithOptionalParent = Readonly<TSESTree.Node> & {\n parent?: Readonly<TSESTree.Node>;\n};\n\n/**\n * Determine whether a node exposes an optional `parent` property.\n */\nconst hasOptionalParentProperty = (\n node: Readonly<TSESTree.Node>\n): node is NodeWithOptionalParent => keyIn(node, \"parent\");\n\n/**\n * Gets a node's parent reference when available.\n *\n * @param node - AST node whose parent should be read.\n *\n * @returns Parent node when present on parser output; otherwise `undefined`.\n */\nexport const getParentNode = (\n node: Readonly<TSESTree.Node>\n): Readonly<TSESTree.Node> | undefined =>\n hasOptionalParentProperty(node) ? node.parent : undefined;\n\n/**\n * Walks the parent chain to locate the enclosing `Program` node.\n *\n * @param node - Starting AST node.\n *\n * @returns Nearest enclosing `Program` node; otherwise `null` when no program\n * boundary can be reached (including cycle-guard termination).\n */\nexport const getProgramNode = (\n node: Readonly<TSESTree.Node>\n): null | Readonly<TSESTree.Program> => {\n const lookupResult = resolveFirstValueInLinkedStructure<\n Readonly<TSESTree.Node>,\n Readonly<TSESTree.Program>\n >({\n getNextNode: (\n currentNode: Readonly<TSESTree.Node>\n ): null | Readonly<TSESTree.Node> => getParentNode(currentNode) ?? null,\n resolveValue: (currentNode: Readonly<TSESTree.Node>) =>\n currentNode.type === \"Program\"\n ? {\n found: true,\n value: currentNode,\n }\n : {\n found: false,\n },\n startNode: node,\n });\n\n return lookupResult.found ? lookupResult.value : null;\n};\n", "/**\n * @packageDocumentation\n * Shared Floyd-cycle-guarded linked-structure traversal utilities.\n */\n\n/**\n * Result shape returned by linked-structure searches.\n */\nexport type LinkedStructureLookupResult<Value> =\n | Readonly<{\n found: false;\n }>\n | Readonly<{\n found: true;\n value: Value;\n }>;\n\n/**\n * Fast-pointer hop count per iteration for Floyd cycle detection.\n */\nconst FLOYD_FAST_POINTER_ADVANCE_STEPS = 2 as const;\n\n/**\n * Resolve the first matching value while traversing a linked structure.\n *\n * @param options - Linked-structure traversal options.\n *\n * - `startNode`: Initial node to inspect.\n * - `getNextNode`: Function that returns the next node in the chain.\n * - `resolveValue`: Function that returns a lookup result for the current node.\n *\n * @returns Lookup result for the first resolved value; otherwise a non-matching\n * lookup result when traversal reaches the chain end or detects a\n * parent-cycle.\n */\nexport const resolveFirstValueInLinkedStructure = <Node, Value>({\n getNextNode,\n resolveValue,\n startNode,\n}: Readonly<{\n getNextNode: (node: Node) => Node | null;\n resolveValue: (node: Node) => LinkedStructureLookupResult<Value>;\n startNode: Node | null;\n}>): LinkedStructureLookupResult<Value> => {\n let slowNode = startNode;\n let fastNode = startNode;\n\n while (slowNode !== null) {\n const resolvedValue = resolveValue(slowNode);\n\n if (resolvedValue.found) {\n return resolvedValue;\n }\n\n slowNode = getNextNode(slowNode);\n\n for (let step = 0; step < FLOYD_FAST_POINTER_ADVANCE_STEPS; step += 1) {\n if (fastNode === null) {\n break;\n }\n\n fastNode = getNextNode(fastNode);\n }\n\n if (slowNode !== null && fastNode !== null && slowNode === fastNode) {\n return {\n found: false,\n };\n }\n }\n\n return {\n found: false,\n };\n};\n\n/**\n * Check whether any node in a linked structure satisfies a predicate.\n *\n * @param options - Linked-structure traversal options.\n *\n * - `startNode`: Initial node to inspect.\n * - `getNextNode`: Function that returns the next node in the chain.\n * - `isMatch`: Predicate used to test each visited node.\n *\n * @returns `true` when any visited node matches; otherwise `false`.\n */\nexport const isAnyLinkedStructureNodeMatching = <Node>({\n getNextNode,\n isMatch,\n startNode,\n}: Readonly<{\n getNextNode: (node: Node) => Node | null;\n isMatch: (node: Node) => boolean;\n startNode: Node | null;\n}>): boolean =>\n resolveFirstValueInLinkedStructure({\n getNextNode,\n resolveValue: (node): LinkedStructureLookupResult<boolean> =>\n isMatch(node)\n ? {\n found: true,\n value: true,\n }\n : {\n found: false,\n },\n startNode,\n }).found;\n", "/**\n * @packageDocumentation\n * Resolve constrained TypeScript types from ESTree nodes with resilient\n * fallbacks for partially mocked parser-services in tests.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\nimport type ts from \"typescript\";\n\nimport { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { isDefined, safeCastTo } from \"ts-extras\";\n\nimport { safeTypeOperation } from \"./safe-type-operation.js\";\nimport { getTypeCheckerBaseConstraintType } from \"./type-checker-compat.js\";\nimport {\n recordTypedPathExpensiveTypeCall,\n recordTypedPathFallbackInvocation,\n} from \"./typed-path-telemetry.js\";\n\ntype ConstrainedTypeParserServices = Readonly<{\n esTreeNodeToTSNodeMap: Readonly<{\n get: (key: Readonly<TSESTree.Node>) => ts.Node | undefined;\n }>;\n getTypeAtLocation?: (\n node: Readonly<TSESTree.Node>\n ) => Readonly<ts.Type> | ts.Type;\n program?: null | Readonly<{\n getTypeChecker: () => ts.TypeChecker;\n }>;\n}>;\n\n/**\n * Resolve a node type using `getConstrainedTypeAtLocation` when available, then\n * fall back to checker + node-map based resolution.\n *\n * @param checker - Type checker used for fallback type lookups.\n * @param node - ESTree node whose type should be resolved.\n * @param parserServices - Parser services with node mapping and optional typed\n * helpers.\n * @param reason - Stable diagnostics reason fragment for safe-type wrappers.\n *\n * @returns The constrained type when resolvable; otherwise `undefined`.\n */\nexport const getConstrainedTypeAtLocationWithFallback = (\n checker: Readonly<ts.TypeChecker>,\n node: Readonly<TSESTree.Node>,\n parserServices: ConstrainedTypeParserServices,\n reason: string\n): ts.Type | undefined => {\n const mappedTsNode = parserServices.esTreeNodeToTSNodeMap.get(node);\n const telemetryFilePathResult = safeTypeOperation({\n operation: () => mappedTsNode?.getSourceFile?.().fileName,\n reason: \"constrained-type-telemetry-file-path-resolution-failed\",\n });\n const telemetryFilePath = telemetryFilePathResult.ok\n ? telemetryFilePathResult.value\n : undefined;\n\n recordTypedPathExpensiveTypeCall(telemetryFilePath);\n\n const constrainedTypeResult = safeTypeOperation({\n operation: () => {\n if (\n typeof parserServices.getTypeAtLocation !== \"function\" ||\n !isDefined(parserServices.program)\n ) {\n return null;\n }\n\n return getConstrainedTypeAtLocation(\n parserServices as Parameters<\n typeof getConstrainedTypeAtLocation\n >[0],\n safeCastTo<Parameters<typeof getConstrainedTypeAtLocation>[1]>(\n node\n )\n );\n },\n reason: `${reason}-constrained`,\n });\n\n if (\n constrainedTypeResult.ok &&\n constrainedTypeResult.value !== null &&\n isDefined(constrainedTypeResult.value)\n ) {\n return constrainedTypeResult.value;\n }\n\n recordTypedPathFallbackInvocation(telemetryFilePath);\n\n const fallbackTypeResult = safeTypeOperation({\n operation: () => {\n const tsNode = mappedTsNode;\n\n if (!isDefined(tsNode)) {\n return null;\n }\n\n const rawType = checker.getTypeAtLocation(tsNode);\n const constrainedType = getTypeCheckerBaseConstraintType(\n checker,\n rawType\n );\n\n return constrainedType ?? rawType;\n },\n reason: `${reason}-fallback`,\n });\n\n if (!fallbackTypeResult.ok || fallbackTypeResult.value === null) {\n return undefined;\n }\n\n return fallbackTypeResult.value;\n};\n", "/**\n * @packageDocumentation\n * Structured error handling for best-effort typed AST operations.\n */\n\n/**\n * Counter contract used by test-time debug instrumentation.\n */\nexport type SafeTypeOperationCounter<Reason extends string> = Readonly<{\n getSnapshot: () => ReadonlyMap<Reason, number>;\n onFailure: (\n failure: Readonly<{\n error: unknown;\n reason: Reason;\n }>\n ) => void;\n}>;\n\n/**\n * Failure payload emitted when a safe typed operation throws.\n */\nexport type SafeTypeOperationFailure<Reason extends string> = Readonly<{\n error: unknown;\n reason: Reason;\n}>;\n\n/**\n * Optional observer called whenever an operation fails.\n */\nexport type SafeTypeOperationFailureObserver<Reason extends string> = (\n failure: Readonly<SafeTypeOperationFailure<Reason>>\n) => void;\n\n/**\n * Failure payload emitted when an observer itself throws.\n */\nexport type SafeTypeOperationObserverFailure<Reason extends string> = Readonly<{\n failure: Readonly<SafeTypeOperationFailure<Reason>>;\n observerError: unknown;\n observerKind: \"global\" | \"local\";\n}>;\n\n/**\n * Optional observer called when an operation failure observer throws.\n */\nexport type SafeTypeOperationObserverFailureObserver<Reason extends string> = (\n failure: Readonly<SafeTypeOperationObserverFailure<Reason>>\n) => void;\n\n/**\n * Shared observer set for operation failures across rule modules.\n *\n * @remarks\n * Observers are intentionally process-local and opt-in; they exist for\n * diagnostics and test instrumentation only.\n */\nconst safeTypeOperationFailureObservers = new Set<\n SafeTypeOperationFailureObserver<string>\n>();\n\n/**\n * Shared observer set for local/global observer failures.\n */\nconst safeTypeOperationObserverFailureObservers = new Set<\n SafeTypeOperationObserverFailureObserver<string>\n>();\n\n/**\n * Notify all registered observer-failure observers.\n *\n * @param failure - Observer-failure payload.\n */\nconst notifySafeTypeOperationObserverFailureObservers = (\n failure: Readonly<SafeTypeOperationObserverFailure<string>>\n): void => {\n for (const observer of safeTypeOperationObserverFailureObservers) {\n try {\n observer(failure);\n } catch {\n // Observer-failure observers are diagnostics only; never rethrow.\n }\n }\n};\n\n/**\n * Notify all registered global failure observers.\n *\n * @param failure - Failure payload emitted by a typed operation.\n */\nconst notifySafeTypeOperationFailureObservers = (\n failure: Readonly<SafeTypeOperationFailure<string>>\n): void => {\n for (const observer of safeTypeOperationFailureObservers) {\n try {\n observer(failure);\n } catch (observerError: unknown) {\n notifySafeTypeOperationObserverFailureObservers({\n failure,\n observerError,\n observerKind: \"global\",\n });\n }\n }\n};\n\n/**\n * Register a process-local observer for observer failures.\n *\n * @param observer - Callback invoked when a local/global failure observer\n * throws.\n *\n * @returns Unsubscribe callback to remove the observer.\n */\nexport const registerSafeTypeOperationObserverFailureObserver = (\n observer: SafeTypeOperationObserverFailureObserver<string>\n): (() => void) => {\n safeTypeOperationObserverFailureObservers.add(observer);\n\n return () => {\n safeTypeOperationObserverFailureObservers.delete(observer);\n };\n};\n\n/**\n * Register a process-local failure observer for typed operations.\n *\n * @param observer - Callback invoked for each operation failure.\n *\n * @returns Unsubscribe callback to remove the observer.\n */\nexport const registerSafeTypeOperationFailureObserver = (\n observer: SafeTypeOperationFailureObserver<string>\n): (() => void) => {\n safeTypeOperationFailureObservers.add(observer);\n\n return () => {\n safeTypeOperationFailureObservers.delete(observer);\n };\n};\n\n/**\n * Run one operation with a scoped failure observer that is always cleaned up.\n *\n * @param observer - Observer registered for the operation scope.\n * @param operation - Synchronous operation to execute while observing failures.\n *\n * @returns Return value produced by `operation`.\n */\nexport const withSafeTypeOperationFailureObserver = <Result>(\n observer: SafeTypeOperationFailureObserver<string>,\n operation: () => Result\n): Result => {\n const unsubscribe = registerSafeTypeOperationFailureObserver(observer);\n\n try {\n return operation();\n } finally {\n unsubscribe();\n }\n};\n\n/**\n * Result shape for safe typed operations.\n */\nexport type SafeTypeOperationResult<Result, Reason extends string> =\n | Readonly<{\n failure: SafeTypeOperationFailure<Reason>;\n ok: false;\n }>\n | Readonly<{\n ok: true;\n value: Result;\n }>;\n\n/**\n * Execute a typed operation with structured failure output instead of throws.\n */\nexport const safeTypeOperation = <Result, Reason extends string>({\n onFailure,\n operation,\n reason,\n}: Readonly<{\n onFailure?: SafeTypeOperationFailureObserver<Reason>;\n operation: () => Result;\n reason: Reason;\n}>): SafeTypeOperationResult<Result, Reason> => {\n try {\n return {\n ok: true,\n value: operation(),\n };\n } catch (error: unknown) {\n const failure: SafeTypeOperationFailure<Reason> = {\n error,\n reason,\n };\n\n try {\n onFailure?.(failure);\n } catch (observerError: unknown) {\n notifySafeTypeOperationObserverFailureObservers({\n failure,\n observerError,\n observerKind: \"local\",\n });\n }\n\n notifySafeTypeOperationFailureObservers(failure);\n\n return {\n failure,\n ok: false,\n };\n }\n};\n\n/**\n * Build a lightweight reason counter for debugging operation failures in tests.\n *\n * @param reasonsForTypeInference - Optional typed reason literals used to infer\n * the `Reason` generic without requiring explicit type parameters.\n */\nexport const createSafeTypeOperationCounter = <Reason extends string = never>(\n reasonsForTypeInference: readonly Reason[] = []\n): SafeTypeOperationCounter<Reason> => {\n const counts = new Map<Reason, number>();\n\n for (const reason of reasonsForTypeInference) {\n counts.set(reason, counts.get(reason) ?? 0);\n }\n\n const onFailure: SafeTypeOperationFailureObserver<Reason> = (failure) => {\n const previousCount = counts.get(failure.reason) ?? 0;\n counts.set(failure.reason, previousCount + 1);\n };\n\n return {\n getSnapshot: (): ReadonlyMap<Reason, number> => new Map(counts),\n onFailure,\n };\n};\n", "/**\n * @packageDocumentation\n * Compatibility wrappers for optional TypeScript TypeChecker APIs.\n */\nimport type ts from \"typescript\";\n\nimport { isTypeReferenceType } from \"@typescript-eslint/type-utils\";\nimport { safeCastTo } from \"ts-extras\";\n\n/**\n * Read `checker.getApparentType` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Apparent type when available; otherwise `undefined`.\n */\nexport const getTypeCheckerApparentType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): ts.Type | undefined => {\n const checkerWithApparentType = safeCastTo<\n ts.TypeChecker & {\n getApparentType?: (type: Readonly<ts.Type>) => ts.Type;\n }\n >(checker);\n\n return checkerWithApparentType.getApparentType?.call(checker, type);\n};\n\n/**\n * Read `checker.getBaseTypes` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Base types when available; otherwise `undefined`.\n */\nexport const getTypeCheckerBaseTypes = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): readonly ts.BaseType[] | undefined => {\n const checkerWithBaseTypes = checker as ts.TypeChecker & {\n getBaseTypes?: (\n type: Readonly<ts.Type>\n ) => readonly ts.BaseType[] | undefined;\n };\n\n return checkerWithBaseTypes.getBaseTypes?.call(checker, type);\n};\n\n/**\n * Read `checker.getStringType` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n *\n * @returns Primitive string type when available; otherwise `undefined`.\n */\nexport const getTypeCheckerStringType = (\n checker: Readonly<ts.TypeChecker>\n): ts.Type | undefined => {\n const checkerWithStringType = safeCastTo<\n ts.TypeChecker & {\n getStringType?: () => ts.Type;\n }\n >(checker);\n\n return checkerWithStringType.getStringType?.call(checker);\n};\n\n/**\n * Read `checker.isTypeAssignableTo` when the host TypeScript version provides\n * it.\n *\n * @param checker - TypeScript type checker.\n * @param source - Candidate source type.\n * @param target - Candidate target type.\n *\n * @returns Assignability result when available; otherwise `undefined`.\n */\nexport const getTypeCheckerIsTypeAssignableToResult = (\n checker: Readonly<ts.TypeChecker>,\n source: Readonly<ts.Type>,\n target: Readonly<ts.Type>\n): boolean | undefined => {\n const checkerWithAssignable = safeCastTo<\n ts.TypeChecker & {\n isTypeAssignableTo?: (\n source: Readonly<ts.Type>,\n target: Readonly<ts.Type>\n ) => boolean;\n }\n >(checker);\n\n return checkerWithAssignable.isTypeAssignableTo?.call(\n checker,\n source,\n target\n );\n};\n\n/**\n * Read `checker.getBaseConstraintOfType` when the host TypeScript version\n * provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Base-constraint type when available; otherwise `undefined`.\n */\nexport const getTypeCheckerBaseConstraintType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): ts.Type | undefined => {\n const checkerWithBaseConstraint = safeCastTo<\n ts.TypeChecker & {\n getBaseConstraintOfType?: (\n type: Readonly<ts.Type>\n ) => ts.Type | undefined;\n }\n >(checker);\n\n return checkerWithBaseConstraint.getBaseConstraintOfType?.call(\n checker,\n type\n );\n};\n\n/**\n * Read `checker.isArrayType` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Array-type result when available; otherwise `undefined`.\n */\nexport const getTypeCheckerIsArrayTypeResult = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean | undefined => {\n const checkerWithArrayType = safeCastTo<\n ts.TypeChecker & {\n isArrayType?: (type: Readonly<ts.Type>) => boolean;\n }\n >(checker);\n\n return checkerWithArrayType.isArrayType?.call(checker, type);\n};\n\n/**\n * Read `checker.isTupleType` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Tuple-type result when available; otherwise `undefined`.\n */\nexport const getTypeCheckerIsTupleTypeResult = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean | undefined => {\n const checkerWithTupleType = safeCastTo<\n ts.TypeChecker & {\n isTupleType?: (type: Readonly<ts.Type>) => boolean;\n }\n >(checker);\n\n return checkerWithTupleType.isTupleType?.call(checker, type);\n};\n\n/**\n * Read `checker.getTypeArguments` when the host TypeScript version provides it.\n *\n * @param checker - TypeScript type checker.\n * @param type - Candidate type.\n *\n * @returns Type arguments when available; otherwise `undefined`.\n */\nexport const getTypeCheckerTypeArguments = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): readonly ts.Type[] | undefined => {\n if (!isTypeReferenceType(type)) {\n return undefined;\n }\n\n const checkerWithTypeArguments = safeCastTo<\n ts.TypeChecker & {\n getTypeArguments?: (\n type: Readonly<ts.TypeReference>\n ) => readonly ts.Type[];\n }\n >(checker);\n\n return checkerWithTypeArguments.getTypeArguments?.call(checker, type);\n};\n", "/**\n * @remarks\n * Counters are intentionally process-local and best-effort. They are designed\n * for benchmarks/tests, not for user-facing diagnostics.\n *\n * @packageDocumentation\n * Lightweight runtime telemetry for typed-rule hot paths.\n */\nimport { isDefined } from \"ts-extras\";\n\n/** Immutable typed-path counter view exposed to consumers. */\nexport type TypedPathCounters = Readonly<{\n expensiveTypeCalls: number;\n fallbackInvocations: number;\n prefilterChecks: number;\n prefilterHits: number;\n}>;\n\n/**\n * Point-in-time telemetry snapshot grouped by file path.\n */\nexport type TypedPathTelemetrySnapshot = Readonly<{\n files: readonly Readonly<{\n counters: TypedPathCounters;\n filePath: string;\n }>[];\n totals: Readonly<\n TypedPathCounters & {\n averageExpensiveCallsPerFileInput: Readonly<{\n expensiveTypeCalls: number;\n fileCount: number;\n }>;\n fallbackInvocationRateInput: Readonly<{\n expensiveTypeCalls: number;\n fallbackInvocations: number;\n }>;\n fileCount: number;\n prefilterHitRateInput: Readonly<{\n prefilterChecks: number;\n prefilterHits: number;\n }>;\n }\n >;\n}>;\n\ntype MutableTypedPathCounters = {\n expensiveTypeCalls: number;\n fallbackInvocations: number;\n prefilterChecks: number;\n prefilterHits: number;\n};\n\nconst UNKNOWN_FILE_PATH = \"<unknown>\" as const;\n\nconst typedPathCountersByFilePath = new Map<string, MutableTypedPathCounters>();\n\nconst createEmptyCounters = (): MutableTypedPathCounters => ({\n expensiveTypeCalls: 0,\n fallbackInvocations: 0,\n prefilterChecks: 0,\n prefilterHits: 0,\n});\n\nconst normalizeTelemetryFilePath = (\n filePath: null | string | undefined\n): string => {\n if (typeof filePath !== \"string\") {\n return UNKNOWN_FILE_PATH;\n }\n\n const trimmedPath = filePath.trim();\n\n return trimmedPath.length > 0 ? trimmedPath : UNKNOWN_FILE_PATH;\n};\n\nconst getCountersForFilePath = (\n filePath: null | string | undefined\n): MutableTypedPathCounters => {\n const normalizedFilePath = normalizeTelemetryFilePath(filePath);\n const existingCounters =\n typedPathCountersByFilePath.get(normalizedFilePath);\n\n if (isDefined(existingCounters)) {\n return existingCounters;\n }\n\n const createdCounters = createEmptyCounters();\n\n typedPathCountersByFilePath.set(normalizedFilePath, createdCounters);\n\n return createdCounters;\n};\n\n/**\n * Record one prefilter evaluation.\n *\n * @param options - Telemetry file key plus whether prefilter short-circuited.\n */\nexport const recordTypedPathPrefilterEvaluation = ({\n filePath,\n prefilterHit,\n}: Readonly<{\n filePath: null | string | undefined;\n prefilterHit: boolean;\n}>): void => {\n const counters = getCountersForFilePath(filePath);\n\n counters.prefilterChecks += 1;\n\n if (prefilterHit) {\n counters.prefilterHits += 1;\n }\n};\n\n/**\n * Record one expensive type-resolution invocation.\n */\nexport const recordTypedPathExpensiveTypeCall = (\n filePath: null | string | undefined\n): void => {\n const counters = getCountersForFilePath(filePath);\n\n counters.expensiveTypeCalls += 1;\n};\n\n/**\n * Record one fallback invocation after constrained resolution was unavailable\n * or failed.\n */\nexport const recordTypedPathFallbackInvocation = (\n filePath: null | string | undefined\n): void => {\n const counters = getCountersForFilePath(filePath);\n\n counters.fallbackInvocations += 1;\n};\n\n/**\n * Read a deterministic telemetry snapshot for assertions and profiling.\n */\nexport const getTypedPathTelemetrySnapshot = (): TypedPathTelemetrySnapshot => {\n const sortedEntries = [...typedPathCountersByFilePath.entries()];\n\n sortedEntries.sort(([leftPath], [rightPath]) =>\n leftPath.localeCompare(rightPath)\n );\n\n const files: Readonly<{\n counters: TypedPathCounters;\n filePath: string;\n }>[] = [];\n const totals = createEmptyCounters();\n\n for (const [filePath, counters] of sortedEntries) {\n const immutableCounters: TypedPathCounters = Object.freeze({\n expensiveTypeCalls: counters.expensiveTypeCalls,\n fallbackInvocations: counters.fallbackInvocations,\n prefilterChecks: counters.prefilterChecks,\n prefilterHits: counters.prefilterHits,\n });\n\n files.push(\n Object.freeze({\n counters: immutableCounters,\n filePath,\n })\n );\n\n totals.expensiveTypeCalls += immutableCounters.expensiveTypeCalls;\n totals.fallbackInvocations += immutableCounters.fallbackInvocations;\n totals.prefilterChecks += immutableCounters.prefilterChecks;\n totals.prefilterHits += immutableCounters.prefilterHits;\n }\n\n const frozenFiles = Object.freeze([...files]);\n const fileCount = frozenFiles.length;\n\n return {\n files: frozenFiles,\n totals: Object.freeze({\n ...totals,\n averageExpensiveCallsPerFileInput: Object.freeze({\n expensiveTypeCalls: totals.expensiveTypeCalls,\n fileCount,\n }),\n fallbackInvocationRateInput: Object.freeze({\n expensiveTypeCalls: totals.expensiveTypeCalls,\n fallbackInvocations: totals.fallbackInvocations,\n }),\n fileCount,\n prefilterHitRateInput: Object.freeze({\n prefilterChecks: totals.prefilterChecks,\n prefilterHits: totals.prefilterHits,\n }),\n }),\n };\n};\n\n/**\n * Clear all process-local telemetry counters.\n */\nexport const resetTypedPathTelemetry = (): void => {\n typedPathCountersByFilePath.clear();\n};\n", "/**\n * @packageDocumentation\n * Shared helpers for explicit boolean Set membership checks.\n */\nimport { setHas } from \"ts-extras\";\n\n/**\n * Check whether a Set contains a candidate value while intentionally exposing\n * only plain-boolean semantics at call sites.\n */\nexport const setContainsValue = <Type>(\n set: ReadonlySet<Type>,\n item: Type\n): boolean => setHas<Type>(set, item);\n", "/**\n * @packageDocumentation\n * Utilities for collecting and safely resolving direct named value imports.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { arrayJoin, setHas } from \"ts-extras\";\n\nimport {\n collectNamedImportLocalNamesByImportedNameFromSource,\n isImportDeclarationFromSource,\n} from \"./import-analysis.js\";\nimport {\n type AutofixImportInsertionStrategy,\n createImportAwareFixes,\n} from \"./import-aware-fixes.js\";\nimport {\n type ImportFixIntent,\n type ImportInsertionDecision,\n resolveImportInsertionDecisionForReportFix,\n} from \"./import-fix-coordinator.js\";\nimport { createImportInsertionFix } from \"./import-insertion.js\";\nimport { getScopeFromContextSourceCode } from \"./scope-resolution.js\";\nimport { getVariableInScopeChain } from \"./scope-variable.js\";\n\n/**\n * Immutable mapping of imported symbol names to directly imported local\n * aliases.\n */\nexport type ImportedValueAliasMap = ReadonlyMap<string, ReadonlySet<string>>;\n\n/**\n * Parameters for creating a safe member-expression to function-call fixer.\n */\ntype MemberToFunctionCallFixParams = Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n memberNode: TSESTree.MemberExpression;\n reportFixIntent?: ImportFixIntent;\n sourceModuleName: string;\n}>;\n\n/**\n * Parameters for creating a safe method-call to function-call fixer.\n */\ntype MethodToFunctionCallFixParams = Readonly<{\n callNode: TSESTree.CallExpression;\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n reportFixIntent?: ImportFixIntent;\n sourceModuleName: string;\n}>;\n\n/**\n * Parameters for resolving a safe local alias for an imported value symbol.\n */\ntype SafeImportedValueNameParams = Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n referenceNode: TSESTree.Node;\n sourceModuleName: string;\n}>;\n\n/**\n * Parameters for creating a safe replacement fixer with custom replacement text\n * derived from the resolved helper local name.\n */\ntype SafeValueNodeTextReplacementFixParams = Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n replacementTextFactory: (replacementName: string) => string;\n reportFixIntent?: ImportFixIntent;\n sourceModuleName: string;\n targetNode: TSESTree.Node;\n}>;\n\n/**\n * Parameters for creating a safe replacement fixer for a value reference.\n */\ntype SafeValueReplacementFixParams = Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n reportFixIntent?: ImportFixIntent;\n sourceModuleName: string;\n targetNode: TSESTree.Node;\n}>;\n\n/** Scope-chain root used for local-variable resolution helpers. */\ntype ScopeChainRoot = Readonly<null | Readonly<TSESLint.Scope.Scope>>;\n\n/**\n * Parameters for creating a safe function-call replacement fixer.\n */\ntype ValueArgumentFunctionCallFixParams = Readonly<{\n argumentNode: TSESTree.Node;\n autofixImportInsertionStrategy?: AutofixImportInsertionStrategy;\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n negated?: boolean;\n reportFixIntent?: ImportFixIntent;\n sourceModuleName: string;\n targetNode: TSESTree.Node;\n}>;\n\n/**\n * Resolved import-planning metadata reused across value-fixer factories.\n */\ntype ValueReplacementPlan = Readonly<{\n importInsertionDecision: ImportInsertionDecision;\n replacementNameAndImportFixFactory: Readonly<{\n createImportFix: (\n fixer: Readonly<TSESLint.RuleFixer>\n ) => null | TSESLint.RuleFix;\n replacementName: string;\n requiresImportInsertion: boolean;\n }>;\n reportFixIntent: ImportFixIntent;\n}>;\n\nconst getImportDeclarationParent = (\n node: Readonly<TSESTree.Node>\n): null | Readonly<TSESTree.ImportDeclaration> => {\n const nodeParent = node.parent;\n\n if (nodeParent?.type !== \"ImportDeclaration\") {\n return null;\n }\n\n return nodeParent;\n};\n\nconst getFirstImportedAliasName = ({\n importedName,\n imports,\n}: Readonly<{\n importedName: string;\n imports: ImportedValueAliasMap;\n}>): null | string => {\n const candidateNames = imports.get(importedName);\n\n if (!candidateNames || candidateNames.size === 0) {\n return null;\n }\n\n if (setHas(candidateNames, importedName)) {\n return importedName;\n }\n\n const [firstCandidateName] = candidateNames;\n\n return firstCandidateName ?? null;\n};\n\nconst resolveReferenceScope = ({\n context,\n referenceNode,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n referenceNode: Readonly<TSESTree.Node>;\n}>): ScopeChainRoot => getScopeFromContextSourceCode(context, referenceNode);\n\n/**\n * Coordination decision used when import insertion is not required.\n */\nconst NO_IMPORT_INSERTION_NEEDED_DECISION: ImportInsertionDecision = {\n allowReplacementWithoutImportInsertion: true,\n shouldIncludeImportInsertionFix: false,\n};\n\n/**\n * Collect direct named value imports from a specific module.\n *\n * @param sourceCode - Source code object for the current file.\n * @param sourceModuleName - Module source string to match.\n *\n * @returns Readonly map of imported symbol names to local aliases.\n */\nexport const collectDirectNamedValueImportsFromSource = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n sourceModuleName: string\n): ImportedValueAliasMap =>\n collectNamedImportLocalNamesByImportedNameFromSource({\n allowTypeImportDeclaration: false,\n allowTypeImportSpecifier: false,\n sourceCode,\n sourceModuleName,\n });\n\n/**\n * Verify that a local identifier resolves to an import binding from the\n * expected module at a specific reference location.\n *\n * @param sourceCode - SourceCode instance for scope resolution.\n * @param referenceNode - AST node where the identifier will be referenced.\n * @param localName - Candidate local alias name.\n * @param sourceModuleName - Expected source module for the import binding.\n *\n * @returns `true` when the resolved local name is a matching import binding\n * from the expected module.\n */\nfunction isLocalNameBoundToExpectedImport(\n sourceScope: ScopeChainRoot,\n localName: string,\n sourceModuleName: string\n): boolean {\n const variable = getVariableInScopeChain(sourceScope, localName);\n\n if (!variable) {\n return false;\n }\n\n return variable.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\") {\n return false;\n }\n\n const definitionNode = definition.node;\n if (definitionNode.type !== \"ImportSpecifier\") {\n return false;\n }\n\n const parentImportDeclaration =\n getImportDeclarationParent(definitionNode);\n\n return (\n parentImportDeclaration !== null &&\n isImportDeclarationFromSource(\n parentImportDeclaration,\n sourceModuleName\n )\n );\n });\n}\n\n/**\n * Determine whether using the direct imported symbol name is safe at a\n * reference node without colliding with non-import bindings.\n *\n * @param options - Resolution inputs used to test direct-name safety.\n *\n * @returns `true` when using the bare imported symbol name would resolve to the\n * expected import binding at the reference location.\n */\nconst canUseDirectImportedNameSafely = ({\n importedName,\n sourceModuleName,\n sourceScope,\n}: Readonly<{\n importedName: string;\n sourceModuleName: string;\n sourceScope: ScopeChainRoot;\n}>): boolean => {\n const variable = getVariableInScopeChain(sourceScope, importedName);\n\n if (!variable) {\n return true;\n }\n\n return variable.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\") {\n return false;\n }\n\n const definitionNode = definition.node;\n if (definitionNode.type !== \"ImportSpecifier\") {\n return false;\n }\n\n if (definitionNode.local.name !== importedName) {\n return false;\n }\n\n const parentImportDeclaration =\n getImportDeclarationParent(definitionNode);\n\n return (\n parentImportDeclaration !== null &&\n isImportDeclarationFromSource(\n parentImportDeclaration,\n sourceModuleName\n ) &&\n parentImportDeclaration.importKind !== \"type\" &&\n definitionNode.importKind !== \"type\"\n );\n });\n};\n\n/**\n * Create a fixer that inserts a missing named value import for the target\n * module.\n *\n * @param options - Fixer context and import metadata.\n *\n * @returns Import insertion fix when a safe insertion point is found; otherwise\n * `null`.\n */\nconst createInsertNamedValueImportFix = ({\n fixer,\n importedName,\n referenceNode,\n sourceModuleName,\n}: Readonly<{\n fixer: TSESLint.RuleFixer;\n importedName: string;\n referenceNode: TSESTree.Node;\n sourceModuleName: string;\n}>): null | TSESLint.RuleFix => {\n const importDeclarationText = `import { ${importedName} } from \"${sourceModuleName}\";`;\n\n return createImportInsertionFix({\n fixer,\n importDeclarationText,\n moduleSpecifierHint: sourceModuleName,\n referenceNode,\n });\n};\n\n/**\n * Resolve a local alias that is safely bound to the expected import at a\n * reference node.\n *\n * @param options - Context and import metadata for local-name resolution.\n *\n * @returns Local alias when safely resolved; otherwise `null`.\n */\nfunction getSafeLocalNameForImportedValueInScope({\n importedName,\n imports,\n sourceModuleName,\n sourceScope,\n}: Readonly<{\n importedName: string;\n imports: ImportedValueAliasMap;\n sourceModuleName: string;\n sourceScope: ScopeChainRoot;\n}>): null | string {\n const candidateNames = imports.get(importedName);\n if (!candidateNames || candidateNames.size === 0) {\n return null;\n }\n\n for (const candidateName of candidateNames) {\n if (\n isLocalNameBoundToExpectedImport(\n sourceScope,\n candidateName,\n sourceModuleName\n )\n ) {\n return candidateName;\n }\n }\n\n return null;\n}\n\n/**\n * Resolve a safe local alias for a required imported value at one reference.\n *\n * @param options - Rule context, import alias map, and target reference\n * metadata.\n *\n * @returns Local alias when the current scope binds it to the expected module;\n * otherwise `null`.\n */\nexport const getSafeLocalNameForImportedValue = ({\n context,\n importedName,\n imports,\n referenceNode,\n sourceModuleName,\n}: Readonly<SafeImportedValueNameParams>): null | string => {\n const sourceScope = resolveReferenceScope({\n context,\n referenceNode,\n });\n\n if (sourceScope === null) {\n return getFirstImportedAliasName({\n importedName,\n imports,\n });\n }\n\n return getSafeLocalNameForImportedValueInScope({\n importedName,\n imports,\n sourceModuleName,\n sourceScope,\n });\n};\n\n/**\n * Resolve a safe replacement symbol and corresponding optional import-insert\n * factory for value replacements.\n *\n * @param options - Context and import metadata used to resolve a safe\n * replacement name.\n *\n * @returns Replacement metadata with optional import-fix factory when safe;\n * otherwise `null`.\n */\nconst getSafeReplacementNameAndImportFixFactory = ({\n context,\n importedName,\n imports,\n referenceNode,\n sourceModuleName,\n}: Readonly<SafeImportedValueNameParams>): null | {\n createImportFix: (\n fixer: Readonly<TSESLint.RuleFixer>\n ) => null | TSESLint.RuleFix;\n replacementName: string;\n requiresImportInsertion: boolean;\n} => {\n const sourceScope = resolveReferenceScope({\n context,\n referenceNode,\n });\n\n if (sourceScope === null) {\n const fallbackLocalName = getFirstImportedAliasName({\n importedName,\n imports,\n });\n\n if (fallbackLocalName === null) {\n return null;\n }\n\n return {\n createImportFix: () => null,\n replacementName: fallbackLocalName,\n requiresImportInsertion: false,\n };\n }\n\n const existingReplacementName = getSafeLocalNameForImportedValueInScope({\n importedName,\n imports,\n sourceModuleName,\n sourceScope,\n });\n\n if (\n typeof existingReplacementName === \"string\" &&\n existingReplacementName.length > 0\n ) {\n return {\n createImportFix: () => null,\n replacementName: existingReplacementName,\n requiresImportInsertion: false,\n };\n }\n\n if (\n !canUseDirectImportedNameSafely({\n importedName,\n sourceModuleName,\n sourceScope,\n })\n ) {\n return null;\n }\n\n return {\n createImportFix: (fixer) =>\n createInsertNamedValueImportFix({\n fixer,\n importedName,\n referenceNode,\n sourceModuleName,\n }),\n replacementName: importedName,\n requiresImportInsertion: true,\n };\n};\n\n/**\n * Resolve and coordinate import planning for value replacement fixers.\n */\nconst createValueReplacementPlan = ({\n context,\n importedName,\n imports,\n referenceNode,\n reportFixIntent,\n sourceModuleName,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n importedName: string;\n imports: ImportedValueAliasMap;\n referenceNode: Readonly<TSESTree.Node>;\n reportFixIntent: ImportFixIntent;\n sourceModuleName: string;\n}>): null | ValueReplacementPlan => {\n const replacementNameAndImportFixFactory =\n getSafeReplacementNameAndImportFixFactory({\n context,\n importedName,\n imports,\n referenceNode,\n sourceModuleName,\n });\n\n if (replacementNameAndImportFixFactory === null) {\n return null;\n }\n\n const importInsertionDecision =\n replacementNameAndImportFixFactory.requiresImportInsertion\n ? resolveImportInsertionDecisionForReportFix({\n importBindingKind: \"value\",\n importedName,\n referenceNode,\n reportFixIntent,\n sourceModuleName,\n })\n : NO_IMPORT_INSERTION_NEEDED_DECISION;\n\n return {\n importInsertionDecision,\n replacementNameAndImportFixFactory,\n reportFixIntent,\n };\n};\n\n/**\n * Build a report-fix callback from a resolved value replacement plan.\n */\nconst createReportFixFromValueReplacementPlan =\n ({\n autofixImportInsertionStrategy,\n createReplacementFix,\n valueReplacementPlan,\n }: Readonly<{\n autofixImportInsertionStrategy?:\n | AutofixImportInsertionStrategy\n | undefined;\n createReplacementFix: (\n fixer: Readonly<TSESLint.RuleFixer>,\n replacementName: string\n ) => TSESLint.RuleFix;\n valueReplacementPlan: Readonly<ValueReplacementPlan>;\n }>): TSESLint.ReportFixFunction =>\n (fixer) =>\n createImportAwareFixes({\n autofixImportInsertionStrategy,\n createImportFix:\n valueReplacementPlan.replacementNameAndImportFixFactory\n .createImportFix,\n createReplacementFix: (replacementFixer) =>\n createReplacementFix(\n replacementFixer,\n valueReplacementPlan.replacementNameAndImportFixFactory\n .replacementName\n ),\n fixer,\n importInsertionDecision:\n valueReplacementPlan.importInsertionDecision,\n reportFixIntent: valueReplacementPlan.reportFixIntent,\n requiresImportInsertion:\n valueReplacementPlan.replacementNameAndImportFixFactory\n .requiresImportInsertion,\n });\n\n/**\n * Serialize a call argument node to text, preserving sequence-expression\n * semantics with parentheses when required.\n *\n * @param options - Argument node and source-code accessor.\n *\n * @returns Trimmed argument text suitable for function-call insertion, or\n * `null` when no text can be produced.\n */\nexport const getFunctionCallArgumentText = ({\n argumentNode,\n sourceCode,\n}: Readonly<{\n argumentNode: Readonly<TSESTree.Node>;\n sourceCode: Readonly<TSESLint.SourceCode>;\n}>): null | string => {\n const argumentText = sourceCode.getText(argumentNode).trim();\n if (argumentText.length === 0) {\n return null;\n }\n\n if (argumentNode.type !== \"SequenceExpression\") {\n return argumentText;\n }\n\n if (argumentText.startsWith(\"(\") && argumentText.endsWith(\")\")) {\n return argumentText;\n }\n\n return `(${argumentText})`;\n};\n\n/**\n * Create a fixer that safely replaces a target node with a resolved local\n * import alias.\n *\n * @param options - Inputs used to resolve replacement/import insertion safety.\n *\n * @returns A report fixer when safe; otherwise `null`.\n */\nexport const createSafeValueReferenceReplacementFix = ({\n context,\n importedName,\n imports,\n reportFixIntent = \"autofix\",\n sourceModuleName,\n targetNode,\n}: Readonly<SafeValueReplacementFixParams>): null | TSESLint.ReportFixFunction => {\n const valueReplacementPlan = createValueReplacementPlan({\n context,\n importedName,\n imports,\n referenceNode: targetNode,\n reportFixIntent,\n sourceModuleName,\n });\n\n if (valueReplacementPlan === null) {\n return null;\n }\n\n return createReportFixFromValueReplacementPlan({\n createReplacementFix: (replacementFixer, replacementName) =>\n replacementFixer.replaceText(targetNode, replacementName),\n valueReplacementPlan,\n });\n};\n\n/**\n * Create a fixer that safely rewrites a target node using custom replacement\n * text derived from a resolved helper local name.\n *\n * @param options - Inputs for safe helper-name resolution and replacement-text\n * generation.\n *\n * @returns A report fixer when safe; otherwise `null`.\n */\nexport const createSafeValueNodeTextReplacementFix = ({\n context,\n importedName,\n imports,\n replacementTextFactory,\n reportFixIntent = \"autofix\",\n sourceModuleName,\n targetNode,\n}: Readonly<SafeValueNodeTextReplacementFixParams>): null | TSESLint.ReportFixFunction => {\n const valueReplacementPlan = createValueReplacementPlan({\n context,\n importedName,\n imports,\n referenceNode: targetNode,\n reportFixIntent,\n sourceModuleName,\n });\n\n if (valueReplacementPlan === null) {\n return null;\n }\n\n return createReportFixFromValueReplacementPlan({\n createReplacementFix: (replacementFixer, replacementName) =>\n replacementFixer.replaceText(\n targetNode,\n replacementTextFactory(replacementName)\n ),\n valueReplacementPlan,\n });\n};\n\n/**\n * Create a fixer that rewrites `receiver.method(args...)` to\n * `importedFn(receiver, args...)`.\n *\n * @returns A report fixer when safe; otherwise `null`.\n */\nexport const createMethodToFunctionCallFix = ({\n callNode,\n context,\n importedName,\n imports,\n reportFixIntent = \"autofix\",\n sourceModuleName,\n}: Readonly<MethodToFunctionCallFixParams>): null | TSESLint.ReportFixFunction => {\n if (callNode.optional || callNode.callee.type !== \"MemberExpression\") {\n return null;\n }\n\n if (callNode.callee.optional) {\n return null;\n }\n\n if (callNode.callee.object.type === \"Super\") {\n return null;\n }\n\n const valueReplacementPlan = createValueReplacementPlan({\n context,\n importedName,\n imports,\n referenceNode: callNode,\n reportFixIntent,\n sourceModuleName,\n });\n\n if (valueReplacementPlan === null) {\n return null;\n }\n\n const { sourceCode } = context;\n const receiverText = getFunctionCallArgumentText({\n argumentNode: callNode.callee.object,\n sourceCode,\n });\n if (receiverText === null) {\n return null;\n }\n\n const argumentTexts: string[] = [];\n\n for (const argument of callNode.arguments) {\n const argumentText = getFunctionCallArgumentText({\n argumentNode: argument,\n sourceCode,\n });\n\n if (argumentText === null) {\n return null;\n }\n\n argumentTexts.push(argumentText);\n }\n\n const argumentText = arrayJoin(argumentTexts, \", \");\n\n const replacementText =\n argumentText.length > 0\n ? `${valueReplacementPlan.replacementNameAndImportFixFactory.replacementName}(${receiverText}, ${argumentText})`\n : `${valueReplacementPlan.replacementNameAndImportFixFactory.replacementName}(${receiverText})`;\n\n return createReportFixFromValueReplacementPlan({\n createReplacementFix: (replacementFixer) =>\n replacementFixer.replaceText(callNode, replacementText),\n valueReplacementPlan,\n });\n};\n\n/**\n * Create a fixer that rewrites `receiver[member]` to `importedFn(receiver)`.\n *\n * @returns A report fixer when safe; otherwise `null`.\n */\nexport const createMemberToFunctionCallFix = ({\n context,\n importedName,\n imports,\n memberNode,\n reportFixIntent = \"autofix\",\n sourceModuleName,\n}: Readonly<MemberToFunctionCallFixParams>): null | TSESLint.ReportFixFunction => {\n if (memberNode.optional) {\n return null;\n }\n\n if (memberNode.object.type === \"Super\") {\n return null;\n }\n\n const valueReplacementPlan = createValueReplacementPlan({\n context,\n importedName,\n imports,\n referenceNode: memberNode,\n reportFixIntent,\n sourceModuleName,\n });\n\n if (valueReplacementPlan === null) {\n return null;\n }\n\n const receiverText = getFunctionCallArgumentText({\n argumentNode: memberNode.object,\n sourceCode: context.sourceCode,\n });\n if (receiverText === null) {\n return null;\n }\n\n const replacementText = `${valueReplacementPlan.replacementNameAndImportFixFactory.replacementName}(${receiverText})`;\n\n return createReportFixFromValueReplacementPlan({\n createReplacementFix: (replacementFixer) =>\n replacementFixer.replaceText(memberNode, replacementText),\n valueReplacementPlan,\n });\n};\n\n/**\n * Create a fixer that rewrites a target node to an imported helper invocation.\n *\n * @param options - Target/argument nodes and import metadata for call\n *\n * @returns A report fixer when safe; otherwise `null`.\n */\nexport const createSafeValueArgumentFunctionCallFix = ({\n argumentNode,\n autofixImportInsertionStrategy,\n context,\n importedName,\n imports,\n negated,\n reportFixIntent = \"autofix\",\n sourceModuleName,\n targetNode,\n}: Readonly<ValueArgumentFunctionCallFixParams>): null | TSESLint.ReportFixFunction => {\n const valueReplacementPlan = createValueReplacementPlan({\n context,\n importedName,\n imports,\n referenceNode: targetNode,\n reportFixIntent,\n sourceModuleName,\n });\n\n if (valueReplacementPlan === null) {\n return null;\n }\n\n const argumentText = getFunctionCallArgumentText({\n argumentNode,\n sourceCode: context.sourceCode,\n });\n if (argumentText === null) {\n return null;\n }\n\n const callText = `${valueReplacementPlan.replacementNameAndImportFixFactory.replacementName}(${argumentText})`;\n const replacementText = negated === true ? `!${callText}` : callText;\n\n return createReportFixFromValueReplacementPlan({\n autofixImportInsertionStrategy,\n createReplacementFix: (replacementFixer) =>\n replacementFixer.replaceText(targetNode, replacementText),\n valueReplacementPlan,\n });\n};\n", "/**\n * @packageDocumentation\n * Shared import-declaration analysis utilities for rule internals.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\n/**\n * Grouped mapping from imported symbol name to all local alias names.\n */\nexport type NamedImportLocalNamesByImportedName = ReadonlyMap<\n string,\n ReadonlySet<string>\n>;\n\n/**\n * Flattened named-import binding metadata.\n */\nexport type NamedImportSpecifierBinding = Readonly<{\n declaration: Readonly<TSESTree.ImportDeclaration>;\n importedName: string;\n localName: string;\n specifier: Readonly<TSESTree.ImportSpecifier>;\n}>;\n\n/**\n * Program-level import analysis cached per SourceCode instance.\n */\ntype SourceImportAnalysis = Readonly<{\n namedImportSpecifierBindings: readonly NamedImportSpecifierBinding[];\n namespaceImportLocalNamesBySourceModule: ReadonlyMap<\n string,\n ReadonlySet<string>\n >;\n}>;\n\n/**\n * SourceCode-scoped cache for parsed import declarations.\n */\nconst sourceImportAnalysisCache = new WeakMap<\n Readonly<TSESLint.SourceCode>,\n SourceImportAnalysis\n>();\n\n/**\n * Build and cache one import-analysis snapshot for the provided SourceCode.\n */\nconst getSourceImportAnalysis = (\n sourceCode: Readonly<TSESLint.SourceCode>\n): SourceImportAnalysis => {\n const existingAnalysis = sourceImportAnalysisCache.get(sourceCode);\n if (isDefined(existingAnalysis)) {\n return existingAnalysis;\n }\n\n const namedImportSpecifierBindings: NamedImportSpecifierBinding[] = [];\n const mutableNamespaceLocalNamesBySourceModule = new Map<\n string,\n Set<string>\n >();\n\n for (const statement of sourceCode.ast.body) {\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n\n const sourceModuleName =\n typeof statement.source.value === \"string\"\n ? statement.source.value\n : undefined;\n\n for (const specifier of statement.specifiers) {\n if (\n specifier.type === \"ImportSpecifier\" &&\n specifier.imported.type === \"Identifier\" &&\n specifier.local.type === \"Identifier\"\n ) {\n namedImportSpecifierBindings.push(\n Object.freeze({\n declaration: statement,\n importedName: specifier.imported.name,\n localName: specifier.local.name,\n specifier,\n })\n );\n\n continue;\n }\n\n if (\n specifier.type === \"ImportNamespaceSpecifier\" &&\n isDefined(sourceModuleName)\n ) {\n const existingLocalNames =\n mutableNamespaceLocalNamesBySourceModule.get(\n sourceModuleName\n );\n\n if (!isDefined(existingLocalNames)) {\n mutableNamespaceLocalNamesBySourceModule.set(\n sourceModuleName,\n new Set([specifier.local.name])\n );\n\n continue;\n }\n\n existingLocalNames.add(specifier.local.name);\n }\n }\n }\n\n const namespaceImportLocalNamesBySourceModule = new Map<\n string,\n ReadonlySet<string>\n >();\n\n for (const [\n sourceModuleName,\n localNames,\n ] of mutableNamespaceLocalNamesBySourceModule) {\n namespaceImportLocalNamesBySourceModule.set(\n sourceModuleName,\n Object.freeze(new Set(localNames))\n );\n }\n\n const analysis: SourceImportAnalysis = Object.freeze({\n namedImportSpecifierBindings: Object.freeze(\n namedImportSpecifierBindings\n ),\n namespaceImportLocalNamesBySourceModule,\n });\n\n sourceImportAnalysisCache.set(sourceCode, analysis);\n\n return analysis;\n};\n\n/**\n * Check whether an import declaration points at a specific source module.\n */\nexport const isImportDeclarationFromSource = (\n declaration: Readonly<TSESTree.ImportDeclaration>,\n sourceModuleName: string\n): boolean => declaration.source.value === sourceModuleName;\n\n/**\n * Collect named import-specifier bindings from one module source.\n */\nexport const collectNamedImportSpecifierBindingsFromSource = ({\n allowTypeImportDeclaration = true,\n allowTypeImportSpecifier = true,\n sourceCode,\n sourceModuleName,\n}: Readonly<{\n allowTypeImportDeclaration?: boolean;\n allowTypeImportSpecifier?: boolean;\n sourceCode: Readonly<TSESLint.SourceCode>;\n sourceModuleName?: string;\n}>): readonly NamedImportSpecifierBinding[] => {\n const sourceImportAnalysis = getSourceImportAnalysis(sourceCode);\n const bindings: NamedImportSpecifierBinding[] = [];\n\n for (const binding of sourceImportAnalysis.namedImportSpecifierBindings) {\n if (\n isDefined(sourceModuleName) &&\n !isImportDeclarationFromSource(\n binding.declaration,\n sourceModuleName\n )\n ) {\n continue;\n }\n\n if (\n !allowTypeImportDeclaration &&\n binding.declaration.importKind === \"type\"\n ) {\n continue;\n }\n\n if (\n !allowTypeImportSpecifier &&\n binding.specifier.importKind === \"type\"\n ) {\n continue;\n }\n\n bindings.push(binding);\n }\n\n return bindings;\n};\n\n/**\n * Collect named import local names grouped by imported symbol name.\n */\nexport const collectNamedImportLocalNamesByImportedNameFromSource = ({\n allowTypeImportDeclaration = true,\n allowTypeImportSpecifier = true,\n sourceCode,\n sourceModuleName,\n}: Readonly<{\n allowTypeImportDeclaration?: boolean;\n allowTypeImportSpecifier?: boolean;\n sourceCode: Readonly<TSESLint.SourceCode>;\n sourceModuleName?: string;\n}>): NamedImportLocalNamesByImportedName => {\n const localNamesByImportedName = new Map<string, Set<string>>();\n\n const bindingCollectionOptions: Parameters<\n typeof collectNamedImportSpecifierBindingsFromSource\n >[0] = {\n allowTypeImportDeclaration,\n allowTypeImportSpecifier,\n sourceCode,\n ...(isDefined(sourceModuleName) ? { sourceModuleName } : {}),\n };\n\n for (const binding of collectNamedImportSpecifierBindingsFromSource(\n bindingCollectionOptions\n )) {\n const existingLocalNames = localNamesByImportedName.get(\n binding.importedName\n );\n\n if (!isDefined(existingLocalNames)) {\n localNamesByImportedName.set(\n binding.importedName,\n new Set([binding.localName])\n );\n\n continue;\n }\n\n existingLocalNames.add(binding.localName);\n }\n\n return localNamesByImportedName;\n};\n\n/**\n * Collect namespace-import local names from one module source.\n */\nexport const collectNamespaceImportLocalNamesFromSourceModule = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n sourceModuleName: string\n): ReadonlySet<string> => {\n const sourceImportAnalysis = getSourceImportAnalysis(sourceCode);\n const localNames =\n sourceImportAnalysis.namespaceImportLocalNamesBySourceModule.get(\n sourceModuleName\n );\n\n return isDefined(localNames) ? new Set(localNames) : new Set<string>();\n};\n", "/**\n * @packageDocumentation\n * Shared composition helpers for import-aware report fix callbacks.\n */\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nimport type {\n ImportFixIntent,\n ImportInsertionDecision,\n} from \"./import-fix-coordinator.js\";\n\n/**\n * Controls whether an autofix that must insert an import should also emit its\n * replacement in the same report callback.\n */\nexport type AutofixImportInsertionStrategy = \"combined\" | \"separate-pass\";\n\n/**\n * Build replacement/import fixer arrays according to an import-insertion\n * coordination decision.\n *\n * @param options - Replacement and optional import-fix factories with the\n * import-insertion decision for this report callback.\n *\n * @returns Ordered fix array (`import`, then `replacement`) when applicable;\n * otherwise `null` when the fix must be suppressed.\n */\nexport const createImportAwareFixes = ({\n autofixImportInsertionStrategy = \"combined\",\n createImportFix,\n createReplacementFix,\n fixer,\n importInsertionDecision,\n reportFixIntent = \"autofix\",\n requiresImportInsertion,\n}: Readonly<{\n autofixImportInsertionStrategy?: AutofixImportInsertionStrategy | undefined;\n createImportFix: (\n fixer: Readonly<TSESLint.RuleFixer>\n ) => null | TSESLint.RuleFix;\n createReplacementFix: (\n fixer: Readonly<TSESLint.RuleFixer>\n ) => TSESLint.RuleFix;\n fixer: Readonly<TSESLint.RuleFixer>;\n importInsertionDecision: ImportInsertionDecision;\n reportFixIntent?: ImportFixIntent | undefined;\n requiresImportInsertion: boolean;\n}>): null | readonly TSESLint.RuleFix[] => {\n if (\n requiresImportInsertion &&\n reportFixIntent === \"autofix\" &&\n autofixImportInsertionStrategy === \"separate-pass\"\n ) {\n if (!importInsertionDecision.shouldIncludeImportInsertionFix) {\n return null;\n }\n\n const importFix = createImportFix(fixer);\n if (importFix === null) {\n return null;\n }\n\n return [importFix];\n }\n\n if (!requiresImportInsertion) {\n return [createReplacementFix(fixer)];\n }\n\n if (!importInsertionDecision.shouldIncludeImportInsertionFix) {\n return importInsertionDecision.allowReplacementWithoutImportInsertion\n ? [createReplacementFix(fixer)]\n : null;\n }\n\n const importFix = createImportFix(fixer);\n if (importFix === null) {\n return null;\n }\n\n return [importFix, createReplacementFix(fixer)];\n};\n", "/**\n * @packageDocumentation\n * Shared import-insertion coordination used by import-aware replacement fixers.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { getProgramNode } from \"./ast-node.js\";\nimport { isImportInsertionFixesDisabledForNode } from \"./plugin-settings.js\";\n\n/** Classification for coordinated import insertion keys. */\nexport type ImportBindingKind = \"type\" | \"value\";\n\n/**\n * Delivery channel for a report fix callback.\n *\n * @remarks\n * - `autofix`: fix supplied through `context.report({ fix })` and coordinated so\n * only one report emits a specific import insertion per file/lint pass.\n * - `suggestion`: fix supplied through `context.report({ suggest })`; each\n * suggestion remains self-contained and therefore keeps import insertion.\n */\nexport type ImportFixIntent = \"autofix\" | \"suggestion\";\n\n/**\n * Import-insertion planning decision for one report fix callback.\n */\nexport type ImportInsertionDecision = Readonly<{\n allowReplacementWithoutImportInsertion: boolean;\n shouldIncludeImportInsertionFix: boolean;\n}>;\n\n/**\n * Input options used to resolve import-insertion coordination decisions.\n */\nexport type ImportInsertionDecisionOptions = Readonly<{\n importBindingKind: ImportBindingKind;\n importedName: string;\n referenceNode: Readonly<TSESTree.Node>;\n reportFixIntent: ImportFixIntent;\n sourceModuleName: string;\n}>;\n\n/** Claimed import-insertion keys for one Program node. */\ntype ProgramImportClaims = Set<string>;\n\n/** Program-scoped claimed import keys cache. */\nconst claimedImportKeysByProgram = new WeakMap<\n Readonly<TSESTree.Program>,\n ProgramImportClaims\n>();\n\n/**\n * Build a deterministic coordination key for one import binding.\n */\nconst createImportCoordinationKey = ({\n importBindingKind,\n importedName,\n sourceModuleName,\n}: Readonly<{\n importBindingKind: ImportBindingKind;\n importedName: string;\n sourceModuleName: string;\n}>): string =>\n `${importBindingKind}\\u0000${sourceModuleName}\\u0000${importedName}`;\n\n/**\n * Claim a coordination key for one program and return whether this call made\n * the first claim.\n */\nconst claimImportCoordinationKeyForProgram = ({\n coordinationKey,\n programNode,\n}: Readonly<{\n coordinationKey: string;\n programNode: Readonly<TSESTree.Program>;\n}>): boolean => {\n const existingClaims = claimedImportKeysByProgram.get(programNode);\n if (existingClaims?.has(coordinationKey) === true) {\n return false;\n }\n\n if (!isDefined(existingClaims)) {\n claimedImportKeysByProgram.set(programNode, new Set([coordinationKey]));\n\n return true;\n }\n\n existingClaims.add(coordinationKey);\n\n return true;\n};\n\n/**\n * Decision when import insertion should be emitted and replacement is allowed.\n */\nconst INCLUDE_IMPORT_INSERTION: ImportInsertionDecision = {\n allowReplacementWithoutImportInsertion: true,\n shouldIncludeImportInsertionFix: true,\n};\n\n/**\n * Decision when replacement depends on insertion and should be suppressed.\n */\nconst SKIP_IMPORT_INSERTION_BLOCK_REPLACEMENT: ImportInsertionDecision = {\n allowReplacementWithoutImportInsertion: false,\n shouldIncludeImportInsertionFix: false,\n};\n\n/**\n * Resolve import-insertion and replacement behavior for a report-fix callback.\n *\n * @remarks\n * This decision is made during fixer construction (AST traversal) to keep\n * behavior deterministic across repeated fix callback evaluation.\n */\nexport function resolveImportInsertionDecisionForReportFix({\n importBindingKind,\n importedName,\n referenceNode,\n reportFixIntent,\n sourceModuleName,\n}: ImportInsertionDecisionOptions): ImportInsertionDecision {\n if (reportFixIntent === \"suggestion\") {\n return INCLUDE_IMPORT_INSERTION;\n }\n\n if (isImportInsertionFixesDisabledForNode(referenceNode)) {\n return SKIP_IMPORT_INSERTION_BLOCK_REPLACEMENT;\n }\n\n const programNode = getProgramNode(referenceNode);\n if (!programNode) {\n return INCLUDE_IMPORT_INSERTION;\n }\n\n const coordinationKey = createImportCoordinationKey({\n importBindingKind,\n importedName,\n sourceModuleName,\n });\n\n if (\n !claimImportCoordinationKeyForProgram({\n coordinationKey,\n programNode,\n })\n ) {\n return SKIP_IMPORT_INSERTION_BLOCK_REPLACEMENT;\n }\n\n return INCLUDE_IMPORT_INSERTION;\n}\n", "/**\n * @packageDocumentation\n * Parsing and memoization helpers for plugin-level runtime settings.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { JsonObject, UnknownArray } from \"type-fest\";\n\nimport { isPresent, objectHasOwn } from \"ts-extras\";\n\nimport { getProgramNode } from \"./ast-node.js\";\n\n/** Top-level `settings` key for this plugin. */\nconst TYPEFEST_SETTINGS_KEY = \"typefest\";\n\n/** Flag that disables all plugin autofix behavior. */\nconst DISABLE_ALL_AUTOFIXES_KEY = \"disableAllAutofixes\";\n\n/** Flag that disables import-insertion fix helpers only. */\nconst DISABLE_IMPORT_INSERTION_FIXES_KEY = \"disableImportInsertionFixes\";\n\n/**\n * Normalized per-program settings consumed by fix-generation helpers.\n */\ntype ProgramSettings = {\n disableAllAutofixes: boolean;\n disableImportInsertionFixes: boolean;\n};\n\n/**\n * Cache of parsed settings keyed by the Program node for the active file.\n */\nconst settingsByProgram = new WeakMap<TSESTree.Program, ProgramSettings>();\n\n/**\n * Narrow an unknown value to a JSON-object-like record.\n *\n * @param value - Value to narrow.\n *\n * @returns `true` when the value is a non-null, non-array object.\n */\nconst isObject = (value: unknown): value is Readonly<JsonObject> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/**\n * Extract the `settings.typefest` object when present and valid.\n *\n * @param settings - ESLint settings value from rule context.\n *\n * @returns Parsed `settings.typefest` object when valid; otherwise `null`.\n */\nconst getTypefestSettings = (\n settings: unknown\n): null | Readonly<JsonObject> => {\n if (!isObject(settings)) {\n return null;\n }\n\n const typefestSettings = settings[TYPEFEST_SETTINGS_KEY];\n\n return isObject(typefestSettings) ? typefestSettings : null;\n};\n\n/**\n * Read a strict boolean flag (`true`) from a JSON object by key.\n *\n * @param object - Source settings object.\n * @param key - Flag key to read.\n *\n * @returns `true` only when the key exists and equals literal `true`.\n */\nconst readBooleanFlag = (object: Readonly<JsonObject>, key: string): boolean =>\n objectHasOwn(object, key) && object[key] === true;\n\n/**\n * Reads the import-insertion disable flag from plugin settings.\n *\n * @param settings - ESLint settings value from rule context.\n *\n * @returns `true` when import insertion fixes are explicitly disabled.\n */\nconst readDisableImportInsertionFixesFromSettings = (\n settings: unknown\n): boolean => {\n const typefestSettings = getTypefestSettings(settings);\n if (!isPresent(typefestSettings)) {\n return false;\n }\n\n return readBooleanFlag(\n typefestSettings,\n DISABLE_IMPORT_INSERTION_FIXES_KEY\n );\n};\n\n/**\n * Reads the global autofix disable flag from plugin settings.\n *\n * @param settings - ESLint settings value from rule context.\n *\n * @returns `true` when all plugin autofixes are explicitly disabled.\n */\nconst readDisableAllAutofixesFromSettings = (settings: unknown): boolean => {\n const typefestSettings = getTypefestSettings(settings);\n if (!isPresent(typefestSettings)) {\n return false;\n }\n\n return readBooleanFlag(typefestSettings, DISABLE_ALL_AUTOFIXES_KEY);\n};\n\n/**\n * Guard values suitable for WeakMap object keys.\n */\nconst isWeakMapKeyObject = (value: unknown): value is object =>\n typeof value === \"object\" && value !== null;\n\n/**\n * Register parsed plugin settings for the current file program.\n *\n * @param context - Active ESLint rule context.\n *\n * @returns Memoized immutable settings for the context's program node.\n */\nexport const registerProgramSettingsForContext = (\n context: Readonly<TSESLint.RuleContext<string, UnknownArray>>\n): Readonly<ProgramSettings> => {\n const programNode = context.sourceCode.ast;\n\n const disableAllAutofixes = readDisableAllAutofixesFromSettings(\n context.settings\n );\n const disableImportInsertionFixes =\n disableAllAutofixes ||\n readDisableImportInsertionFixesFromSettings(context.settings);\n\n const parsedSettings: Readonly<ProgramSettings> = Object.freeze({\n disableAllAutofixes,\n disableImportInsertionFixes,\n });\n\n if (!isWeakMapKeyObject(programNode)) {\n return parsedSettings;\n }\n\n const existingProgramSettings = settingsByProgram.get(programNode);\n if (isPresent(existingProgramSettings)) {\n return existingProgramSettings;\n }\n\n settingsByProgram.set(programNode, parsedSettings);\n\n return parsedSettings;\n};\n\n/**\n * Determine whether import insertion autofixes are globally disabled for the\n * file containing the provided node.\n *\n * @param node - AST node used to resolve the enclosing Program.\n *\n * @returns `true` when import insertion fixes should be suppressed.\n */\nexport const isImportInsertionFixesDisabledForNode = (\n node: Readonly<TSESTree.Node>\n): boolean => {\n const programNode = getProgramNode(node);\n if (!isPresent(programNode)) {\n return false;\n }\n\n const settings = settingsByProgram.get(programNode);\n\n return settings?.disableImportInsertionFixes === true;\n};\n", "/**\n * @packageDocumentation\n * Shared utilities for safely inserting import declarations in fixer output.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport parser from \"@typescript-eslint/parser\";\nimport { arrayAt, isInteger } from \"ts-extras\";\n\nimport { getProgramNode } from \"./ast-node.js\";\nimport { getBoundedCacheValue, setBoundedCacheValue } from \"./bounded-cache.js\";\nimport { safeTypeOperation } from \"./safe-type-operation.js\";\nimport { isKnownWhitespaceCharacter } from \"./text-character.js\";\n\n/**\n * Cached insertion-layout metadata for one Program node.\n */\ntype ProgramInsertionLayout = Readonly<{\n firstRelativeImportDeclaration: null | Readonly<TSESTree.ImportDeclaration>;\n firstStatementStart: null | number;\n importDeclarations: readonly Readonly<TSESTree.ImportDeclaration>[];\n lastDirectiveStatement: null | Readonly<TSESTree.ExpressionStatement>;\n lastImportDeclaration: null | Readonly<TSESTree.ImportDeclaration>;\n lastNonRelativeImportDeclaration: null | Readonly<TSESTree.ImportDeclaration>;\n programEnd: null | number;\n}>;\n\n/**\n * Program-scoped insertion-layout cache reused across repeated fixer planning.\n */\nconst programInsertionLayoutCache = new WeakMap<\n Readonly<TSESTree.Program>,\n ProgramInsertionLayout\n>();\n\nconst IMPORT_KEYWORD = \"import\" as const;\n\n/**\n * Upper bound for import-text snippets parsed to recover module specifiers.\n *\n * @remarks\n * Fix suggestions can include large synthetic text. Capping parser input keeps\n * this helper predictable on pathological inputs.\n */\nconst MAX_IMPORT_DECLARATION_TEXT_PARSE_LENGTH = 2048 as const;\n\nconst skipLeadingWhitespace = ({\n startIndex,\n text,\n}: Readonly<{\n startIndex: number;\n text: string;\n}>): number => {\n let index = startIndex;\n\n while (\n index < text.length &&\n isKnownWhitespaceCharacter(text[index] ?? \"\")\n ) {\n index += 1;\n }\n\n return index;\n};\n\nconst MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES = 256 as const;\n\nconst parsedModuleSpecifierByImportText = new Map<string, null | string>();\n\nconst isTrailingImportText = (text: string): boolean => {\n const trailingText = text.trim();\n\n return trailingText === \"\" || trailingText === \";\";\n};\n\nconst parseModuleSpecifierFromImportDeclarationText = (\n importDeclarationText: string\n): null | string => {\n const parsedResult = safeTypeOperation({\n operation: () =>\n parser.parseForESLint(importDeclarationText, {\n ecmaVersion: \"latest\",\n loc: false,\n range: false,\n sourceType: \"module\",\n }),\n reason: \"import-insertion-module-specifier-parse-failed\",\n });\n\n if (!parsedResult.ok) {\n return null;\n }\n\n const [firstStatement] = parsedResult.value.ast.body;\n\n if (\n parsedResult.value.ast.body.length !== 1 ||\n firstStatement?.type !== \"ImportDeclaration\"\n ) {\n return null;\n }\n\n const moduleSpecifier = firstStatement.source.value;\n\n return typeof moduleSpecifier === \"string\" ? moduleSpecifier : null;\n};\n\n/**\n * Extract the module specifier from an import declaration text snippet.\n */\nconst getModuleSpecifierFromImportDeclarationText = (\n importDeclarationText: string\n): null | string => {\n const trimmedImportText = importDeclarationText.trim();\n\n if (trimmedImportText.length > MAX_IMPORT_DECLARATION_TEXT_PARSE_LENGTH) {\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: null,\n });\n\n return null;\n }\n\n const cachedModuleSpecifierLookup = getBoundedCacheValue(\n parsedModuleSpecifierByImportText,\n trimmedImportText\n );\n\n if (cachedModuleSpecifierLookup.found) {\n return cachedModuleSpecifierLookup.value ?? null;\n }\n\n if (!trimmedImportText.startsWith(IMPORT_KEYWORD)) {\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: null,\n });\n\n return null;\n }\n\n const importClauseStart = skipLeadingWhitespace({\n startIndex: IMPORT_KEYWORD.length,\n text: trimmedImportText,\n });\n\n if (importClauseStart >= trimmedImportText.length) {\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: null,\n });\n\n return null;\n }\n\n const moduleSpecifier =\n parseModuleSpecifierFromImportDeclarationText(trimmedImportText);\n\n if (moduleSpecifier !== null) {\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: moduleSpecifier,\n });\n\n return moduleSpecifier;\n }\n\n const semicolonIndex = trimmedImportText.lastIndexOf(\";\");\n const trailingImportText =\n semicolonIndex === -1\n ? \"\"\n : trimmedImportText.slice(semicolonIndex + 1);\n\n if (!isTrailingImportText(trailingImportText)) {\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: null,\n });\n\n return null;\n }\n\n setBoundedCacheValue({\n cache: parsedModuleSpecifierByImportText,\n key: trimmedImportText,\n maxEntries: MAX_PARSED_MODULE_SPECIFIER_CACHE_ENTRIES,\n value: null,\n });\n\n return null;\n};\n\n/**\n * Determine whether a module specifier is relative (`./` or `../`) or rooted.\n */\nconst isRelativeModuleSpecifier = (moduleSpecifier: string): boolean =>\n moduleSpecifier.startsWith(\".\") || moduleSpecifier.startsWith(\"/\");\n\n/**\n * Read a string-valued module specifier from an import declaration node.\n */\nconst getImportDeclarationModuleSpecifier = (\n importDeclaration: Readonly<TSESTree.ImportDeclaration>\n): null | string => {\n const sourceValue = importDeclaration.source.value;\n\n return typeof sourceValue === \"string\" ? sourceValue : null;\n};\n\n/**\n * Check whether a Program statement is part of the directive prologue (for\n * example, `\"use strict\"`).\n */\nconst isDirectiveExpressionStatement = (\n statement: Readonly<TSESTree.ProgramStatement>\n): statement is TSESTree.ExpressionStatement & { directive: string } =>\n statement.type === \"ExpressionStatement\" &&\n typeof statement.directive === \"string\";\n\n/**\n * Read and validate a node range tuple.\n *\n * @param node - Node whose range should be extracted.\n *\n * @returns `[start, end]` tuple when available and valid; otherwise `null`.\n */\nconst getNodeRange = (\n node: Readonly<TSESTree.Node>\n): null | readonly [number, number] => {\n const nodeRange = node.range;\n\n if (!Array.isArray(nodeRange)) {\n return null;\n }\n\n const [start, end] = nodeRange;\n\n if (!isInteger(start) || !isInteger(end)) {\n return null;\n }\n\n if (start < 0 || end < start) {\n return null;\n }\n\n return [start, end];\n};\n\n/**\n * Read the numeric start offset from an ESTree node range tuple.\n *\n * @param node - Node whose start offset should be extracted.\n *\n * @returns Numeric start offset when available; otherwise `null`.\n */\nconst getNodeRangeStart = (node: Readonly<TSESTree.Node>): null | number => {\n const nodeRange = getNodeRange(node);\n if (nodeRange === null) {\n return null;\n }\n\n return arrayAt(nodeRange, 0) ?? null;\n};\n\n/**\n * Read and validate the Program end offset from its range tuple.\n *\n * @param programNode - Program node whose range end should be read.\n *\n * @returns Valid end offset when available; otherwise `null`.\n */\nconst getProgramRangeEnd = (\n programNode: Readonly<TSESTree.Program>\n): null | number => {\n const programRange = getNodeRange(programNode);\n\n return programRange?.[1] ?? null;\n};\n\n/**\n * Build and cache insertion-layout metadata for one Program.\n */\nconst getProgramInsertionLayout = (\n programNode: Readonly<TSESTree.Program>\n): ProgramInsertionLayout => {\n const existingLayout = programInsertionLayoutCache.get(programNode);\n if (existingLayout) {\n return existingLayout;\n }\n\n const importDeclarations: TSESTree.ImportDeclaration[] = [];\n let firstRelativeImportDeclaration: null | Readonly<TSESTree.ImportDeclaration> =\n null;\n let lastNonRelativeImportDeclaration: null | Readonly<TSESTree.ImportDeclaration> =\n null;\n let lastDirectiveStatement: null | Readonly<TSESTree.ExpressionStatement> =\n null;\n let inDirectivePrologue = true;\n\n for (const statement of programNode.body) {\n if (inDirectivePrologue && isDirectiveExpressionStatement(statement)) {\n lastDirectiveStatement = statement;\n } else {\n inDirectivePrologue = false;\n }\n\n if (statement.type !== \"ImportDeclaration\") {\n continue;\n }\n\n importDeclarations.push(statement);\n\n const existingModuleSpecifier =\n getImportDeclarationModuleSpecifier(statement);\n\n if (\n typeof existingModuleSpecifier === \"string\" &&\n isRelativeModuleSpecifier(existingModuleSpecifier)\n ) {\n firstRelativeImportDeclaration ??= statement;\n\n continue;\n }\n\n lastNonRelativeImportDeclaration = statement;\n }\n\n const [firstStatement] = programNode.body;\n\n const layout: ProgramInsertionLayout = Object.freeze({\n firstRelativeImportDeclaration,\n firstStatementStart:\n firstStatement === undefined\n ? null\n : getNodeRangeStart(firstStatement),\n importDeclarations: Object.freeze(importDeclarations),\n lastDirectiveStatement,\n lastImportDeclaration: arrayAt(importDeclarations, -1) ?? null,\n lastNonRelativeImportDeclaration,\n programEnd: getProgramRangeEnd(programNode),\n });\n\n programInsertionLayoutCache.set(programNode, layout);\n\n return layout;\n};\n\n/**\n * Create a fixer that inserts an import declaration in a safe location: after\n * existing imports, after directive prologue, before first statement, or at\n * file end for empty programs.\n *\n * @param options - Fix-planning options.\n *\n * - `fixer`: Rule fixer from ESLint.\n * - `referenceNode`: Node used to discover the enclosing Program.\n * - `importDeclarationText`: Full import declaration text to insert.\n * - `moduleSpecifierHint`: Optional known module specifier that skips import-text\n * parsing when provided.\n *\n * @returns Rule fix when insertion is possible; otherwise `null`.\n */\nexport const createImportInsertionFix = (\n options: Readonly<{\n fixer: TSESLint.RuleFixer;\n importDeclarationText: string;\n moduleSpecifierHint?: string;\n referenceNode: Readonly<TSESTree.Node>;\n }>\n): null | TSESLint.RuleFix => {\n const { fixer, importDeclarationText, moduleSpecifierHint, referenceNode } =\n options;\n\n const normalizedImportDeclarationText = importDeclarationText.trim();\n if (normalizedImportDeclarationText.length === 0) {\n return null;\n }\n\n const programNode = getProgramNode(referenceNode);\n if (!programNode) {\n return null;\n }\n\n const insertionLayout = getProgramInsertionLayout(programNode);\n\n if (insertionLayout.importDeclarations.length > 0) {\n const moduleSpecifier =\n moduleSpecifierHint ??\n getModuleSpecifierFromImportDeclarationText(\n normalizedImportDeclarationText\n );\n\n if (\n typeof moduleSpecifier === \"string\" &&\n !isRelativeModuleSpecifier(moduleSpecifier)\n ) {\n if (insertionLayout.lastNonRelativeImportDeclaration !== null) {\n return fixer.insertTextAfter(\n insertionLayout.lastNonRelativeImportDeclaration,\n `\\n${normalizedImportDeclarationText}`\n );\n }\n\n if (insertionLayout.firstRelativeImportDeclaration !== null) {\n const firstRelativeImportStart = getNodeRangeStart(\n insertionLayout.firstRelativeImportDeclaration\n );\n\n if (firstRelativeImportStart !== null) {\n return fixer.insertTextBeforeRange(\n [firstRelativeImportStart, firstRelativeImportStart],\n `${normalizedImportDeclarationText}\\n`\n );\n }\n }\n }\n }\n\n if (insertionLayout.lastImportDeclaration !== null) {\n return fixer.insertTextAfter(\n insertionLayout.lastImportDeclaration,\n `\\n${normalizedImportDeclarationText}`\n );\n }\n\n if (insertionLayout.lastDirectiveStatement !== null) {\n return fixer.insertTextAfter(\n insertionLayout.lastDirectiveStatement,\n `\\n${normalizedImportDeclarationText}`\n );\n }\n\n if (insertionLayout.firstStatementStart !== null) {\n return fixer.insertTextBeforeRange(\n [\n insertionLayout.firstStatementStart,\n insertionLayout.firstStatementStart,\n ],\n `${normalizedImportDeclarationText}\\n`\n );\n }\n\n if (insertionLayout.programEnd === null) {\n return null;\n }\n\n return fixer.insertTextBeforeRange(\n [insertionLayout.programEnd, insertionLayout.programEnd],\n `${insertionLayout.programEnd === 0 ? \"\" : \"\\n\"}${normalizedImportDeclarationText}\\n`\n );\n};\n", "/**\n * @packageDocumentation\n * Shared bounded-cache helpers with lightweight LRU semantics for hot-path\n * parser/type-analysis caches.\n */\n\nimport { isSafeInteger } from \"ts-extras\";\n\n/**\n * Result shape returned by bounded-cache lookups.\n */\nexport type BoundedCacheLookupResult<Value> =\n | Readonly<{\n found: false;\n }>\n | Readonly<{\n found: true;\n value: Value;\n }>;\n\n/**\n * Read a cache entry and mark it as most-recently-used.\n *\n * @param cache - Mutable cache map.\n * @param key - Entry key.\n *\n * @returns Lookup result describing whether an entry was found. When found,\n * includes the cached value (which can itself be `undefined`/`null`).\n */\nexport const getBoundedCacheValue = <Key, Value>(\n cache: Map<Key, Value>,\n key: Key\n): BoundedCacheLookupResult<Value> => {\n if (!cache.has(key)) {\n return {\n found: false,\n };\n }\n\n const value = cache.get(key) as Value;\n\n cache.delete(key);\n cache.set(key, value);\n\n return {\n found: true,\n value,\n };\n};\n\n/**\n * Insert or update a cache entry and evict least-recently-used entries beyond\n * the configured max size.\n *\n * @param options - Bounded-cache insertion options.\n *\n * - `cache`: Mutable cache map.\n * - `key`: Entry key.\n * - `maxEntries`: Maximum number of cache entries to retain.\n * - `value`: Entry value.\n */\nexport const setBoundedCacheValue = <Key, Value>({\n cache,\n key,\n maxEntries,\n value,\n}: Readonly<{\n cache: Map<Key, Value>;\n key: Key;\n maxEntries: number;\n value: Value;\n}>): void => {\n if (!isSafeInteger(maxEntries) || maxEntries < 1) {\n return;\n }\n\n if (cache.has(key)) {\n cache.delete(key);\n }\n\n cache.set(key, value);\n\n while (cache.size > maxEntries) {\n const oldestEntry = cache.keys().next();\n\n if (oldestEntry.done === true) {\n return;\n }\n\n cache.delete(oldestEntry.value);\n }\n};\n", "/**\n * @packageDocumentation\n * Shared character classification helpers for lightweight parser/token logic.\n */\n\nimport { isDefined } from \"ts-extras\";\n\nconst ASCII_DIGIT_ZERO = 48 as const;\nconst ASCII_DIGIT_NINE = 57 as const;\nconst ASCII_UPPERCASE_A = 65 as const;\nconst ASCII_UPPERCASE_Z = 90 as const;\nconst ASCII_LOWERCASE_A = 97 as const;\nconst ASCII_LOWERCASE_Z = 122 as const;\n\nconst ASCII_TAB = 9 as const;\nconst ASCII_LINE_FEED = 10 as const;\nconst ASCII_VERTICAL_TAB = 11 as const;\nconst ASCII_FORM_FEED = 12 as const;\nconst ASCII_CARRIAGE_RETURN = 13 as const;\nconst ASCII_SPACE = 32 as const;\nconst NO_BREAK_SPACE = 160 as const;\nconst BYTE_ORDER_MARK = 65_279 as const;\nconst LINE_SEPARATOR = 8232 as const;\nconst PARAGRAPH_SEPARATOR = 8233 as const;\n\nconst DOLLAR_SIGN = \"$\" as const;\nconst UNDERSCORE = \"_\" as const;\n\n/**\n * Determine whether a single-character string is an ASCII identifier part.\n *\n * @remarks\n * This intentionally mirrors lightweight token checks used by internal string\n * parsers. It does not attempt to model full Unicode ECMAScript identifiers.\n */\nexport const isAsciiIdentifierPartCharacter = (character: string): boolean => {\n if (character === DOLLAR_SIGN || character === UNDERSCORE) {\n return true;\n }\n\n if (character.length === 0) {\n return false;\n }\n\n const codePoint = character.codePointAt(0);\n\n if (!isDefined(codePoint)) {\n return false;\n }\n\n return (\n (codePoint >= ASCII_DIGIT_ZERO && codePoint <= ASCII_DIGIT_NINE) ||\n (codePoint >= ASCII_UPPERCASE_A && codePoint <= ASCII_UPPERCASE_Z) ||\n (codePoint >= ASCII_LOWERCASE_A && codePoint <= ASCII_LOWERCASE_Z)\n );\n};\n\n/**\n * Determine whether a single-character string should be treated as whitespace\n * in internal import/token parsing helpers.\n */\nexport const isKnownWhitespaceCharacter = (character: string): boolean => {\n if (character.length === 0) {\n return false;\n }\n\n const codePoint = character.codePointAt(0);\n\n if (!isDefined(codePoint)) {\n return false;\n }\n\n return (\n codePoint === ASCII_TAB ||\n codePoint === ASCII_LINE_FEED ||\n codePoint === ASCII_VERTICAL_TAB ||\n codePoint === ASCII_FORM_FEED ||\n codePoint === ASCII_CARRIAGE_RETURN ||\n codePoint === ASCII_SPACE ||\n codePoint === NO_BREAK_SPACE ||\n codePoint === BYTE_ORDER_MARK ||\n codePoint === LINE_SEPARATOR ||\n codePoint === PARAGRAPH_SEPARATOR\n );\n};\n", "/**\n * @packageDocumentation\n * Context/source-code scope-resolution helpers.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { safeCastTo } from \"ts-extras\";\n\ntype SourceCodeScopeGetter = Readonly<{\n getScope: (node: Readonly<TSESTree.Node>) => TSESLint.Scope.Scope;\n}>;\n\n/**\n * Resolve the lexical scope for a node via modern SourceCode APIs.\n *\n * @remarks\n * ESLint v9+ exposes scope lookups via `context.sourceCode.getScope(node)`.\n * This helper intentionally does not use legacy `context.getScope()`.\n *\n * @param context - Active rule context.\n * @param node - Node used as the scope lookup anchor.\n *\n * @returns Scope when available; otherwise `null`.\n */\nexport const getScopeFromContextSourceCode = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n node: Readonly<TSESTree.Node>\n): null | Readonly<TSESLint.Scope.Scope> => {\n const sourceCodeMaybeWithScope = safeCastTo<\n Partial<SourceCodeScopeGetter> | undefined\n >(context.sourceCode);\n\n if (typeof sourceCodeMaybeWithScope?.getScope !== \"function\") {\n return null;\n }\n\n return sourceCodeMaybeWithScope.getScope(node);\n};\n", "/**\n * @packageDocumentation\n * Scope-chain helpers for reliable variable-resolution checks.\n */\nimport type { TSESLint } from \"@typescript-eslint/utils\";\n\nimport { resolveFirstValueInLinkedStructure } from \"./cycle-safe-linked-search.js\";\n\n/**\n * Resolve a variable binding by walking the current scope and all parent\n * scopes.\n *\n * @param scope - Initial scope to inspect.\n * @param variableName - Identifier name to resolve.\n *\n * @returns Matched variable binding from the nearest scope chain; otherwise\n * `null`.\n */\nexport const getVariableInScopeChain = (\n scope: Readonly<null | Readonly<TSESLint.Scope.Scope>>,\n variableName: string\n): null | TSESLint.Scope.Variable => {\n const lookupResult = resolveFirstValueInLinkedStructure<\n Readonly<TSESLint.Scope.Scope>,\n TSESLint.Scope.Variable\n >({\n getNextNode: (\n currentScope: Readonly<TSESLint.Scope.Scope>\n ): null | Readonly<TSESLint.Scope.Scope> => currentScope.upper,\n resolveValue: (currentScope: Readonly<TSESLint.Scope.Scope>) => {\n const variable = currentScope.set.get(variableName);\n\n return variable === undefined\n ? {\n found: false,\n }\n : {\n found: true,\n value: variable,\n };\n },\n startNode: scope,\n });\n\n return lookupResult.found ? lookupResult.value : null;\n};\n", "/**\n * @packageDocumentation\n * Shared call-expression helpers for matching method calls safely.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * Strongly-typed shape for non-computed member calls with identifier receiver\n * and property (e.g. `Object.keys`).\n */\nexport type IdentifierMemberCallExpression = TSESTree.CallExpression & {\n callee: TSESTree.MemberExpression & {\n computed: false;\n object: TSESTree.Identifier;\n property: TSESTree.Identifier;\n };\n};\n\n/**\n * Strongly-typed shape for non-computed member calls with identifier property\n * (e.g. `value.includes`).\n */\nexport type IdentifierPropertyMemberCallExpression = TSESTree.CallExpression & {\n callee: TSESTree.MemberExpression & {\n computed: false;\n object: Exclude<TSESTree.MemberExpression[\"object\"], TSESTree.Super>;\n property: TSESTree.Identifier;\n };\n};\n\n/**\n * Match `ObjectName.methodName(...)` style calls.\n *\n * @param options - Candidate call expression and expected receiver/member\n * names.\n *\n * @returns Narrowed call expression when the shape matches; otherwise `null`.\n */\nexport const getIdentifierMemberCall = ({\n memberName,\n node,\n objectName,\n}: Readonly<{\n memberName: string;\n node: Readonly<TSESTree.CallExpression>;\n objectName: string;\n}>): IdentifierMemberCallExpression | null => {\n if (node.optional) {\n return null;\n }\n\n const { callee } = node;\n\n if (\n callee.type !== \"MemberExpression\" ||\n callee.computed ||\n callee.optional ||\n callee.object.type !== \"Identifier\" ||\n callee.object.name !== objectName ||\n callee.property.type !== \"Identifier\" ||\n callee.property.name !== memberName\n ) {\n return null;\n }\n\n return node as IdentifierMemberCallExpression;\n};\n\n/**\n * Match `<expression>.memberName(...)` style calls where the property is a\n * non-computed identifier.\n *\n * @param options - Candidate call expression and expected member name.\n *\n * @returns Narrowed call expression when matched; otherwise `null`.\n */\nexport const getIdentifierPropertyMemberCall = ({\n memberName,\n node,\n}: Readonly<{\n memberName: string;\n node: Readonly<TSESTree.CallExpression>;\n}>): IdentifierPropertyMemberCallExpression | null => {\n if (node.optional) {\n return null;\n }\n\n const { callee } = node;\n\n if (\n callee.type !== \"MemberExpression\" ||\n callee.computed ||\n callee.optional ||\n callee.object.type === \"Super\" ||\n callee.property.type !== \"Identifier\" ||\n callee.property.name !== memberName\n ) {\n return null;\n }\n\n return node as IdentifierPropertyMemberCallExpression;\n};\n", "/**\n * @packageDocumentation\n * Canonical module-source string constants used across rule internals.\n */\n\n/** Canonical source module string for `ts-extras` helpers. */\nexport const TS_EXTRAS_MODULE_SOURCE = \"ts-extras\" as const;\n\n/** Canonical source module string for `type-fest` type utilities. */\nexport const TYPE_FEST_MODULE_SOURCE = \"type-fest\" as const;\n\n/** Canonical source module string for `@typescript-eslint/utils`. */\nexport const TYPESCRIPT_ESLINT_UTILS_MODULE_SOURCE =\n \"@typescript-eslint/utils\" as const;\n", "/**\n * @packageDocumentation\n * Explicit report-adapter utilities for rule-level autofix policy handling.\n */\nimport type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { isDefined, objectHasOwn } from \"ts-extras\";\n\n/**\n * Report callback type for a given message/options pair.\n */\ntype ReportCallback<\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n> = TSESLint.RuleContext<MessageIds, Options>[\"report\"];\n\n/**\n * Canonical report descriptor type for a given message/options pair.\n */\ntype ReportDescriptor<\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n> = Parameters<ReportCallback<MessageIds, Options>>[0];\n\n/**\n * Determine whether a report descriptor has a callable own data-property `fix`\n * value that can be safely omitted.\n */\nconst hasCallableOwnFixDataProperty = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n descriptor: Readonly<ReportDescriptor<MessageIds, Options>>\n): boolean => {\n const ownFixDescriptor = Object.getOwnPropertyDescriptor(descriptor, \"fix\");\n if (!isDefined(ownFixDescriptor)) {\n return false;\n }\n\n if (!objectHasOwn(ownFixDescriptor, \"value\")) {\n return false;\n }\n\n return typeof ownFixDescriptor.value === \"function\";\n};\n\n/**\n * Remove top-level autofix from a report descriptor while preserving all other\n * fields (including suggestions).\n */\nexport const omitAutofixFromReportDescriptor = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n descriptor: Readonly<ReportDescriptor<MessageIds, Options>>\n): ReportDescriptor<MessageIds, Options> => {\n if (!hasCallableOwnFixDataProperty(descriptor)) {\n return descriptor;\n }\n\n const descriptorWithoutFix = {\n ...descriptor,\n };\n\n delete descriptorWithoutFix.fix;\n\n return descriptorWithoutFix;\n};\n\n/**\n * Build a report callback that enforces no-top-level-autofix semantics.\n */\nexport const createReportWithoutAutofixes =\n <MessageIds extends string, Options extends Readonly<UnknownArray>>(\n report: ReportCallback<MessageIds, Options>\n ): ReportCallback<MessageIds, Options> =>\n (descriptor) => {\n report(omitAutofixFromReportDescriptor(descriptor));\n };\n", "/**\n * @packageDocumentation\n * Shared helpers for consistent rule reporting with optional fixes and\n * suggestion fallbacks.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { registerProgramSettingsForContext } from \"./plugin-settings.js\";\nimport { omitAutofixFromReportDescriptor } from \"./report-adapter.js\";\n\n/**\n * Resolution result for optional fix/suggestion reporting.\n */\nexport type AutofixOrSuggestionOutcome =\n | Readonly<{ fix: TSESLint.ReportFixFunction; kind: \"autofix\" }>\n | Readonly<{ fix: TSESLint.ReportFixFunction; kind: \"suggestion\" }>\n | Readonly<{ kind: \"no-fix\" }>;\n\n/** Input shape for {@link resolveAutofixOrSuggestionOutcome}. */\ntype AutofixOrSuggestionResolutionInput = Readonly<{\n canAutofix: boolean;\n fix: null | TSESLint.ReportFixFunction;\n}>;\n\n/** Concrete report descriptor type for a rule context. */\ntype ReportDescriptor<\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n> = Parameters<TSESLint.RuleContext<MessageIds, Options>[\"report\"]>[0];\n\n/**\n * Report using plugin-aware autofix policy handling.\n */\nexport const reportWithTypefestPolicy = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>({\n context,\n descriptor,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>;\n descriptor: ReportDescriptor<MessageIds, Options>;\n}>): void => {\n const settings = registerProgramSettingsForContext(context);\n\n if (!settings.disableAllAutofixes) {\n context.report(descriptor);\n\n return;\n }\n\n context.report(omitAutofixFromReportDescriptor(descriptor));\n};\n\n/**\n * Report a diagnostic with an optional direct fix.\n *\n * @remarks\n * When `fix` is absent this reports only `messageId` + `node`.\n */\nexport const reportWithOptionalFix = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>({\n context,\n data,\n fix,\n messageId,\n node,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>;\n data?: ReportDescriptor<MessageIds, Options>[\"data\"];\n fix: null | TSESLint.ReportFixFunction;\n messageId: MessageIds;\n node: TSESTree.Node;\n}>): void => {\n const descriptor: ReportDescriptor<MessageIds, Options> = {\n ...(data === undefined ? {} : { data }),\n ...(fix === null ? {} : { fix }),\n messageId,\n node,\n };\n\n reportWithTypefestPolicy({\n context,\n descriptor,\n });\n};\n\n/**\n * Resolve one of three standardized reporting outcomes:\n *\n * - No fix (`messageId` only),\n * - Direct autofix (`fix`), or\n * - Suggestion-only (`suggest`).\n */\nexport function resolveAutofixOrSuggestionOutcome({\n canAutofix,\n fix,\n}: AutofixOrSuggestionResolutionInput): AutofixOrSuggestionOutcome {\n if (fix === null) {\n return {\n kind: \"no-fix\",\n };\n }\n\n if (canAutofix) {\n return {\n fix,\n kind: \"autofix\",\n };\n }\n\n return {\n fix,\n kind: \"suggestion\",\n };\n}\n\n/**\n * Report a previously resolved autofix/suggestion outcome.\n *\n * @remarks\n * - Suggestion outcomes are reported with a single `suggest` entry.\n * - Autofix and no-fix outcomes are delegated to {@link reportWithOptionalFix}.\n */\nexport const reportResolvedAutofixOrSuggestionOutcome = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>({\n context,\n data,\n messageId,\n node,\n outcome,\n suggestionMessageId,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>;\n data?: ReportDescriptor<MessageIds, Options>[\"data\"];\n messageId: MessageIds;\n node: TSESTree.Node;\n outcome: AutofixOrSuggestionOutcome;\n suggestionMessageId: MessageIds;\n}>): void => {\n if (outcome.kind === \"suggestion\") {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n ...(data === undefined ? {} : { data }),\n messageId,\n node,\n suggest: [\n {\n fix: outcome.fix,\n messageId: suggestionMessageId,\n },\n ],\n },\n });\n\n return;\n }\n\n reportWithOptionalFix({\n context,\n data,\n fix: outcome.kind === \"autofix\" ? outcome.fix : null,\n messageId,\n node,\n });\n};\n", "/**\n * @packageDocumentation\n * Shared reporting helper for ts-extras array-method call replacement rules.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport {\n createMethodToFunctionCallFix,\n type ImportedValueAliasMap,\n} from \"./imported-value-symbols.js\";\nimport { getIdentifierPropertyMemberCall } from \"./member-call.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"./module-source.js\";\nimport {\n reportResolvedAutofixOrSuggestionOutcome,\n resolveAutofixOrSuggestionOutcome,\n} from \"./rule-reporting.js\";\n\n/** Typed rule context shape for array-method rule listeners. */\ntype ArrayMethodRuleContext<MessageId extends string> = Readonly<\n TSESLint.RuleContext<MessageId, Readonly<UnknownArray>>\n>;\n\n/** Direct named value imports collection type from shared import helper. */\ntype DirectNamedValueImports = ImportedValueAliasMap;\n\n/**\n * Match `<arrayExpr>.<method>(...)` and report a standardized ts-extras helper\n * replacement when the receiver is array-like.\n */\nexport const reportTsExtrasArrayMethodCall = <MessageId extends string>({\n canAutofix,\n context,\n importedName,\n imports,\n isArrayLikeExpression,\n memberName,\n messageId,\n node,\n reportSuggestion,\n suggestionMessageId,\n}: Readonly<{\n canAutofix?: (node: Readonly<TSESTree.CallExpression>) => boolean;\n context: ArrayMethodRuleContext<MessageId>;\n importedName: string;\n imports: DirectNamedValueImports;\n isArrayLikeExpression: (\n expression: Readonly<TSESTree.Expression>\n ) => boolean;\n memberName: string;\n messageId: MessageId;\n node: Readonly<TSESTree.CallExpression>;\n reportSuggestion?: (\n input: Readonly<{\n fix: TSESLint.ReportFixFunction;\n messageId: MessageId;\n node: Readonly<TSESTree.CallExpression>;\n suggestionMessageId: MessageId;\n }>\n ) => void;\n suggestionMessageId?: MessageId;\n}>): void => {\n const memberCall = getIdentifierPropertyMemberCall({\n memberName,\n node,\n });\n\n if (memberCall === null) {\n return;\n }\n\n if (!isArrayLikeExpression(memberCall.callee.object)) {\n return;\n }\n\n const shouldAutofix = canAutofix?.(node) ?? true;\n const fix = createMethodToFunctionCallFix({\n callNode: node,\n context,\n importedName,\n imports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n });\n\n const outcome = resolveAutofixOrSuggestionOutcome({\n canAutofix: shouldAutofix,\n fix,\n });\n\n if (outcome.kind === \"suggestion\" && reportSuggestion !== undefined) {\n reportSuggestion({\n fix: outcome.fix,\n messageId,\n node,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n\n return;\n }\n\n reportResolvedAutofixOrSuggestionOutcome({\n context,\n messageId,\n node,\n outcome,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n};\n", "/**\n * @packageDocumentation\n * Internal shared utilities used by eslint-plugin-typefest rule modules and\n * plugin wiring.\n */\nimport type { Except, UnknownArray } from \"type-fest\";\nimport type ts from \"typescript\";\n\nimport {\n ESLintUtils,\n type TSESLint,\n type TSESTree,\n} from \"@typescript-eslint/utils\";\nimport { assertDefined, isDefined } from \"ts-extras\";\n\nimport type { TypefestConfigReference } from \"./typefest-config-references.js\";\n\nimport { registerProgramSettingsForContext } from \"./plugin-settings.js\";\nimport { getRuleCatalogEntryForRuleNameOrNull } from \"./rule-catalog.js\";\nimport { createRuleDocsUrl } from \"./rule-docs-url.js\";\nimport { safeTypeOperation } from \"./safe-type-operation.js\";\nimport { getScopeFromContextSourceCode } from \"./scope-resolution.js\";\nimport { getVariableInScopeChain } from \"./scope-variable.js\";\nimport { getTypeCheckerIsTypeAssignableToResult } from \"./type-checker-compat.js\";\n\n/**\n * Current rule-catalog revision identifier stamped into `meta.docs`.\n */\nconst RULE_CATALOG_ID = \"R002\" as const;\n\n/**\n * Parser services and type checker bundle used by typed rules.\n */\nexport type TypedRuleServices = {\n checker: ts.TypeChecker;\n parserServices: ReturnType<typeof ESLintUtils.getParserServices>;\n};\n\n/** Shared typed-rule context contract used by helper utilities. */\ntype TypedRuleContext = Readonly<TSESLint.RuleContext<string, UnknownArray>>;\n\nexport type { TypedRuleContext };\n\ntype TypefestRuleCreator = ReturnType<\n typeof ESLintUtils.RuleCreator<TypefestRuleInputDocs>\n>;\n\n/**\n * Plugin-specific metadata extensions for `meta.docs`.\n *\n * @remarks\n * `eslint-plugin/require-meta-docs-recommended` expects `meta.docs.recommended`\n * to be boolean. Preset membership is tracked separately via\n * `meta.docs.typefestConfigs`.\n */\ntype TypefestRuleDocs = {\n recommended?: boolean;\n requiresTypeChecking?: boolean;\n ruleCatalogId: string;\n ruleId?: string;\n ruleNumber?: number;\n typefestConfigs?:\n | readonly TypefestConfigReference[]\n | TypefestConfigReference;\n};\n\n/**\n * Rule authoring metadata contract accepted by `RuleCreator`.\n *\n * @remarks\n * `ruleCatalogId` is injected centrally by `createTypedRule`, so authored rule\n * modules are not required to provide it.\n */\ntype TypefestRuleInputDocs = Except<TypefestRuleDocs, \"ruleCatalogId\"> & {\n ruleCatalogId?: string;\n};\n\n/**\n * Rule-creator wrapper used by all plugin rules.\n *\n * @remarks\n * This wrapper automatically registers per-program plugin settings.\n *\n * @param ruleDefinition - Rule module definition passed to\n * `ESLintUtils.RuleCreator`.\n *\n * @returns Rule module factory output that auto-registers program settings and\n * preserves the authored rule contract.\n */\nexport const createTypedRule: TypefestRuleCreator = (ruleDefinition) => {\n const catalogEntry = getRuleCatalogEntryForRuleNameOrNull(\n ruleDefinition.name\n );\n const createdRule = ESLintUtils.RuleCreator.withoutDocs(ruleDefinition);\n const ruleDocs = createdRule.meta.docs;\n assertDefined(ruleDocs);\n const canonicalDocsUrl = createRuleDocsUrl(ruleDefinition.name);\n\n if (typeof ruleDocs.url === \"string\" && ruleDocs.url !== canonicalDocsUrl) {\n throw new TypeError(\n `Rule '${ruleDefinition.name}' has non-canonical docs.url '${ruleDocs.url}'. Expected '${canonicalDocsUrl}'.`\n );\n }\n\n if (ruleDefinition.name.startsWith(\"prefer-\") && catalogEntry === null) {\n throw new TypeError(\n `Rule '${ruleDefinition.name}' is missing from the stable rule catalog.`\n );\n }\n\n const docsWithCatalog: TSESLint.RuleMetaDataDocs & TypefestRuleDocs =\n catalogEntry === null\n ? {\n ...ruleDocs,\n ruleCatalogId: RULE_CATALOG_ID,\n url: canonicalDocsUrl,\n }\n : {\n ...ruleDocs,\n ruleCatalogId: RULE_CATALOG_ID,\n ruleId: catalogEntry.ruleId,\n ruleNumber: catalogEntry.ruleNumber,\n url: canonicalDocsUrl,\n };\n\n const metaDefaultOptions = createdRule.meta.defaultOptions;\n\n return {\n ...createdRule,\n create(context) {\n registerProgramSettingsForContext(context);\n\n return createdRule.create(context);\n },\n meta: {\n ...createdRule.meta,\n ...(isDefined(metaDefaultOptions)\n ? { defaultOptions: metaDefaultOptions }\n : {}),\n docs: docsWithCatalog,\n },\n name: ruleDefinition.name,\n };\n};\n\n/**\n * Retrieve parser services and type checker for typed rules.\n *\n * @param context - Rule context from the current lint evaluation.\n *\n * @returns Parser services and type checker references bound to the current\n * program.\n *\n * @throws Throws when `parserServices.program` is unavailable, which indicates\n * the current lint run is not configured for type-aware analysis.\n */\nexport const getTypedRuleServices = (\n context: TypedRuleContext\n): TypedRuleServices => {\n const parserServices = ESLintUtils.getParserServices(context, true);\n const program = parserServices.program;\n\n if (program === null) {\n throw new Error(\n \"Typed rule requires parserServices.program; ensure projectService is enabled for this lint run.\"\n );\n }\n\n return {\n checker: program.getTypeChecker(),\n parserServices,\n };\n};\n\n/**\n * Determine whether the current lint context has full type information.\n *\n * @param context - Rule context from the current lint evaluation.\n *\n * @returns `true` when parser services and `program` are available.\n */\nexport const hasTypeServices = (context: TypedRuleContext): boolean => {\n const parserServicesResult = safeTypeOperation({\n operation: () => ESLintUtils.getParserServices(context, true),\n reason: \"typed-rule-services-check-failed\",\n });\n\n return (\n parserServicesResult.ok && parserServicesResult.value.program !== null\n );\n};\n\n/**\n * Retrieve typed services when available, otherwise return `undefined`.\n *\n * @param context - Rule context from the current lint evaluation.\n *\n * @returns Typed services when parser services include a TypeScript program.\n */\nexport const getTypedRuleServicesOrUndefined = (\n context: TypedRuleContext\n): TypedRuleServices | undefined =>\n hasTypeServices(context) ? getTypedRuleServices(context) : undefined;\n\n/**\n * Determine whether one TypeScript type is assignable to another.\n *\n * @remarks\n * Uses `checker.isTypeAssignableTo` when available and falls back to strict\n * reference equality if the checker API is unavailable or throws.\n *\n * @param checker - TypeScript type checker.\n * @param sourceType - Candidate source type.\n * @param targetType - Candidate target type.\n *\n * @returns `true` when assignable; otherwise `false`.\n */\nexport const isTypeAssignableTo = (\n checker: Readonly<ts.TypeChecker>,\n sourceType: Readonly<ts.Type>,\n targetType: Readonly<ts.Type>\n): boolean => {\n const result = safeTypeOperation({\n operation: () =>\n getTypeCheckerIsTypeAssignableToResult(\n checker,\n sourceType,\n targetType\n ),\n reason: \"type-assignability-check-failed\",\n });\n\n if (!result.ok || typeof result.value !== \"boolean\") {\n return sourceType === targetType;\n }\n\n return result.value;\n};\n\n/**\n * Resolve the type of a signature parameter by index.\n *\n * @param options - Signature parameter lookup options.\n *\n * - `checker`: TypeScript type checker.\n * - `index`: Parameter index in the signature.\n * - `location`: Source location used for contextual type lookup.\n * - `signature`: Candidate call signature.\n *\n * @returns Parameter type when available; otherwise `undefined`.\n */\nexport const getSignatureParameterTypeAt = (\n options: Readonly<{\n checker: ts.TypeChecker;\n index: number;\n location: ts.Node;\n signature: null | ts.Signature | undefined;\n }>\n): ts.Type | undefined => {\n const { checker, index, location, signature } = options;\n\n const symbol = signature?.parameters[index];\n if (!symbol) {\n return undefined;\n }\n\n return checker.getTypeOfSymbolAtLocation(symbol, location);\n};\n\n/**\n * Determine whether an expression references an unshadowed global identifier.\n *\n * @param context - Rule context used for scope resolution.\n * @param expression - Expression to inspect.\n * @param identifierName - Expected identifier name.\n *\n * @returns `true` when the expression is an Identifier with the expected name\n * and resolves to the global binding.\n */\nexport const isGlobalIdentifierNamed = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n expression: Readonly<TSESTree.Expression>,\n identifierName: string\n): expression is TSESTree.Identifier => {\n if (\n expression.type !== \"Identifier\" ||\n expression.name !== identifierName\n ) {\n return false;\n }\n\n const result = safeTypeOperation({\n operation: () => {\n const initialScope = getScopeFromContextSourceCode(\n context,\n expression\n );\n\n if (initialScope === null) {\n return true;\n }\n\n const variable = getVariableInScopeChain(\n initialScope,\n identifierName\n );\n\n return variable === null || variable.defs.length === 0;\n },\n reason: \"scope-resolution-failed\",\n });\n\n if (!result.ok) {\n return false;\n }\n\n return result.value;\n};\n\n/**\n * Determine whether an expression references the global `undefined` binding\n * (not a shadowed user-defined symbol).\n *\n * @param context - Rule context used for scope resolution.\n * @param expression - Expression to inspect.\n *\n * @returns `true` when the expression is an Identifier named `undefined` that\n * resolves to the global binding.\n */\nexport const isGlobalUndefinedIdentifier = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.Identifier =>\n isGlobalIdentifierNamed(context, expression, \"undefined\");\n", "/**\n * @packageDocumentation\n * Stable catalog IDs for all plugin rules.\n */\nimport { objectFromEntries, setHas } from \"ts-extras\";\n\n/**\n * Catalog metadata for a single rule.\n */\nexport type TypefestRuleCatalogEntry = Readonly<{\n ruleId: TypefestRuleCatalogId;\n ruleName: TypefestRuleNamePattern;\n ruleNumber: number;\n}>;\n\n/**\n * Stable machine-friendly rule id format (for example: `R001`).\n */\nexport type TypefestRuleCatalogId = `R${string}`;\n\n/** Pattern for unqualified rule names supported by eslint-plugin-typefest. */\ntype TypefestRuleNamePattern = `prefer-${string}`;\n\n/**\n * Stable global ordering used for rule catalog IDs.\n *\n * @remarks\n * Append new rules to preserve existing IDs.\n */\nconst orderedRuleNames = [\n \"prefer-ts-extras-array-at\",\n \"prefer-ts-extras-array-concat\",\n \"prefer-ts-extras-array-find\",\n \"prefer-ts-extras-array-find-last\",\n \"prefer-ts-extras-array-find-last-index\",\n \"prefer-ts-extras-array-first\",\n \"prefer-ts-extras-array-includes\",\n \"prefer-ts-extras-array-join\",\n \"prefer-ts-extras-array-last\",\n \"prefer-ts-extras-as-writable\",\n \"prefer-ts-extras-assert-defined\",\n \"prefer-ts-extras-assert-error\",\n \"prefer-ts-extras-assert-present\",\n \"prefer-ts-extras-is-defined\",\n \"prefer-ts-extras-is-defined-filter\",\n \"prefer-ts-extras-is-empty\",\n \"prefer-ts-extras-is-equal-type\",\n \"prefer-ts-extras-is-finite\",\n \"prefer-ts-extras-is-infinite\",\n \"prefer-ts-extras-is-integer\",\n \"prefer-ts-extras-is-present\",\n \"prefer-ts-extras-is-present-filter\",\n \"prefer-ts-extras-is-safe-integer\",\n \"prefer-ts-extras-key-in\",\n \"prefer-ts-extras-not\",\n \"prefer-ts-extras-object-entries\",\n \"prefer-ts-extras-object-from-entries\",\n \"prefer-ts-extras-object-has-in\",\n \"prefer-ts-extras-object-has-own\",\n \"prefer-ts-extras-object-keys\",\n \"prefer-ts-extras-object-values\",\n \"prefer-ts-extras-safe-cast-to\",\n \"prefer-ts-extras-set-has\",\n \"prefer-ts-extras-string-split\",\n \"prefer-type-fest-abstract-constructor\",\n \"prefer-type-fest-arrayable\",\n \"prefer-type-fest-async-return-type\",\n \"prefer-type-fest-conditional-pick\",\n \"prefer-type-fest-constructor\",\n \"prefer-type-fest-except\",\n \"prefer-type-fest-if\",\n \"prefer-type-fest-iterable-element\",\n \"prefer-type-fest-json-array\",\n \"prefer-type-fest-json-object\",\n \"prefer-type-fest-json-primitive\",\n \"prefer-type-fest-json-value\",\n \"prefer-type-fest-keys-of-union\",\n \"prefer-type-fest-literal-union\",\n \"prefer-type-fest-merge-exclusive\",\n \"prefer-type-fest-non-empty-tuple\",\n \"prefer-type-fest-omit-index-signature\",\n \"prefer-type-fest-partial-deep\",\n \"prefer-type-fest-primitive\",\n \"prefer-type-fest-promisable\",\n \"prefer-type-fest-readonly-deep\",\n \"prefer-type-fest-require-all-or-none\",\n \"prefer-type-fest-require-at-least-one\",\n \"prefer-type-fest-require-exactly-one\",\n \"prefer-type-fest-require-one-or-none\",\n \"prefer-type-fest-required-deep\",\n \"prefer-type-fest-schema\",\n \"prefer-type-fest-set-non-nullable\",\n \"prefer-type-fest-set-optional\",\n \"prefer-type-fest-set-readonly\",\n \"prefer-type-fest-set-required\",\n \"prefer-type-fest-simplify\",\n \"prefer-type-fest-tagged-brands\",\n \"prefer-type-fest-tuple-of\",\n \"prefer-type-fest-unknown-array\",\n \"prefer-type-fest-unknown-map\",\n \"prefer-type-fest-unknown-record\",\n \"prefer-type-fest-unknown-set\",\n \"prefer-type-fest-unwrap-tagged\",\n \"prefer-type-fest-value-of\",\n \"prefer-type-fest-writable\",\n \"prefer-type-fest-writable-deep\",\n] as const satisfies readonly TypefestRuleNamePattern[];\n\nconst toRuleCatalogId = (ruleNumber: number): TypefestRuleCatalogId =>\n `R${String(ruleNumber).padStart(3, \"0\")}`;\n\nconst isTypefestRuleNamePattern = (\n ruleName: string\n): ruleName is TypefestRuleNamePattern => ruleName.startsWith(\"prefer-\");\n\n/**\n * Canonical catalog metadata entries in stable display/order form.\n */\nexport const typefestRuleCatalogEntries: readonly TypefestRuleCatalogEntry[] =\n orderedRuleNames.map((ruleName, index) => {\n const ruleNumber = index + 1;\n\n return {\n ruleId: toRuleCatalogId(ruleNumber),\n ruleName,\n ruleNumber,\n };\n });\n\n/**\n * Fast lookup map for rule catalog metadata by rule name.\n */\nexport const typefestRuleCatalogByRuleName: Readonly<\n Partial<Record<TypefestRuleNamePattern, TypefestRuleCatalogEntry>>\n> = objectFromEntries(\n typefestRuleCatalogEntries.map((entry) => [entry.ruleName, entry])\n);\n\n/**\n * Resolve stable catalog metadata for a rule name.\n *\n * @throws When the rule is missing from the catalog.\n */\n/**\n * Resolve stable catalog metadata for a rule name when available.\n */\nexport const getRuleCatalogEntryForRuleNameOrNull = (\n ruleName: string\n): null | TypefestRuleCatalogEntry => {\n if (!isTypefestRuleNamePattern(ruleName)) {\n return null;\n }\n\n return typefestRuleCatalogByRuleName[ruleName] ?? null;\n};\n\n/**\n * Resolve stable catalog metadata for a rule name.\n *\n * @throws When the rule is missing from the catalog.\n */\nexport const getRuleCatalogEntryForRuleName = (\n ruleName: string\n): TypefestRuleCatalogEntry => {\n const catalogEntry = getRuleCatalogEntryForRuleNameOrNull(ruleName);\n\n if (catalogEntry === null) {\n throw new TypeError(\n `Rule '${ruleName}' is missing from the stable rule catalog.`\n );\n }\n\n return catalogEntry;\n};\n\n/**\n * Resolve stable catalog metadata by rule id.\n */\nexport const typefestRuleCatalogByRuleId: ReadonlyMap<\n TypefestRuleCatalogId,\n TypefestRuleCatalogEntry\n> = new Map(typefestRuleCatalogEntries.map((entry) => [entry.ruleId, entry]));\n\n/**\n * Resolve stable catalog metadata for a catalog id.\n */\nexport const getRuleCatalogEntryForRuleId = (\n ruleId: TypefestRuleCatalogId\n): TypefestRuleCatalogEntry | undefined =>\n typefestRuleCatalogByRuleId.get(ruleId);\n\n/**\n * Validate that catalog IDs are unique and sequential.\n */\nexport const validateRuleCatalogIntegrity = (): boolean => {\n const entries = typefestRuleCatalogEntries;\n const seenRuleIds = new Set<TypefestRuleCatalogId>();\n\n for (const [index, entry] of entries.entries()) {\n if (setHas(seenRuleIds, entry.ruleId)) {\n return false;\n }\n\n seenRuleIds.add(entry.ruleId);\n\n const expectedRuleNumber = index + 1;\n if (entry.ruleNumber !== expectedRuleNumber) {\n return false;\n }\n\n if (entry.ruleId !== toRuleCatalogId(expectedRuleNumber)) {\n return false;\n }\n }\n\n return true;\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-at`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-at`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayAtRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"at\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayAt\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"at\",\n messageId: \"preferTsExtrasArrayAt\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayAt over Array#at for stronger element inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-at\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayAt:\n \"Prefer `arrayAt` from `ts-extras` over `array.at(...)` for stronger element inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-at\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-at` rule module.\n */\nexport default preferTsExtrasArrayAtRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-concat`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-concat`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayConcatRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"concat\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayConcat\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"concat\",\n messageId: \"preferTsExtrasArrayConcat\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayConcat over Array#concat for stronger tuple and readonly-array typing.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-concat\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayConcat:\n \"Prefer `arrayConcat` from `ts-extras` over `array.concat(...)` for stronger tuple and readonly-array typing.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-concat\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-concat` rule module.\n */\nexport default preferTsExtrasArrayConcatRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-find-last-index`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-find-last-index`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayFindLastIndexRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"findLastIndex\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayFindLastIndex\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"findLastIndex\",\n messageId: \"preferTsExtrasArrayFindLastIndex\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayFindLastIndex over Array#findLastIndex for stronger predicate inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: \"typefest.configs.all\",\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find-last-index\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayFindLastIndex:\n \"Prefer `arrayFindLastIndex` from `ts-extras` over `array.findLastIndex(...)` for stronger predicate inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-find-last-index\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-find-last-index` rule module.\n */\nexport default preferTsExtrasArrayFindLastIndexRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-find-last`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-find-last`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayFindLastRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"findLast\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayFindLast\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"findLast\",\n messageId: \"preferTsExtrasArrayFindLast\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayFindLast over Array#findLast for stronger predicate inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find-last\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayFindLast:\n \"Prefer `arrayFindLast` from `ts-extras` over `array.findLast(...)` for stronger predicate inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-find-last\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-find-last` rule module.\n */\nexport default preferTsExtrasArrayFindLastRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-find`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-find`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayFindRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"find\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayFind\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"find\",\n messageId: \"preferTsExtrasArrayFind\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayFind over Array#find for stronger predicate inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: \"typefest.configs.all\",\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-find\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayFind:\n \"Prefer `arrayFind` from `ts-extras` over `array.find(...)` for stronger predicate inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-find\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-find` rule module.\n */\nexport default preferTsExtrasArrayFindRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-first`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { safeCastTo } from \"ts-extras\";\n\nimport {\n createIsArrayLikeExpressionChecker,\n isWriteTargetMemberExpression,\n} from \"../_internal/array-like-expression.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createMemberToFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n resolveAutofixOrSuggestionOutcome,\n} from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\nimport { isArrayIndexReadAutofixSafe } from \"../_internal/value-rewrite-autofix-safety.js\";\n\n/**\n * Checks whether a computed member property represents index `0`.\n *\n * @param node - Member property node candidate.\n *\n * @returns `true` for numeric `0` and string literal `\"0\"` property nodes.\n */\n\nconst isZeroProperty = (\n node: Readonly<TSESTree.Expression | TSESTree.PrivateIdentifier>\n): boolean =>\n node.type === \"Literal\" && (node.value === 0 || node.value === \"0\");\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-first`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayFirstRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'MemberExpression[computed=true][property.type=\"Literal\"]'(\n node\n ) {\n const memberNode =\n safeCastTo<TSESTree.MemberExpression>(node);\n\n if (!isZeroProperty(memberNode.property)) {\n return;\n }\n\n if (isWriteTargetMemberExpression(memberNode)) {\n return;\n }\n\n if (!isArrayLikeExpression(memberNode.object)) {\n return;\n }\n\n const outcome = resolveAutofixOrSuggestionOutcome({\n canAutofix: isArrayIndexReadAutofixSafe(memberNode),\n fix: createMemberToFunctionCallFix({\n context,\n importedName: \"arrayFirst\",\n imports: tsExtrasImports,\n memberNode,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n }),\n });\n\n if (outcome.kind === \"suggestion\") {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasArrayFirst\",\n node: memberNode,\n suggest: [\n {\n fix: outcome.fix,\n messageId: \"suggestTsExtrasArrayFirst\",\n },\n ],\n },\n });\n\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: outcome.kind === \"autofix\" ? outcome.fix : null,\n messageId: \"preferTsExtrasArrayFirst\",\n node: memberNode,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayFirst over direct [0] array access for stronger tuple and readonly-array inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-first\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasArrayFirst:\n \"Prefer `arrayFirst` from `ts-extras` over direct `array[0]` access for stronger inference.\",\n suggestTsExtrasArrayFirst:\n \"Replace this direct index access with `arrayFirst(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-first\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-first` rule module.\n */\nexport default preferTsExtrasArrayFirstRule;\n", "/**\n * @packageDocumentation\n * Shared safety checks for value-expression autofixes.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getParentNode } from \"./ast-node.js\";\n\n/**\n * Check whether a parent node is a transparent expression wrapper for `child`.\n */\nexport const isTransparentExpressionWrapper = (\n parent: Readonly<TSESTree.Node>,\n child: Readonly<TSESTree.Node>\n): boolean => {\n if (parent.type === \"ChainExpression\") {\n return parent.expression === child;\n }\n\n if (parent.type === \"TSAsExpression\") {\n return parent.expression === child;\n }\n\n if (parent.type === \"TSNonNullExpression\") {\n return parent.expression === child;\n }\n\n if (parent.type === \"TSSatisfiesExpression\") {\n return parent.expression === child;\n }\n\n if (parent.type === \"TSTypeAssertion\") {\n return parent.expression === child;\n }\n\n return false;\n};\n\n/**\n * Detect whether an expression is a chain/optional-call/optional-member shape.\n */\nexport const isOptionalChainExpression = (\n node: Readonly<TSESTree.Expression>\n): boolean =>\n node.type === \"ChainExpression\" ||\n ((node.type === \"CallExpression\" || node.type === \"MemberExpression\") &&\n node.optional);\n\n/**\n * Determine whether an expression occupies a direct return position.\n */\nexport const isDirectReturnLikeExpressionPosition = (\n node: Readonly<TSESTree.Expression>\n): boolean => {\n let currentNode: Readonly<TSESTree.Node> = node;\n\n while (true) {\n const parentNode = getParentNode(currentNode);\n\n if (parentNode === undefined) {\n return false;\n }\n\n if (isTransparentExpressionWrapper(parentNode, currentNode)) {\n currentNode = parentNode;\n continue;\n }\n\n if (\n parentNode.type === \"ReturnStatement\" &&\n parentNode.argument === currentNode\n ) {\n return true;\n }\n\n if (\n parentNode.type === \"ArrowFunctionExpression\" &&\n parentNode.body === currentNode\n ) {\n return true;\n }\n\n return false;\n }\n};\n\n/**\n * Guard array index-to-helper rewrites known to be type-sensitive.\n */\nexport const isArrayIndexReadAutofixSafe = (\n node: Readonly<TSESTree.MemberExpression>\n): boolean => {\n if (isOptionalChainExpression(node.object)) {\n return false;\n }\n\n if (isDirectReturnLikeExpressionPosition(node)) {\n return false;\n }\n\n return true;\n};\n\n/**\n * Determine whether an expression is safe to evaluate fewer times after a\n * rewrite that collapses duplicate evaluations.\n *\n * @remarks\n * Expressions such as member access or function calls can change runtime\n * behavior when duplicated evaluation sites are rewritten to a single helper\n * call. This helper intentionally accepts only stable, exception-free\n * primitives and identifiers.\n */\nexport const isRepeatablyEvaluableExpression = (\n node: Readonly<TSESTree.Expression | TSESTree.PrivateIdentifier>\n): node is TSESTree.Expression => {\n if (node.type === \"PrivateIdentifier\") {\n return false;\n }\n\n if (\n node.type === \"TSAsExpression\" ||\n node.type === \"TSNonNullExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"TSTypeAssertion\"\n ) {\n return isRepeatablyEvaluableExpression(node.expression);\n }\n\n if (node.type === \"ChainExpression\") {\n return isRepeatablyEvaluableExpression(node.expression);\n }\n\n if (node.type === \"Identifier\") {\n return true;\n }\n\n if (node.type === \"Literal\") {\n return true;\n }\n\n if (node.type === \"TemplateLiteral\") {\n return node.expressions.length === 0;\n }\n\n if (node.type === \"ThisExpression\") {\n return true;\n }\n\n return false;\n};\n", "/**\n * @packageDocumentation\n * Conservative safety checks for autofixes that introduce type predicates.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getParentNode } from \"./ast-node.js\";\nimport { isTransparentExpressionWrapper } from \"./value-rewrite-autofix-safety.js\";\n\n/**\n * Determine whether a call-expression replacement to a type-predicate helper is\n * safe to apply as an autofix.\n *\n * @remarks\n * Type-predicate helpers (for example `setHas`) can change control-flow\n * narrowing in boolean guard expressions. This check intentionally disables\n * autofix in those contexts and leaves a diagnostic for manual review.\n */\nexport const isTypePredicateExpressionAutofixSafe = (\n node: Readonly<TSESTree.Expression>\n): boolean => {\n let currentNode: Readonly<TSESTree.Node> = node;\n\n while (true) {\n const parentNode = getParentNode(currentNode);\n\n if (parentNode === undefined) {\n return true;\n }\n\n if (isTransparentExpressionWrapper(parentNode, currentNode)) {\n currentNode = parentNode;\n continue;\n }\n\n if (\n parentNode.type === \"UnaryExpression\" &&\n parentNode.operator === \"!\" &&\n parentNode.argument === currentNode\n ) {\n return false;\n }\n\n if (\n parentNode.type === \"LogicalExpression\" &&\n (parentNode.left === currentNode ||\n parentNode.right === currentNode)\n ) {\n return false;\n }\n\n if (\n parentNode.type === \"ConditionalExpression\" &&\n parentNode.test === currentNode\n ) {\n return false;\n }\n\n if (\n (parentNode.type === \"DoWhileStatement\" ||\n parentNode.type === \"IfStatement\" ||\n parentNode.type === \"WhileStatement\") &&\n parentNode.test === currentNode\n ) {\n return false;\n }\n\n if (\n parentNode.type === \"ForStatement\" &&\n parentNode.test === currentNode\n ) {\n return false;\n }\n\n if (\n parentNode.type === \"SwitchCase\" &&\n parentNode.test === currentNode\n ) {\n return false;\n }\n\n return true;\n }\n};\n\n/**\n * Backward-compatible alias for call-expression-based callers.\n */\nexport const isTypePredicateAutofixSafe = (\n node: Readonly<TSESTree.CallExpression>\n): boolean => isTypePredicateExpressionAutofixSafe(node);\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-includes`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithTypefestPolicy } from \"../_internal/rule-reporting.js\";\nimport { isTypePredicateAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-includes`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayIncludesRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"includes\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n canAutofix: isTypePredicateAutofixSafe,\n context,\n importedName: \"arrayIncludes\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"includes\",\n messageId: \"preferTsExtrasArrayIncludes\",\n node,\n reportSuggestion: ({ fix, node: suggestionNode }) => {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasArrayIncludes\",\n node: suggestionNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestTsExtrasArrayIncludes\",\n },\n ],\n },\n });\n },\n suggestionMessageId: \"suggestTsExtrasArrayIncludes\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayIncludes over Array#includes for stronger element inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.recommended-type-checked\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-includes\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasArrayIncludes:\n \"Prefer `arrayIncludes` from `ts-extras` over `array.includes(...)` for stronger element inference.\",\n suggestTsExtrasArrayIncludes:\n \"Replace this `array.includes(...)` call with `arrayIncludes(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-includes\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-includes` rule module.\n */\nexport default preferTsExtrasArrayIncludesRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-join`.\n */\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport { reportTsExtrasArrayMethodCall } from \"../_internal/array-method-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-array-join`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasArrayJoinRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"join\"]'(\n node\n ) {\n reportTsExtrasArrayMethodCall({\n context,\n importedName: \"arrayJoin\",\n imports: tsExtrasImports,\n isArrayLikeExpression,\n memberName: \"join\",\n messageId: \"preferTsExtrasArrayJoin\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras arrayJoin over Array#join for stronger tuple-aware typing.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-join\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasArrayJoin:\n \"Prefer `arrayJoin` from `ts-extras` over `array.join(...)` for stronger tuple-aware typing.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-join\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-join` rule module.\n */\nexport default preferTsExtrasArrayJoinRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-array-last`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { safeCastTo } from \"ts-extras\";\n\nimport {\n createIsArrayLikeExpressionChecker,\n isWriteTargetMemberExpression,\n} from \"../_internal/array-like-expression.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createMemberToFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentExpressions } from \"../_internal/normalize-expression-text.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n resolveAutofixOrSuggestionOutcome,\n} from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\nimport {\n isArrayIndexReadAutofixSafe,\n isRepeatablyEvaluableExpression,\n} from \"../_internal/value-rewrite-autofix-safety.js\";\n\n/**\n * Detects direct last-element index access (`value[value.length - 1]`).\n *\n * @param node - Member expression to inspect.\n *\n * @returns `true` when the member expression uses a computed `length - 1` index\n * derived from the same object.\n */\nconst isLastIndexPattern = (\n node: Readonly<TSESTree.MemberExpression>\n): boolean => {\n if (!node.computed || node.property.type !== \"BinaryExpression\") {\n return false;\n }\n\n const propertyExpression = node.property;\n\n if (propertyExpression.operator !== \"-\") {\n return false;\n }\n\n if (propertyExpression.right.type !== \"Literal\") {\n return false;\n }\n\n if (propertyExpression.right.value !== 1) {\n return false;\n }\n\n const objectExpression = node.object;\n\n if (\n propertyExpression.left.type !== \"MemberExpression\" ||\n propertyExpression.left.computed ||\n propertyExpression.left.property.type !== \"Identifier\" ||\n propertyExpression.left.property.name !== \"length\"\n ) {\n return false;\n }\n\n if (propertyExpression.left.object.type === \"Super\") {\n return false;\n }\n\n return areEquivalentExpressions(\n propertyExpression.left.object,\n objectExpression\n );\n};\n\n/** Rule module definition for `prefer-ts-extras-array-last`. */\nconst preferTsExtrasArrayLastRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const directImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n });\n\n return {\n 'MemberExpression[computed=true][property.type=\"BinaryExpression\"][property.operator=\"-\"]'(\n node\n ): void {\n const memberNode =\n safeCastTo<TSESTree.MemberExpression>(node);\n\n if (!isLastIndexPattern(memberNode)) {\n return;\n }\n\n if (isWriteTargetMemberExpression(memberNode)) {\n return;\n }\n\n if (!isArrayLikeExpression(memberNode.object)) {\n return;\n }\n\n const fixes = createMemberToFunctionCallFix({\n context,\n importedName: \"arrayLast\",\n imports: directImports,\n memberNode,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n });\n\n const outcome = resolveAutofixOrSuggestionOutcome({\n canAutofix:\n isArrayIndexReadAutofixSafe(memberNode) &&\n isRepeatablyEvaluableExpression(memberNode.object),\n fix: fixes,\n });\n\n if (outcome.kind === \"suggestion\") {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasArrayLast\",\n node: memberNode,\n suggest: [\n {\n fix: outcome.fix,\n messageId: \"suggestTsExtrasArrayLast\",\n },\n ],\n },\n });\n\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: outcome.kind === \"autofix\" ? outcome.fix : null,\n messageId: \"preferTsExtrasArrayLast\",\n node: memberNode,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require `arrayLast` from `ts-extras` instead of manual last-index member access.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.recommended-type-checked\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-array-last\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasArrayLast:\n \"Prefer `arrayLast` from `ts-extras` over direct last-index access.\",\n suggestTsExtrasArrayLast:\n \"Replace this last-index access with `arrayLast(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-array-last\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-array-last` rule module.\n */\nexport default preferTsExtrasArrayLastRule;\n", "/**\n * @packageDocumentation\n * Structural normalization and equivalence checks for expressions and type\n * nodes used by safe-fix heuristics.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\nimport type { JsonObject } from \"type-fest\";\n\nimport { isDefined, objectHasOwn, objectKeys } from \"ts-extras\";\n\nimport { setContainsValue } from \"./set-membership.js\";\n\n/**\n * Object-like value that can participate in deep structural comparisons.\n */\ntype ComparableObject = Readonly<JsonObject>;\n\n/**\n * ESTree metadata keys ignored during structural-equivalence checks.\n */\nconst ignoredPropertyKeys = new Set<string>([\n \"end\",\n \"loc\",\n \"parent\",\n \"range\",\n \"start\",\n]);\n\n/**\n * Maximum recursive depth allowed during structural node-value comparisons.\n *\n * @remarks\n * This guard avoids stack-overflow crashes on pathological, adversarially deep\n * AST/type structures. Returning `false` in that case preserves lint-process\n * stability by failing closed for autofix-equivalence checks.\n */\nconst MAX_NODE_VALUE_COMPARISON_DEPTH = 256;\n\n/**\n * Check whether a value is object-like for structural comparisons.\n */\nconst isComparableRecord = (value: unknown): value is ComparableObject =>\n typeof value === \"object\" && value !== null;\n\n/**\n * Return stable comparable keys after stripping metadata properties.\n */\nconst getComparableKeys = (value: ComparableObject): readonly string[] =>\n objectKeys(value).filter(\n (key) => !setContainsValue(ignoredPropertyKeys, key)\n );\n\n/**\n * Read comparable keys with per-comparison caching to reduce repeated\n * key-filter allocations during deep traversals.\n *\n * @param value - Object candidate being compared.\n * @param comparableKeysByObject - Per-comparison key cache.\n *\n * @returns Comparable key list with ESTree metadata keys removed.\n */\nconst getCachedComparableKeys = (\n value: ComparableObject,\n comparableKeysByObject: WeakMap<ComparableObject, readonly string[]>\n): readonly string[] => {\n const existingComparableKeys = comparableKeysByObject.get(value);\n if (isDefined(existingComparableKeys)) {\n return existingComparableKeys;\n }\n\n const comparableKeys = getComparableKeys(value);\n comparableKeysByObject.set(value, comparableKeys);\n\n return comparableKeys;\n};\n\n/**\n * Unwrap transparent TypeScript expression wrappers.\n *\n * @param expression - Expression to normalize.\n *\n * @returns The innermost wrapped expression.\n */\nconst unwrapTransparentExpression = (\n expression: Readonly<TSESTree.Expression>\n): Readonly<TSESTree.Expression> => {\n let currentExpression = expression;\n const visitedExpressions = new Set<Readonly<TSESTree.Expression>>();\n\n while (true) {\n if (setContainsValue(visitedExpressions, currentExpression)) {\n return currentExpression;\n }\n\n visitedExpressions.add(currentExpression);\n\n if (currentExpression.type === \"TSAsExpression\") {\n currentExpression = currentExpression.expression;\n continue;\n }\n\n if (currentExpression.type === \"TSNonNullExpression\") {\n currentExpression = currentExpression.expression;\n continue;\n }\n\n if (currentExpression.type === \"TSSatisfiesExpression\") {\n currentExpression = currentExpression.expression;\n continue;\n }\n\n if (currentExpression.type === \"TSTypeAssertion\") {\n currentExpression = currentExpression.expression;\n continue;\n }\n\n return currentExpression;\n }\n};\n\n/**\n * Records a compared object pair and reports whether that pair was already\n * visited.\n *\n * @param left - Left-side object in the comparison pair.\n * @param right - Right-side object in the comparison pair.\n * @param seenPairs - Weakly-held pair-tracking cache for cycle-safe traversal.\n *\n * @returns `true` when this exact pair has already been processed.\n */\nconst markAndCheckSeenPair = (\n left: object,\n right: object,\n seenPairs: WeakMap<object, WeakSet<object>>\n): boolean => {\n const seenRightNodes = seenPairs.get(left);\n if (isDefined(seenRightNodes) && seenRightNodes.has(right)) {\n return true;\n }\n\n if (isDefined(seenRightNodes)) {\n seenRightNodes.add(right);\n } else {\n seenPairs.set(left, new WeakSet([right]));\n }\n\n return false;\n};\n\n/**\n * Deep structural comparison that is resilient to cycles and ESTree metadata\n * fields.\n *\n * @param left - Left-side value.\n * @param right - Right-side value.\n * @param seenPairs - Pair cache used to break recursive cycles.\n *\n * @returns `true` when the values are structurally equivalent after metadata\n * normalization.\n */\nconst areEquivalentNodeValues = (\n left: unknown,\n right: unknown,\n seenPairs: WeakMap<object, WeakSet<object>> = new WeakMap(),\n comparableKeysByObject: WeakMap<\n ComparableObject,\n readonly string[]\n > = new WeakMap(),\n depth = 0\n): boolean => {\n if (depth >= MAX_NODE_VALUE_COMPARISON_DEPTH) {\n return false;\n }\n\n if (Object.is(left, right)) {\n return true;\n }\n\n if (typeof left !== typeof right) {\n return false;\n }\n\n if (left === null || right === null) {\n return false;\n }\n\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right)) {\n return false;\n }\n\n if (markAndCheckSeenPair(left, right, seenPairs)) {\n return true;\n }\n\n if (left.length !== right.length) {\n return false;\n }\n\n return left.every((value, index) =>\n areEquivalentNodeValues(\n value,\n right[index],\n seenPairs,\n comparableKeysByObject,\n depth + 1\n )\n );\n }\n\n if (!isComparableRecord(left) || !isComparableRecord(right)) {\n return false;\n }\n\n if (markAndCheckSeenPair(left, right, seenPairs)) {\n return true;\n }\n\n const leftKeys = getCachedComparableKeys(left, comparableKeysByObject);\n const rightKeys = getCachedComparableKeys(right, comparableKeysByObject);\n const rightKeySet = new Set(rightKeys);\n\n if (leftKeys.length !== rightKeys.length) {\n return false;\n }\n\n if (leftKeys.some((key) => !setContainsValue(rightKeySet, key))) {\n return false;\n }\n\n return leftKeys.every((key) => {\n if (!objectHasOwn(left, key) || !objectHasOwn(right, key)) {\n return false;\n }\n\n return areEquivalentNodeValues(\n left[key],\n right[key],\n seenPairs,\n comparableKeysByObject,\n depth + 1\n );\n });\n};\n\n/**\n * Compare two expressions for structural equivalence after unwrapping\n * transparent TypeScript wrappers.\n *\n * @param left - Left-hand expression.\n * @param right - Right-hand expression.\n *\n * @returns `true` when both expressions are structurally equivalent.\n */\nexport const areEquivalentExpressions = (\n left: Readonly<TSESTree.Expression>,\n right: Readonly<TSESTree.Expression>\n): boolean =>\n areEquivalentNodeValues(\n unwrapTransparentExpression(left),\n unwrapTransparentExpression(right)\n );\n\n/**\n * Compare two type nodes for structural equivalence.\n *\n * @param left - Left-hand type node.\n * @param right - Right-hand type node.\n *\n * @returns `true` when both type nodes are structurally equivalent.\n */\nexport const areEquivalentTypeNodes = (\n left: Readonly<TSESTree.TypeNode>,\n right: Readonly<TSESTree.TypeNode>\n): boolean => areEquivalentNodeValues(left, right);\n", "/**\n * @packageDocumentation\n * Internal shared utilities used by eslint-plugin-typefest rule modules and plugin wiring.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { keyIn } from \"ts-extras\";\n\nimport { getParentNode } from \"./ast-node.js\";\nimport { isAnyLinkedStructureNodeMatching } from \"./cycle-safe-linked-search.js\";\nimport {\n collectNamedImportLocalNamesByImportedNameFromSource,\n collectNamedImportSpecifierBindingsFromSource,\n collectNamespaceImportLocalNamesFromSourceModule,\n} from \"./import-analysis.js\";\nimport { createImportAwareFixes } from \"./import-aware-fixes.js\";\nimport {\n type ImportFixIntent,\n resolveImportInsertionDecisionForReportFix,\n} from \"./import-fix-coordinator.js\";\nimport { createImportInsertionFix } from \"./import-insertion.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"./module-source.js\";\nimport { setContainsValue } from \"./set-membership.js\";\n\n/** Utility wrapper used to preserve explicit readonly semantics in fixes. */\nconst READONLY_UTILITY_TYPE_NAME = \"Readonly\";\n\n/**\n * Container type references that semantically encode readonly wrappers.\n */\nconst READONLY_CONTAINER_TYPE_NAMES = new Set([\n \"ReadonlyArray\",\n \"ReadonlyMap\",\n \"ReadonlySet\",\n]);\n\n/**\n * AST node shape that may carry optional generic type parameters.\n */\ntype NodeWithOptionalTypeParameters = Readonly<TSESTree.Node> & {\n typeParameters?: Readonly<TSESTree.TSTypeParameterDeclaration>;\n};\n\n/**\n * Determine whether a node exposes an optional `typeParameters` property.\n */\nconst hasOptionalTypeParametersProperty = (\n node: Readonly<TSESTree.Node>\n): node is NodeWithOptionalTypeParameters => keyIn(node, \"typeParameters\");\n\n/**\n * Matched imported type alias that can be replaced with a canonical name.\n */\ntype ImportedTypeAliasMatch = {\n importedName: string;\n replacementName: string;\n sourceValue: string;\n};\n\n/**\n * Collects imported canonical type alias names that should be replaced by\n * preferred type-fest utility names.\n *\n * @param sourceCode - Source code object for the current file.\n * @param replacementsByImportedName - Mapping from imported symbol names to\n * preferred replacement names.\n *\n * @returns Map keyed by canonical imported alias name with replacement\n * metadata.\n */\nexport const collectImportedTypeAliasMatches = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n replacementsByImportedName: Readonly<Record<string, string>>\n): ReadonlyMap<string, ImportedTypeAliasMatch> => {\n const aliasMatches = new Map<string, ImportedTypeAliasMatch>();\n\n for (const binding of collectNamedImportSpecifierBindingsFromSource({\n sourceCode,\n })) {\n if (binding.localName !== binding.importedName) {\n continue;\n }\n\n const replacementName =\n replacementsByImportedName[binding.importedName];\n if (\n typeof replacementName !== \"string\" ||\n replacementName.length === 0\n ) {\n continue;\n }\n\n const sourceValue =\n typeof binding.declaration.source.value === \"string\"\n ? binding.declaration.source.value\n : \"\";\n\n aliasMatches.set(binding.importedName, {\n importedName: binding.importedName,\n replacementName,\n sourceValue,\n });\n }\n\n return aliasMatches;\n};\n\n/**\n * Collect direct (non-renamed) named imports for a specific source module.\n *\n * @param sourceCode - Source code object for the current file.\n * @param expectedSourceValue - Module source string to match.\n *\n * @returns Set of imported identifier names.\n */\nexport const collectDirectNamedImportsFromSource = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n expectedSourceValue: string\n): ReadonlySet<string> => {\n const localNamesByImportedName =\n collectNamedImportLocalNamesByImportedNameFromSource({\n sourceCode,\n sourceModuleName: expectedSourceValue,\n });\n\n const namedImports = new Set<string>();\n\n for (const [importedName, localNames] of localNamesByImportedName) {\n if (!setContainsValue(localNames, importedName)) {\n continue;\n }\n\n namedImports.add(importedName);\n }\n\n return namedImports;\n};\n\n/**\n * Collect local identifier names for a specific named import from a selected\n * module source.\n *\n * @param sourceCode - Source code object for the current file.\n * @param expectedSourceValue - Module source string to match.\n * @param expectedImportedName - Imported symbol name to match.\n *\n * @returns Set of local identifier names (including aliased locals).\n */\nexport const collectNamedImportLocalNamesFromSource = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n expectedSourceValue: string,\n expectedImportedName: string\n): ReadonlySet<string> =>\n new Set(\n collectNamedImportLocalNamesByImportedNameFromSource({\n sourceCode,\n sourceModuleName: expectedSourceValue,\n }).get(expectedImportedName)\n );\n\n/**\n * Collect local identifier names for namespace imports from a selected module\n * source.\n *\n * @param sourceCode - Source code object for the current file.\n * @param expectedSourceValue - Module source string to match.\n *\n * @returns Set of namespace import local names.\n */\nexport const collectNamespaceImportLocalNamesFromSource = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n expectedSourceValue: string\n): ReadonlySet<string> =>\n collectNamespaceImportLocalNamesFromSourceModule(\n sourceCode,\n expectedSourceValue\n );\n\n/**\n * Builds an import-insertion fix for missing named type replacements.\n *\n * @param options - Fixer context and replacement import metadata.\n *\n * @returns Import insertion fix when a safe insertion point is found; otherwise\n * `null`.\n */\nconst getInsertionFixForMissingNamedTypeImport = ({\n fixer,\n node,\n replacementName,\n sourceModuleName,\n}: Readonly<{\n fixer: TSESLint.RuleFixer;\n node: Readonly<TSESTree.Node>;\n replacementName: string;\n sourceModuleName: string;\n}>): null | TSESLint.RuleFix => {\n const importDeclarationText = `import type { ${replacementName} } from \"${sourceModuleName}\";`;\n\n return createImportInsertionFix({\n fixer,\n importDeclarationText,\n moduleSpecifierHint: sourceModuleName,\n referenceNode: node,\n });\n};\n\n/**\n * Checks whether an ancestor node declares a type parameter with a specific\n * name.\n *\n * @param ancestor - Ancestor node to inspect.\n * @param parameterName - Type parameter name to detect.\n *\n * @returns `true` when the ancestor declares a matching type parameter.\n */\nconst ancestorDefinesTypeParameterNamed = (\n ancestor: Readonly<TSESTree.Node>,\n parameterName: string\n): boolean => {\n if (!hasOptionalTypeParametersProperty(ancestor)) {\n return false;\n }\n\n const typeParameterDeclaration = ancestor.typeParameters;\n if (!typeParameterDeclaration) {\n return false;\n }\n\n return typeParameterDeclaration.params.some(\n (parameter) => parameter.name.name === parameterName\n );\n};\n\n/**\n * Determine whether a type parameter name is shadowed by any enclosing generic\n * declaration.\n *\n * @param node - Node used as the starting point for ancestor traversal.\n * @param parameterName - Type parameter name to detect.\n *\n * @returns `true` when an ancestor declares a matching type parameter.\n */\nexport function isTypeParameterNameShadowed(\n node: Readonly<TSESTree.Node>,\n parameterName: string\n): boolean {\n return isAnyLinkedStructureNodeMatching<Readonly<TSESTree.Node>>({\n getNextNode: (\n currentNode: Readonly<TSESTree.Node>\n ): null | Readonly<TSESTree.Node> => getParentNode(currentNode) ?? null,\n isMatch: (currentNode: Readonly<TSESTree.Node>) =>\n ancestorDefinesTypeParameterNamed(currentNode, parameterName),\n startNode: node,\n });\n}\n\n/**\n * Build a replacement fixer that optionally inserts a missing named type import\n * before applying the replacement.\n *\n * @param options - Replacement strategy plus import/scope safety inputs.\n *\n * @returns Report fixer when replacement is scope-safe; otherwise `null`.\n */\nconst createTypeReplacementFix = ({\n applyReplacement,\n availableReplacementNames,\n node,\n replacementName,\n reportFixIntent,\n sourceModuleName,\n}: Readonly<{\n applyReplacement: (fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix;\n availableReplacementNames: ReadonlySet<string>;\n node: Readonly<TSESTree.Node>;\n replacementName: string;\n reportFixIntent: ImportFixIntent;\n sourceModuleName: string;\n}>): null | TSESLint.ReportFixFunction => {\n if (isTypeParameterNameShadowed(node, replacementName)) {\n return null;\n }\n\n const requiresImportInsertion = !setContainsValue(\n availableReplacementNames,\n replacementName\n );\n if (!requiresImportInsertion) {\n return (fixer) => applyReplacement(fixer);\n }\n\n const importInsertionDecision = resolveImportInsertionDecisionForReportFix({\n importBindingKind: \"type\",\n importedName: replacementName,\n referenceNode: node,\n reportFixIntent,\n sourceModuleName,\n });\n\n return (fixer) =>\n createImportAwareFixes({\n createImportFix: (importFixer) =>\n getInsertionFixForMissingNamedTypeImport({\n fixer: importFixer,\n node,\n replacementName,\n sourceModuleName,\n }),\n createReplacementFix: applyReplacement,\n fixer,\n importInsertionDecision,\n requiresImportInsertion,\n });\n};\n\n/**\n * Build a safe type-reference replacement fixer.\n *\n * @param node - Type reference node to potentially fix.\n * @param replacementName - Replacement identifier text.\n * @param availableReplacementNames - Available direct imported replacement\n * names.\n * @param sourceModuleName - Module source used when validating/adding imports.\n *\n * @returns Fix function when replacement/import insertion is scope-safe;\n * otherwise `null`.\n */\nexport const createSafeTypeReferenceReplacementFix = (\n node: Readonly<TSESTree.TSTypeReference>,\n replacementName: string,\n availableReplacementNames: Readonly<ReadonlySet<string>>,\n sourceModuleName: string = TYPE_FEST_MODULE_SOURCE,\n reportFixIntent: ImportFixIntent = \"autofix\"\n): null | TSESLint.ReportFixFunction => {\n if (node.typeName.type !== \"Identifier\") {\n return null;\n }\n\n return createTypeReplacementFix({\n applyReplacement: (fixer) =>\n fixer.replaceText(node.typeName, replacementName),\n availableReplacementNames,\n node,\n replacementName,\n reportFixIntent,\n sourceModuleName,\n });\n};\n\n/**\n * Build a safe whole-type-node replacement fixer with custom replacement text.\n *\n * @param node - Type node to potentially replace.\n * @param replacementName - Replacement symbol name used for import/scope safety\n * checks.\n * @param replacementText - Final replacement text to emit.\n * @param availableReplacementNames - Available direct imported replacement\n * names.\n * @param sourceModuleName - Module source used when validating/adding imports.\n *\n * @returns Fix function when replacement/import insertion is scope-safe;\n * otherwise `null`.\n */\nexport const createSafeTypeNodeTextReplacementFix = (\n node: Readonly<TSESTree.Node>,\n replacementName: string,\n replacementText: string,\n availableReplacementNames: Readonly<ReadonlySet<string>>,\n sourceModuleName: string = TYPE_FEST_MODULE_SOURCE,\n reportFixIntent: ImportFixIntent = \"autofix\"\n): null | TSESLint.ReportFixFunction =>\n createTypeReplacementFix({\n applyReplacement: (fixer) => fixer.replaceText(node, replacementText),\n availableReplacementNames,\n node,\n replacementName,\n reportFixIntent,\n sourceModuleName,\n });\n\n/**\n * Build a safe whole-type-node replacement fixer.\n *\n * @param node - Type node to potentially replace.\n * @param replacementName - Replacement identifier text.\n * @param availableReplacementNames - Available direct imported replacement\n * names.\n * @param sourceModuleName - Module source used when validating/adding imports.\n *\n * @returns Fix function when replacement/import insertion is scope-safe;\n * otherwise `null`.\n */\nexport const createSafeTypeNodeReplacementFix = (\n node: Readonly<TSESTree.Node>,\n replacementName: string,\n availableReplacementNames: Readonly<ReadonlySet<string>>,\n sourceModuleName: string = TYPE_FEST_MODULE_SOURCE,\n reportFixIntent: ImportFixIntent = \"autofix\"\n): null | TSESLint.ReportFixFunction =>\n createSafeTypeNodeTextReplacementFix(\n node,\n replacementName,\n replacementName,\n availableReplacementNames,\n sourceModuleName,\n reportFixIntent\n );\n\n/**\n * Detects type nodes that explicitly encode readonly semantics.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` for `readonly` type operators and known readonly container\n * references.\n */\nconst isExplicitReadonlyTypeNode = (node: Readonly<TSESTree.Node>): boolean => {\n if (node.type === \"TSTypeOperator\") {\n return node.operator === \"readonly\";\n }\n\n if (\n node.type !== \"TSTypeReference\" ||\n node.typeName.type !== \"Identifier\"\n ) {\n return false;\n }\n\n return setContainsValue(READONLY_CONTAINER_TYPE_NAMES, node.typeName.name);\n};\n\n/**\n * Checks whether replacement text is already wrapped with `Readonly<...>`.\n */\nconst isReadonlyUtilityWrappedText = (replacementText: string): boolean =>\n replacementText.trimStart().startsWith(`${READONLY_UTILITY_TYPE_NAME}<`);\n\n/**\n * Wraps replacement text in `Readonly<...>`.\n */\nconst toReadonlyUtilityWrappedText = (replacementText: string): string =>\n `${READONLY_UTILITY_TYPE_NAME}<${replacementText}>`;\n\n/**\n * Build a safe whole-type-node replacement fixer that preserves explicit\n * readonly wrappers/operators from the original node.\n *\n * @param node - Type node to potentially replace.\n * @param replacementName - Replacement symbol name used for import/scope safety\n * checks.\n * @param replacementText - Final replacement text before readonly-preservation\n * adjustment.\n * @param availableReplacementNames - Available direct imported replacement\n * names.\n * @param sourceModuleName - Module source used when validating/adding imports.\n *\n * @returns Fix function when replacement/import insertion is scope-safe;\n * otherwise `null`.\n */\nexport const createSafeTypeNodeTextReplacementFixPreservingReadonly = (\n node: Readonly<TSESTree.Node>,\n replacementName: string,\n replacementText: string,\n availableReplacementNames: Readonly<ReadonlySet<string>>,\n sourceModuleName: string = TYPE_FEST_MODULE_SOURCE,\n reportFixIntent: ImportFixIntent = \"autofix\"\n): null | TSESLint.ReportFixFunction => {\n const replacementTextWithReadonlyPreservation =\n isExplicitReadonlyTypeNode(node) &&\n !isReadonlyUtilityWrappedText(replacementText)\n ? toReadonlyUtilityWrappedText(replacementText)\n : replacementText;\n\n return createSafeTypeNodeTextReplacementFix(\n node,\n replacementName,\n replacementTextWithReadonlyPreservation,\n availableReplacementNames,\n sourceModuleName,\n reportFixIntent\n );\n};\n\n/**\n * Build a safe whole-type-node replacement fixer that preserves explicit\n * readonly wrappers/operators from the original node.\n *\n * @param node - Type node to potentially replace.\n * @param replacementName - Replacement identifier text.\n * @param availableReplacementNames - Available direct imported replacement\n * names.\n * @param sourceModuleName - Module source used when validating/adding imports.\n *\n * @returns Fix function when replacement/import insertion is scope-safe;\n * otherwise `null`.\n */\nexport const createSafeTypeNodeReplacementFixPreservingReadonly = (\n node: Readonly<TSESTree.Node>,\n replacementName: string,\n availableReplacementNames: Readonly<ReadonlySet<string>>,\n sourceModuleName: string = TYPE_FEST_MODULE_SOURCE,\n reportFixIntent: ImportFixIntent = \"autofix\"\n): null | TSESLint.ReportFixFunction =>\n createSafeTypeNodeTextReplacementFixPreservingReadonly(\n node,\n replacementName,\n replacementName,\n availableReplacementNames,\n sourceModuleName,\n reportFixIntent\n );\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-as-writable`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectNamedImportLocalNamesFromSource,\n collectNamespaceImportLocalNamesFromSource,\n} from \"../_internal/imported-type-aliases.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport {\n TS_EXTRAS_MODULE_SOURCE,\n TYPE_FEST_MODULE_SOURCE,\n} from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst WRITABLE_TYPE_NAME = \"Writable\" as const;\n\n/**\n * ESLint rule definition for `prefer-ts-extras-as-writable`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasAsWritableRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const writableLocalNames = collectNamedImportLocalNamesFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE,\n WRITABLE_TYPE_NAME\n );\n const typeFestNamespaceImportNames =\n collectNamespaceImportLocalNamesFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n /**\n * Check whether a type annotation references `Writable` from\n * `type-fest` (direct import or namespace member).\n */\n const isWritableTypeReference = (\n typeAnnotation: Readonly<TSESTree.TypeNode>\n ): boolean => {\n if (typeAnnotation.type !== \"TSTypeReference\") {\n return false;\n }\n\n if (typeAnnotation.typeName.type === \"Identifier\") {\n return setContainsValue(\n writableLocalNames,\n typeAnnotation.typeName.name\n );\n }\n\n if (typeAnnotation.typeName.type !== \"TSQualifiedName\") {\n return false;\n }\n\n return (\n typeAnnotation.typeName.left.type === \"Identifier\" &&\n setContainsValue(\n typeFestNamespaceImportNames,\n typeAnnotation.typeName.left.name\n ) &&\n typeAnnotation.typeName.right.type === \"Identifier\" &&\n typeAnnotation.typeName.right.name === WRITABLE_TYPE_NAME\n );\n };\n\n /**\n * Report and optionally autofix `Writable<...>` type assertions to\n * `asWritable(...)` calls.\n */\n const reportIfWritableAssertion = (\n node: Readonly<TSESTree.Node>,\n expression: Readonly<TSESTree.Expression>,\n typeAnnotation: Readonly<TSESTree.TypeNode>\n ): void => {\n if (!isWritableTypeReference(typeAnnotation)) {\n return;\n }\n\n const expressionArgumentText = getFunctionCallArgumentText({\n argumentNode: expression,\n sourceCode: context.sourceCode,\n });\n\n if (expressionArgumentText === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAsWritable\",\n node,\n });\n\n return;\n }\n\n const fix = createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"asWritable\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${expressionArgumentText})`,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n\n reportWithOptionalFix({\n context,\n fix,\n messageId: \"preferTsExtrasAsWritable\",\n node,\n });\n };\n\n return {\n TSAsExpression(node) {\n reportIfWritableAssertion(\n node,\n node.expression,\n node.typeAnnotation\n );\n },\n TSTypeAssertion(node) {\n reportIfWritableAssertion(\n node,\n node.expression,\n node.typeAnnotation\n );\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras asWritable over Writable<T> style assertions from type-fest.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-as-writable\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasAsWritable:\n \"Prefer `asWritable(value)` from `ts-extras` over `Writable<...>` assertions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-as-writable\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-as-writable` rule module.\n */\nexport default preferTsExtrasAsWritableRule;\n", "/**\n * @packageDocumentation\n * Shared helpers for extracting throw-only `if` consequents.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\n/**\n * Extract the single throw statement from a block consequent when present.\n *\n * @param node - Consequent statement candidate.\n *\n * @returns The throw statement when the consequent is exactly `{ throw ... }`;\n * otherwise `null`.\n */\nconst getSingleThrowFromBlockConsequent = (\n node: Readonly<TSESTree.Statement>\n): null | TSESTree.ThrowStatement => {\n if (node.type !== \"BlockStatement\" || node.body.length !== 1) {\n return null;\n }\n\n const firstStatement = arrayFirst(node.body);\n\n if (firstStatement?.type !== \"ThrowStatement\") {\n return null;\n }\n\n return firstStatement;\n};\n\n/**\n * Check whether an `if` consequent contains only a throw statement.\n *\n * @param node - Consequent statement to inspect.\n *\n * @returns `true` for `throw ...` and `{ throw ... }` shapes.\n */\nexport const isThrowOnlyConsequent = (\n node: Readonly<TSESTree.Statement>\n): boolean => {\n if (node.type === \"ThrowStatement\") {\n return true;\n }\n\n /* v8 ignore next 2 -- defensive sparse-array guard for malformed synthetic AST nodes. */\n return getSingleThrowFromBlockConsequent(node) !== null;\n};\n\n/**\n * Extract the throw statement from a throw-only consequent.\n *\n * @param node - Consequent statement to inspect.\n *\n * @returns Throw statement when present; otherwise `null`.\n */\nexport const getThrowStatementFromConsequent = (\n node: Readonly<TSESTree.Statement>\n): null | TSESTree.ThrowStatement => {\n if (node.type === \"ThrowStatement\") {\n return node;\n }\n\n /* v8 ignore next 2 -- guarded by isThrowOnlyConsequent before this helper is invoked in rule flow. */\n return getSingleThrowFromBlockConsequent(node);\n};\n", "/**\n * @packageDocumentation\n * Shared helpers for validating canonical `throw new TypeError(...)` shapes.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { isGlobalIdentifierNamed } from \"./typed-rule.js\";\n\n/**\n * Extract the single constructor argument from `throw new TypeError(...)`\n * statements when the constructor resolves to the global `TypeError` binding.\n *\n * @param options - Rule context and throw statement candidate.\n *\n * @returns The single non-spread constructor argument; otherwise `null`.\n */\nexport const getSingleGlobalTypeErrorArgument = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>({\n context,\n throwStatement,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>;\n throwStatement: Readonly<TSESTree.ThrowStatement>;\n}>): null | TSESTree.Expression => {\n if (\n throwStatement.argument.type !== \"NewExpression\" ||\n throwStatement.argument.callee.type !== \"Identifier\" ||\n throwStatement.argument.callee.name !== \"TypeError\" ||\n !isGlobalIdentifierNamed(\n context,\n throwStatement.argument.callee,\n \"TypeError\"\n ) ||\n throwStatement.argument.arguments.length !== 1\n ) {\n return null;\n }\n\n const [firstArgument] = throwStatement.argument.arguments;\n if (!firstArgument || firstArgument.type === \"SpreadElement\") {\n return null;\n }\n\n return firstArgument;\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-assert-defined`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n} from \"../_internal/rule-reporting.js\";\nimport {\n getThrowStatementFromConsequent,\n isThrowOnlyConsequent,\n} from \"../_internal/throw-consequent.js\";\nimport { getSingleGlobalTypeErrorArgument } from \"../_internal/throw-type-error.js\";\nimport {\n createTypedRule,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\n\n/** Concrete rule context type inferred from `createTypedRule`. */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Determine whether an expression references the global `undefined` value.\n *\n * @param context - Active rule context for scope resolution.\n * @param node - Expression to inspect.\n *\n * @returns `true` when the expression is an unshadowed `undefined` identifier.\n */\nconst isUndefinedExpression = ({\n context,\n node,\n}: Readonly<{\n context: RuleContext;\n node: Readonly<TSESTree.Expression>;\n}>): boolean => {\n if (node.type !== \"Identifier\" || node.name !== \"undefined\") {\n return false;\n }\n\n return isGlobalUndefinedIdentifier(context, node);\n};\n\n/**\n * Check whether the throw body matches the canonical assertDefined-equivalent\n * error shape.\n *\n * @param context - Active rule context for global-binding checks.\n * @param throwStatement - Throw statement extracted from the guard branch.\n *\n * @returns True when the throw is a TypeError whose message equals \"Expected a\n * defined value, got undefined\".\n */\nconst isCanonicalAssertDefinedThrow = (\n context: RuleContext,\n throwStatement: Readonly<TSESTree.ThrowStatement>\n): boolean => {\n const firstArgument = getSingleGlobalTypeErrorArgument({\n context,\n throwStatement,\n });\n if (firstArgument === null) {\n return false;\n }\n\n return (\n firstArgument.type === \"Literal\" &&\n firstArgument.value === \"Expected a defined value, got `undefined`\"\n );\n};\n\n/**\n * Extract the guarded expression from `x == undefined` / `undefined === x`\n * checks.\n *\n * @param test - Conditional test expression to inspect.\n * @param context - Active rule context for global-binding checks.\n *\n * @returns Guarded expression when the test is a supported undefined\n * comparison; otherwise `null`.\n */\nconst extractDefinedGuardExpression = (\n test: Readonly<TSESTree.Expression>,\n context: RuleContext\n): null | TSESTree.Expression => {\n if (\n test.type !== \"BinaryExpression\" ||\n (test.operator !== \"==\" && test.operator !== \"===\")\n ) {\n return null;\n }\n\n if (\n isUndefinedExpression({\n context,\n node: test.left,\n })\n ) {\n return test.right;\n }\n\n if (\n isUndefinedExpression({\n context,\n node: test.right,\n })\n ) {\n return test.left;\n }\n\n return null;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-assert-defined`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasAssertDefinedRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n IfStatement(node) {\n if (\n node.alternate !== null ||\n !isThrowOnlyConsequent(node.consequent)\n ) {\n return;\n }\n\n const guardExpression = extractDefinedGuardExpression(\n node.test,\n context\n );\n\n if (guardExpression === null) {\n return;\n }\n\n const throwStatement = getThrowStatementFromConsequent(\n node.consequent\n );\n const canAutofix =\n throwStatement !== null &&\n isCanonicalAssertDefinedThrow(context, throwStatement);\n const guardExpressionArgumentText =\n getFunctionCallArgumentText({\n argumentNode: guardExpression,\n sourceCode: context.sourceCode,\n });\n\n if (guardExpressionArgumentText === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertDefined\",\n node,\n });\n\n return;\n }\n\n const replacementFix =\n createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"assertDefined\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${guardExpressionArgumentText});`,\n reportFixIntent: canAutofix\n ? \"autofix\"\n : \"suggestion\",\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n\n if (replacementFix === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertDefined\",\n node,\n });\n\n return;\n }\n\n if (canAutofix) {\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferTsExtrasAssertDefined\",\n node,\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasAssertDefined\",\n node,\n suggest: [\n {\n fix: replacementFix,\n messageId: \"suggestTsExtrasAssertDefined\",\n },\n ],\n },\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras assertDefined over manual undefined-guard throw blocks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-assert-defined\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasAssertDefined:\n \"Prefer `assertDefined` from `ts-extras` over manual undefined guard throw blocks.\",\n suggestTsExtrasAssertDefined:\n \"Replace this manual guard with `assertDefined(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-assert-defined\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-assert-defined` rule module.\n */\nexport default preferTsExtrasAssertDefinedRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-assert-error`.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n} from \"../_internal/rule-reporting.js\";\nimport { isThrowOnlyConsequent } from \"../_internal/throw-consequent.js\";\nimport {\n createTypedRule,\n isGlobalIdentifierNamed,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * Checks whether an expression is `<value> instanceof Error`.\n *\n * @param context - Rule context used to verify that `Error` resolves to the\n * global constructor.\n * @param expression - Expression to inspect.\n *\n * @returns `true` when the expression is an `instanceof` check against the\n * global `Error` symbol.\n */\nconst isErrorInstanceofExpression = (\n context: Readonly<TSESLint.RuleContext<string, Readonly<UnknownArray>>>,\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.BinaryExpression => {\n if (expression.type !== \"BinaryExpression\") {\n return false;\n }\n\n if (expression.operator !== \"instanceof\") {\n return false;\n }\n\n if (expression.right.type !== \"Identifier\") {\n return false;\n }\n\n return isGlobalIdentifierNamed(context, expression.right, \"Error\");\n};\n\n/**\n * Extracts the guarded value from `!(value instanceof Error)` checks.\n *\n * @param context - Rule context used for global identifier resolution.\n * @param test - `IfStatement.test` expression to inspect.\n *\n * @returns The left-hand expression from `value instanceof Error` when the test\n * shape is compatible with `assertError`; otherwise `null`.\n */\nconst extractAssertErrorTarget = (\n context: Readonly<TSESLint.RuleContext<string, Readonly<UnknownArray>>>,\n test: Readonly<TSESTree.Expression>\n): null | TSESTree.Expression => {\n if (test.type !== \"UnaryExpression\") {\n return null;\n }\n\n if (test.operator !== \"!\") {\n return null;\n }\n\n const { argument } = test;\n\n if (!isErrorInstanceofExpression(context, argument)) {\n return null;\n }\n\n /* V8 ignore next -- ESTree allows PrivateIdentifier here, but parsed\n TS/JS `instanceof` left operands are expressions (e.g. `this.#value`),\n not bare PrivateIdentifier nodes. */\n if (argument.left.type === \"PrivateIdentifier\") {\n return null;\n }\n\n return argument.left;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-assert-error`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasAssertErrorRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n IfStatement(node) {\n if (\n node.alternate !== null ||\n !isThrowOnlyConsequent(node.consequent)\n ) {\n return;\n }\n\n const guardExpression = extractAssertErrorTarget(\n context,\n node.test\n );\n\n if (guardExpression === null) {\n return;\n }\n\n const guardExpressionArgumentText =\n getFunctionCallArgumentText({\n argumentNode: guardExpression,\n sourceCode: context.sourceCode,\n });\n\n if (guardExpressionArgumentText === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertError\",\n node,\n });\n\n return;\n }\n\n const replacementFix =\n createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"assertError\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${guardExpressionArgumentText});`,\n reportFixIntent: \"suggestion\",\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n\n if (replacementFix === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertError\",\n node,\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasAssertError\",\n node,\n suggest: [\n {\n fix: replacementFix,\n messageId: \"suggestTsExtrasAssertError\",\n },\n ],\n },\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras assertError over manual instanceof Error throw guards.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-assert-error\",\n },\n hasSuggestions: true,\n messages: {\n preferTsExtrasAssertError:\n \"Prefer `assertError` from `ts-extras` over manual `instanceof Error` throw guards.\",\n suggestTsExtrasAssertError:\n \"Replace this manual guard with `assertError(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-assert-error\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-assert-error` rule module.\n */\nexport default preferTsExtrasAssertErrorRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-assert-present`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentExpressions } from \"../_internal/normalize-expression-text.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n} from \"../_internal/rule-reporting.js\";\nimport {\n getThrowStatementFromConsequent,\n isThrowOnlyConsequent,\n} from \"../_internal/throw-consequent.js\";\nimport { getSingleGlobalTypeErrorArgument } from \"../_internal/throw-type-error.js\";\nimport {\n createTypedRule,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\n\n/** Concrete rule context type inferred from `createTypedRule`. */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Determine whether an expression is the `null` literal.\n *\n * @param node - Expression to inspect.\n *\n * @returns `true` when the expression is `null`.\n */\nconst isNullExpression = (node: Readonly<TSESTree.Expression>): boolean =>\n node.type === \"Literal\" && node.value === null;\n\n/**\n * Determine whether an expression references the global `undefined` value.\n *\n * @param context - Active rule context for scope resolution.\n * @param node - Expression to inspect.\n *\n * @returns `true` when the expression is an unshadowed `undefined` identifier.\n */\nconst isUndefinedExpression = ({\n context,\n node,\n}: Readonly<{\n context: RuleContext;\n node: Readonly<TSESTree.Expression>;\n}>): boolean => {\n if (node.type !== \"Identifier\" || node.name !== \"undefined\") {\n return false;\n }\n\n return isGlobalUndefinedIdentifier(context, node);\n};\n\n/**\n * Check whether a throw branch matches the canonical `assertPresent`-equivalent\n * TypeError template shape.\n */\nconst isCanonicalAssertPresentThrow = ({\n context,\n guardExpression,\n throwStatement,\n}: Readonly<{\n context: RuleContext;\n guardExpression: TSESTree.Expression;\n throwStatement: TSESTree.ThrowStatement;\n}>): boolean => {\n const firstArgument = getSingleGlobalTypeErrorArgument({\n context,\n throwStatement,\n });\n if (firstArgument?.type !== \"TemplateLiteral\") {\n return false;\n }\n\n const [prefixQuasi, suffixQuasi] = firstArgument.quasis;\n if (\n !prefixQuasi ||\n !suffixQuasi ||\n firstArgument.expressions.length !== 1\n ) {\n return false;\n }\n\n const [templateExpression] = firstArgument.expressions;\n /* v8 ignore next -- parser guarantees an element at index 0 when expressions.length is exactly 1. */\n if (!templateExpression) {\n return false;\n }\n\n return (\n (prefixQuasi.value.cooked === \"Expected a present value, got `\" ||\n prefixQuasi.value.cooked === \"Expected a present value, got \") &&\n (suffixQuasi.value.cooked === \"`\" || suffixQuasi.value.cooked === \"\") &&\n areEquivalentExpressions(templateExpression, guardExpression)\n );\n};\n\n/**\n * Extract the guarded expression from `x == null` / `null == x` checks.\n *\n * @param test - Test expression to inspect.\n *\n * @returns Guarded expression when the check is supported; otherwise `null`.\n */\nconst extractEqNullGuardExpression = (\n test: Readonly<TSESTree.Expression>\n): null | TSESTree.Expression => {\n if (test.type !== \"BinaryExpression\" || test.operator !== \"==\") {\n return null;\n }\n\n if (isNullExpression(test.left)) {\n return test.right;\n }\n\n if (isNullExpression(test.right)) {\n return test.left;\n }\n\n return null;\n};\n\n/**\n * Extract one nullish-equality comparison part from a binary expression.\n *\n * @param expression - Candidate comparison expression.\n * @param context - Active rule context for global-binding checks.\n *\n * @returns Matched comparison metadata; otherwise `null`.\n */\nconst extractNullishEqualityPart = (\n expression: Readonly<TSESTree.Expression>,\n context: RuleContext\n): null | {\n expression: TSESTree.Expression;\n kind: \"null\" | \"undefined\";\n} => {\n if (\n expression.type !== \"BinaryExpression\" ||\n (expression.operator !== \"==\" && expression.operator !== \"===\")\n ) {\n return null;\n }\n\n if (isNullExpression(expression.left)) {\n return {\n expression: expression.right,\n kind: \"null\",\n };\n }\n\n if (isNullExpression(expression.right)) {\n return {\n expression: expression.left,\n kind: \"null\",\n };\n }\n\n if (\n isUndefinedExpression({\n context,\n node: expression.left,\n })\n ) {\n return {\n expression: expression.right,\n kind: \"undefined\",\n };\n }\n\n if (\n isUndefinedExpression({\n context,\n node: expression.right,\n })\n ) {\n return {\n expression: expression.left,\n kind: \"undefined\",\n };\n }\n\n return null;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-assert-present`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasAssertPresentRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n /**\n * Extracts the guarded expression from supported nullish-present\n * checks used before throwing.\n *\n * @param test - If-statement test expression.\n *\n * @returns Guarded expression when the test matches `x == null` or\n * split null/undefined disjunction patterns; otherwise `null`.\n */\n const extractPresentGuardExpression = (\n test: Readonly<TSESTree.Expression>\n ): null | TSESTree.Expression => {\n const eqNullExpression = extractEqNullGuardExpression(test);\n if (eqNullExpression !== null) {\n return eqNullExpression;\n }\n\n if (\n test.type !== \"LogicalExpression\" ||\n test.operator !== \"||\"\n ) {\n return null;\n }\n\n const leftPart = extractNullishEqualityPart(test.left, context);\n const rightPart = extractNullishEqualityPart(\n test.right,\n context\n );\n\n if (\n leftPart === null ||\n rightPart === null ||\n leftPart.kind === rightPart.kind\n ) {\n return null;\n }\n\n return areEquivalentExpressions(\n leftPart.expression,\n rightPart.expression\n )\n ? leftPart.expression\n : null;\n };\n\n return {\n IfStatement(node) {\n if (\n node.alternate !== null ||\n !isThrowOnlyConsequent(node.consequent)\n ) {\n return;\n }\n\n const guardExpression = extractPresentGuardExpression(\n node.test\n );\n\n if (guardExpression === null) {\n return;\n }\n\n const throwStatement = getThrowStatementFromConsequent(\n node.consequent\n );\n const canAutofix =\n throwStatement !== null &&\n isCanonicalAssertPresentThrow({\n context,\n guardExpression,\n throwStatement,\n });\n const guardExpressionArgumentText =\n getFunctionCallArgumentText({\n argumentNode: guardExpression,\n sourceCode: context.sourceCode,\n });\n\n if (guardExpressionArgumentText === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertPresent\",\n node,\n });\n\n return;\n }\n\n const replacementFix =\n createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"assertPresent\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${guardExpressionArgumentText});`,\n reportFixIntent: canAutofix\n ? \"autofix\"\n : \"suggestion\",\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n\n if (replacementFix === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasAssertPresent\",\n node,\n });\n\n return;\n }\n\n if (canAutofix) {\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferTsExtrasAssertPresent\",\n node,\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasAssertPresent\",\n node,\n suggest: [\n {\n fix: replacementFix,\n messageId: \"suggestTsExtrasAssertPresent\",\n },\n ],\n },\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras assertPresent over manual nullish-guard throw blocks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-assert-present\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasAssertPresent:\n \"Prefer `assertPresent` from `ts-extras` over manual nullish guard throw blocks.\",\n suggestTsExtrasAssertPresent:\n \"Replace this manual guard with `assertPresent(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-assert-present\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-assert-present` rule module.\n */\nexport default preferTsExtrasAssertPresentRule;\n", "/**\n * @packageDocumentation\n * Utilities for detecting nodes that live inside `.filter(...)` callbacks.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getParentNode } from \"./ast-node.js\";\nimport { setContainsValue } from \"./set-membership.js\";\n\n/** Target method name used for callback-context detection. */\nconst FILTER_METHOD_NAME = \"filter\";\n\n/**\n * Narrows nodes to function-like callback expressions.\n */\nconst isFunctionCallbackNode = (\n node: Readonly<TSESTree.Node>\n): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression =>\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionExpression\";\n\n/**\n * Narrows call expressions to direct `.filter(...)` calls.\n */\nexport const isFilterCallExpression = (\n expression: Readonly<TSESTree.CallExpression>\n): expression is TSESTree.CallExpression & {\n callee: TSESTree.MemberExpression & {\n computed: false;\n optional: false;\n property: TSESTree.Identifier;\n };\n optional: false;\n} =>\n !expression.optional &&\n expression.callee.type === \"MemberExpression\" &&\n !expression.callee.computed &&\n !expression.callee.optional &&\n expression.callee.property.type === \"Identifier\" &&\n expression.callee.property.name === FILTER_METHOD_NAME;\n\n/**\n * Extract the first callback argument from a direct `.filter(...)` call.\n *\n * @param expression - Candidate call expression to inspect.\n *\n * @returns Callback expression when the call is a supported `.filter(...)`\n * invocation and the first argument is an arrow/function expression;\n * otherwise `null`.\n */\nexport const getFilterCallbackFunctionArgument = (\n expression: Readonly<TSESTree.CallExpression>\n): null | Readonly<\n TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression\n> => {\n if (!isFilterCallExpression(expression)) {\n return null;\n }\n\n const [firstArgument] = expression.arguments;\n if (\n !firstArgument ||\n (firstArgument.type !== \"ArrowFunctionExpression\" &&\n firstArgument.type !== \"FunctionExpression\")\n ) {\n return null;\n }\n\n return firstArgument;\n};\n\n/**\n * Structured match for `.filter(...)` calls with a single identifier parameter\n * arrow callback that uses an expression body.\n */\nexport type SingleParameterExpressionArrowFilterCallbackMatch = Readonly<{\n callback: TSESTree.ArrowFunctionExpression & {\n body: TSESTree.Expression;\n params: [TSESTree.Identifier];\n };\n parameter: TSESTree.Identifier;\n}>;\n\n/**\n * Extract a strict callback shape from direct `.filter(...)` calls.\n *\n * @param expression - Candidate call expression to inspect.\n *\n * @returns Structured callback match when supported; otherwise `null`.\n */\nexport const getSingleParameterExpressionArrowFilterCallback = (\n expression: Readonly<TSESTree.CallExpression>\n): null | SingleParameterExpressionArrowFilterCallbackMatch => {\n const callback = getFilterCallbackFunctionArgument(expression);\n if (callback?.type !== \"ArrowFunctionExpression\") {\n return null;\n }\n\n if (callback.params.length !== 1) {\n return null;\n }\n\n if (callback.body.type === \"BlockStatement\") {\n return null;\n }\n\n const [parameter] = callback.params;\n if (parameter?.type !== \"Identifier\") {\n return null;\n }\n\n return {\n callback: callback as TSESTree.ArrowFunctionExpression & {\n body: TSESTree.Expression;\n params: [TSESTree.Identifier];\n },\n parameter,\n };\n};\n\n/**\n * Checks whether a node appears inside a callback passed as the first argument\n * to a direct `.filter(...)` call.\n *\n * @param node - Node to inspect.\n *\n * @returns `true` when the node is inside a `.filter(...)` callback; otherwise\n * `false`.\n */\nexport const isWithinFilterCallback = (\n node: Readonly<TSESTree.Node>\n): boolean => {\n let currentNode: TSESTree.Node | undefined = node;\n const visitedNodes = new Set<TSESTree.Node>();\n\n while (currentNode) {\n if (setContainsValue(visitedNodes, currentNode)) {\n return false;\n }\n\n visitedNodes.add(currentNode);\n\n if (isFunctionCallbackNode(currentNode)) {\n const callbackParent = getParentNode(currentNode);\n if (callbackParent?.type !== \"CallExpression\") {\n currentNode = getParentNode(currentNode);\n continue;\n }\n\n const [firstArgument] = callbackParent.arguments;\n\n if (\n firstArgument === currentNode &&\n isFilterCallExpression(callbackParent)\n ) {\n return true;\n }\n }\n\n currentNode = getParentNode(currentNode);\n }\n\n return false;\n};\n", "/**\n * @packageDocumentation\n * Shared helpers for parsing and flattening nullish comparison expressions.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { arrayIncludes, isDefined } from \"ts-extras\";\n\n/**\n * Normalized representation of one binary comparison against null/undefined.\n */\nexport type NullishComparison = Readonly<{\n comparedExpression: TSESTree.Expression;\n kind: NullishComparisonKind;\n operator: NullishComparisonOperator;\n}>;\n\n/** Nullish literal kinds supported by comparison extraction. */\nexport type NullishComparisonKind = \"null\" | \"undefined\";\n\n/** Operators supported by nullish comparison extraction. */\nexport type NullishComparisonOperator = \"!=\" | \"!==\" | \"==\" | \"===\";\n\n/** Default accepted operators for nullish comparison parsing. */\nconst defaultNullishComparisonOperators = [\n \"!=\",\n \"!==\",\n \"==\",\n \"===\",\n] as const satisfies readonly NullishComparisonOperator[];\n\n/**\n * Flatten a logical-expression tree for one specific operator.\n *\n * @param options - Expression and logical operator to flatten.\n *\n * @returns Left-to-right list of terms participating in that operator chain.\n */\nexport const flattenLogicalTerms = ({\n expression,\n operator,\n}: Readonly<{\n expression: Readonly<TSESTree.Expression>;\n operator: \"&&\" | \"||\";\n}>): readonly TSESTree.Expression[] => {\n const flattenedTerms: TSESTree.Expression[] = [];\n const pendingTerms: TSESTree.Expression[] = [expression];\n\n while (pendingTerms.length > 0) {\n const currentTerm = pendingTerms.pop();\n\n if (!currentTerm) {\n continue;\n }\n\n if (\n currentTerm.type === \"LogicalExpression\" &&\n currentTerm.operator === operator\n ) {\n pendingTerms.push(currentTerm.right, currentTerm.left);\n continue;\n }\n\n flattenedTerms.push(currentTerm);\n }\n\n return flattenedTerms;\n};\n\nconst STRICT_NULLISH_TERM_COUNT = 2 as const;\n\n/**\n * Narrow a list of expressions to an exact two-term tuple.\n */\nexport const isExpressionPair = (\n terms: readonly Readonly<TSESTree.Expression>[]\n): terms is readonly [TSESTree.Expression, TSESTree.Expression] =>\n terms.length === STRICT_NULLISH_TERM_COUNT;\n\n/**\n * Check whether an expression is the literal `null`.\n */\nconst isNullLiteral = (\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.Literal & { value: null } =>\n expression.type === \"Literal\" && expression.value === null;\n\n/**\n * Check whether an expression is the string literal `\"undefined\"`.\n */\nconst isUndefinedStringLiteral = (\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.Literal & { value: \"undefined\" } =>\n expression.type === \"Literal\" && expression.value === \"undefined\";\n\n/**\n * Check whether an expression is `typeof <identifierName>`.\n */\nconst isTypeofIdentifierExpression = (\n expression: Readonly<TSESTree.Expression>,\n identifierName: string\n): expression is TSESTree.UnaryExpression & { argument: TSESTree.Identifier } =>\n expression.type === \"UnaryExpression\" &&\n expression.operator === \"typeof\" &&\n expression.argument.type === \"Identifier\" &&\n expression.argument.name === identifierName;\n\n/**\n * Narrow a binary-operator string to supported nullish comparison operators.\n */\nconst isAllowedNullishComparisonOperator = (\n operator: TSESTree.BinaryExpression[\"operator\"]\n): operator is NullishComparisonOperator =>\n operator === \"!=\" ||\n operator === \"!==\" ||\n operator === \"==\" ||\n operator === \"===\";\n\n/**\n * Narrow an ESTree expression-like union to regular expressions (excluding\n * private identifiers).\n */\nconst isExpressionNode = (\n expression: Readonly<TSESTree.Expression | TSESTree.PrivateIdentifier>\n): expression is TSESTree.Expression => expression.type !== \"PrivateIdentifier\";\n\n/**\n * Extract a normalized nullish comparison from an expression.\n */\nexport const getNullishComparison = ({\n allowedOperators = defaultNullishComparisonOperators,\n allowTypeofComparedIdentifierForUndefined = false,\n comparedIdentifierName,\n expression,\n isGlobalUndefinedIdentifier,\n}: Readonly<{\n allowedOperators?: readonly NullishComparisonOperator[];\n allowTypeofComparedIdentifierForUndefined?: boolean;\n comparedIdentifierName?: string;\n expression: Readonly<TSESTree.Expression>;\n isGlobalUndefinedIdentifier: (\n expression: Readonly<TSESTree.Expression>\n ) => boolean;\n}>): null | NullishComparison => {\n if (expression.type !== \"BinaryExpression\") {\n return null;\n }\n\n if (!isAllowedNullishComparisonOperator(expression.operator)) {\n return null;\n }\n\n if (\n allowedOperators !== defaultNullishComparisonOperators &&\n !arrayIncludes(allowedOperators, expression.operator)\n ) {\n return null;\n }\n\n const matchesComparedExpression = (\n candidateExpression: Readonly<TSESTree.Expression>\n ): boolean =>\n !isDefined(comparedIdentifierName) ||\n (candidateExpression.type === \"Identifier\" &&\n candidateExpression.name === comparedIdentifierName);\n\n if (\n isNullLiteral(expression.right) &&\n isExpressionNode(expression.left) &&\n matchesComparedExpression(expression.left)\n ) {\n return {\n comparedExpression: expression.left,\n kind: \"null\",\n operator: expression.operator,\n };\n }\n\n if (\n isExpressionNode(expression.left) &&\n isNullLiteral(expression.left) &&\n isExpressionNode(expression.right) &&\n matchesComparedExpression(expression.right)\n ) {\n return {\n comparedExpression: expression.right,\n kind: \"null\",\n operator: expression.operator,\n };\n }\n\n if (\n expression.right.type === \"Identifier\" &&\n isGlobalUndefinedIdentifier(expression.right) &&\n isExpressionNode(expression.left) &&\n matchesComparedExpression(expression.left)\n ) {\n return {\n comparedExpression: expression.left,\n kind: \"undefined\",\n operator: expression.operator,\n };\n }\n\n if (\n expression.left.type === \"Identifier\" &&\n isGlobalUndefinedIdentifier(expression.left) &&\n isExpressionNode(expression.right) &&\n matchesComparedExpression(expression.right)\n ) {\n return {\n comparedExpression: expression.right,\n kind: \"undefined\",\n operator: expression.operator,\n };\n }\n\n if (\n !isDefined(comparedIdentifierName) ||\n !allowTypeofComparedIdentifierForUndefined\n ) {\n return null;\n }\n\n if (\n isExpressionNode(expression.left) &&\n isExpressionNode(expression.right) &&\n isTypeofIdentifierExpression(expression.left, comparedIdentifierName) &&\n isUndefinedStringLiteral(expression.right)\n ) {\n return {\n comparedExpression: expression.left.argument,\n kind: \"undefined\",\n operator: expression.operator,\n };\n }\n\n if (\n isExpressionNode(expression.right) &&\n isExpressionNode(expression.left) &&\n isTypeofIdentifierExpression(\n expression.right,\n comparedIdentifierName\n ) &&\n isUndefinedStringLiteral(expression.left)\n ) {\n return {\n comparedExpression: expression.right.argument,\n kind: \"undefined\",\n operator: expression.operator,\n };\n }\n\n return null;\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-defined-filter`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getSingleParameterExpressionArrowFilterCallback } from \"../_internal/filter-callback.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueReferenceReplacementFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { getNullishComparison } from \"../_internal/nullish-comparison.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\n\n/** Concrete rule context type inferred from `createTypedRule`. */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Check whether a callback body is a supported undefined guard expression.\n *\n * @param context - Active rule context for global-binding checks.\n * @param body - Callback body expression to inspect.\n * @param parameterName - Callback parameter name.\n *\n * @returns `true` when the body can be replaced with `isDefined`.\n */\nconst isUndefinedFilterGuardBody = (\n context: RuleContext,\n body: Readonly<TSESTree.Expression>,\n parameterName: string\n): boolean => {\n const comparison = getNullishComparison({\n allowedOperators: [\"!=\", \"!==\"],\n allowTypeofComparedIdentifierForUndefined: true,\n comparedIdentifierName: parameterName,\n expression: body,\n isGlobalUndefinedIdentifier: (candidateExpression) =>\n isGlobalUndefinedIdentifier(context, candidateExpression),\n });\n\n return comparison?.kind === \"undefined\";\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-defined-filter`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsDefinedFilterRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.property.type=\"Identifier\"][callee.property.name=\"filter\"]'(\n node\n ) {\n const callbackMatch =\n getSingleParameterExpressionArrowFilterCallback(node);\n if (!callbackMatch) {\n return;\n }\n\n const { callback, parameter } = callbackMatch;\n\n if (\n !isUndefinedFilterGuardBody(\n context,\n callback.body,\n parameter.name\n )\n ) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: createSafeValueReferenceReplacementFix({\n context,\n importedName: \"isDefined\",\n imports: tsExtrasImports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: callback,\n }),\n messageId: \"preferTsExtrasIsDefinedFilter\",\n node: callback,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isDefined in Array.filter callbacks instead of inline undefined checks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-defined-filter\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsDefinedFilter:\n \"Prefer `isDefined` from `ts-extras` in `filter(...)` callbacks over inline undefined comparisons.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-defined-filter\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-defined-filter` rule module.\n */\nexport default preferTsExtrasIsDefinedFilterRule;\n", "/**\n * @packageDocumentation\n * Shared type-aware guardrails for skipping risky rule reports/fixes on\n * `@typescript-eslint` AST-node expressions.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray, UnknownRecord } from \"type-fest\";\nimport type ts from \"typescript\";\n\nimport parser from \"@typescript-eslint/parser\";\nimport {\n isTypeAnyType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport {\n arrayIncludes,\n isDefined,\n objectHasOwn,\n safeCastTo,\n stringSplit,\n} from \"ts-extras\";\n\nimport type { TypedRuleServices } from \"./typed-rule.js\";\n\nimport { getBoundedCacheValue, setBoundedCacheValue } from \"./bounded-cache.js\";\nimport { getConstrainedTypeAtLocationWithFallback } from \"./constrained-type-at-location.js\";\nimport { TYPESCRIPT_ESLINT_UTILS_MODULE_SOURCE } from \"./module-source.js\";\nimport { safeTypeOperation } from \"./safe-type-operation.js\";\nimport { getVariableInScopeChain } from \"./scope-variable.js\";\nimport { setContainsValue } from \"./set-membership.js\";\nimport {\n getTypeCheckerApparentType,\n getTypeCheckerBaseConstraintType,\n getTypeCheckerTypeArguments,\n} from \"./type-checker-compat.js\";\nimport { recordTypedPathPrefilterEvaluation } from \"./typed-path-telemetry.js\";\n\nconst TYPESCRIPT_ESLINT_PACKAGE_SEGMENT = \"@typescript-eslint\" as const;\nconst TSESTREE_NAMESPACE_NAME = \"TSESTree\" as const;\nconst PATH_SEPARATOR = \"/\" as const;\nconst ASCII_DIGIT_ZERO_CODE_POINT = 48 as const;\nconst ASCII_DIGIT_NINE_CODE_POINT = 57 as const;\nconst ASCII_UPPERCASE_A_CODE_POINT = 65 as const;\nconst ASCII_UPPERCASE_Z_CODE_POINT = 90 as const;\nconst ASCII_UNDERSCORE_CODE_POINT = 95 as const;\nconst ASCII_DOLLAR_SIGN_CODE_POINT = 36 as const;\nconst ASCII_LOWERCASE_A_CODE_POINT = 97 as const;\nconst ASCII_LOWERCASE_Z_CODE_POINT = 122 as const;\n\n/**\n * ESTree metadata keys that never contribute to semantic type-reference\n * detection during fallback node traversal.\n */\nconst IGNORED_TRAVERSAL_KEYS = new Set<string>([\n \"comments\",\n \"end\",\n \"loc\",\n \"parent\",\n \"range\",\n \"start\",\n \"tokens\",\n]);\n\nconst namespaceImportNamesBySourceCode = new WeakMap<\n Readonly<TSESLint.SourceCode>,\n ReadonlySet<string>\n>();\n\nconst MAX_PARSED_DEFINITION_TEXT_CACHE_ENTRIES = 512 as const;\n\n/**\n * Upper bound for fallback definition text that may be reparsed as a synthetic\n * program.\n *\n * @remarks\n * Extremely large definition snippets provide little signal for this fallback\n * and can degrade lint latency in adversarial files.\n */\nconst MAX_DEFINITION_TEXT_PARSE_LENGTH = 16_384 as const;\n\nconst parsedDefinitionTextProgramBySourceText = new Map<\n string,\n null | Readonly<TSESTree.Program>\n>();\n\nconst cacheParsedDefinitionTextProgram = ({\n cacheKey,\n parsedProgram,\n}: Readonly<{\n cacheKey: string;\n parsedProgram: null | Readonly<TSESTree.Program>;\n}>): void => {\n setBoundedCacheValue({\n cache: parsedDefinitionTextProgramBySourceText,\n key: cacheKey,\n maxEntries: MAX_PARSED_DEFINITION_TEXT_CACHE_ENTRIES,\n value: parsedProgram,\n });\n};\n\n/**\n * Determine whether a code point is valid within an ASCII identifier token.\n */\nconst isAsciiIdentifierCodePoint = (codePoint: number): boolean =>\n (codePoint >= ASCII_UPPERCASE_A_CODE_POINT &&\n codePoint <= ASCII_UPPERCASE_Z_CODE_POINT) ||\n (codePoint >= ASCII_LOWERCASE_A_CODE_POINT &&\n codePoint <= ASCII_LOWERCASE_Z_CODE_POINT) ||\n (codePoint >= ASCII_DIGIT_ZERO_CODE_POINT &&\n codePoint <= ASCII_DIGIT_NINE_CODE_POINT) ||\n codePoint === ASCII_UNDERSCORE_CODE_POINT ||\n codePoint === ASCII_DOLLAR_SIGN_CODE_POINT;\n\n/**\n * Determine whether the code point at `index` is outside identifier syntax.\n */\nconst isIdentifierBoundaryAt = (text: string, index: number): boolean => {\n if (index < 0 || index >= text.length) {\n return true;\n }\n\n const codePoint = text.codePointAt(index);\n if (!isDefined(codePoint)) {\n return true;\n }\n\n return !isAsciiIdentifierCodePoint(codePoint);\n};\n\n/**\n * Advance an index over ASCII whitespace.\n */\nconst skipAsciiWhitespace = (text: string, startIndex: number): number => {\n let index = startIndex;\n\n while (index < text.length) {\n const character = text.at(index);\n\n if (\n character !== \" \" &&\n character !== \"\\n\" &&\n character !== \"\\r\" &&\n character !== \"\\t\"\n ) {\n break;\n }\n\n index += 1;\n }\n\n return index;\n};\n\nconst isTypeScriptEslintDeclarationPath = (fileName: string): boolean => {\n const normalizedFileName = fileName.replaceAll(\"\\\\\", PATH_SEPARATOR);\n const pathSegments = stringSplit(normalizedFileName, PATH_SEPARATOR).filter(\n (segment) => segment.length > 0\n );\n\n const packagePathSegment: string = TYPESCRIPT_ESLINT_PACKAGE_SEGMENT;\n\n return arrayIncludes(pathSegments, packagePathSegment);\n};\n\nconst isUnknownRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null;\n\n/**\n * Return `true` when a record key should be excluded from semantic traversal.\n */\nconst shouldSkipTraversalKey = (key: string): boolean =>\n setContainsValue(IGNORED_TRAVERSAL_KEYS, key);\n\nconst createDefinitionTextParseCandidates = (\n definitionNodeText: string\n): readonly string[] => {\n const trimmedText = definitionNodeText.trim();\n\n if (\n trimmedText.length === 0 ||\n trimmedText.length > MAX_DEFINITION_TEXT_PARSE_LENGTH\n ) {\n return [];\n }\n\n const parseCandidates = new Set<string>([\n `(${trimmedText});`,\n `const ${trimmedText};`,\n `type __typefest_tmp__ = ${trimmedText};`,\n trimmedText,\n ]);\n\n return [...parseCandidates];\n};\n\nconst parseDefinitionTextProgram = (\n definitionNodeText: string\n): null | Readonly<TSESTree.Program> => {\n const cacheKey = definitionNodeText.trim();\n\n if (cacheKey.length === 0) {\n return null;\n }\n\n const cachedProgramLookup = getBoundedCacheValue(\n parsedDefinitionTextProgramBySourceText,\n cacheKey\n );\n\n if (cachedProgramLookup.found) {\n return cachedProgramLookup.value;\n }\n\n const parseCandidates = createDefinitionTextParseCandidates(cacheKey);\n\n for (const parseCandidate of parseCandidates) {\n const parsedResult = safeTypeOperation({\n operation: () =>\n parser.parseForESLint(parseCandidate, {\n ecmaVersion: \"latest\",\n loc: false,\n range: false,\n sourceType: \"module\",\n }),\n reason: \"ts-eslint-node-autofix-parse-definition-candidate-failed\",\n });\n\n if (!parsedResult.ok) {\n continue;\n }\n\n cacheParsedDefinitionTextProgram({\n cacheKey,\n parsedProgram: parsedResult.value.ast,\n });\n\n return parsedResult.value.ast;\n }\n\n cacheParsedDefinitionTextProgram({\n cacheKey,\n parsedProgram: null,\n });\n\n return null;\n};\n\nconst getTypeScriptEslintNamespaceImportNames = (\n sourceCode: Readonly<TSESLint.SourceCode>\n): ReadonlySet<string> => {\n const cachedNamespaceNames =\n namespaceImportNamesBySourceCode.get(sourceCode);\n if (isDefined(cachedNamespaceNames)) {\n return cachedNamespaceNames;\n }\n\n const namespaceNames = new Set<string>();\n const programStatements = sourceCode.ast?.body;\n\n if (!Array.isArray(programStatements)) {\n namespaceImportNamesBySourceCode.set(sourceCode, namespaceNames);\n\n return namespaceNames;\n }\n\n for (const statement of programStatements) {\n if (\n statement.type !== \"ImportDeclaration\" ||\n statement.source.value !== TYPESCRIPT_ESLINT_UTILS_MODULE_SOURCE\n ) {\n continue;\n }\n\n for (const specifier of statement.specifiers) {\n if (specifier.type === \"ImportNamespaceSpecifier\") {\n namespaceNames.add(specifier.local.name);\n continue;\n }\n\n if (\n specifier.type === \"ImportSpecifier\" &&\n specifier.imported.type === \"Identifier\" &&\n specifier.imported.name === TSESTREE_NAMESPACE_NAME\n ) {\n namespaceNames.add(specifier.local.name);\n }\n }\n }\n\n const readonlyNamespaceNames: ReadonlySet<string> = new Set(namespaceNames);\n\n namespaceImportNamesBySourceCode.set(sourceCode, readonlyNamespaceNames);\n\n return readonlyNamespaceNames;\n};\n\nconst isTypeScriptEslintQualifiedTypeName = (\n typeName: unknown,\n namespaceNames: ReadonlySet<string>\n): boolean => {\n if (!isUnknownRecord(typeName) || typeName[\"type\"] !== \"TSQualifiedName\") {\n return false;\n }\n\n const left = typeName[\"left\"];\n const right = typeName[\"right\"];\n\n return (\n isUnknownRecord(left) &&\n left[\"type\"] === \"Identifier\" &&\n typeof left[\"name\"] === \"string\" &&\n setContainsValue(namespaceNames, left[\"name\"]) &&\n isUnknownRecord(right) &&\n right[\"type\"] === \"Identifier\" &&\n typeof right[\"name\"] === \"string\"\n );\n};\n\nconst containsTypeScriptEslintTypeReference = (\n rootNode: unknown,\n namespaceNames: ReadonlySet<string>\n): boolean => {\n if (namespaceNames.size === 0) {\n return false;\n }\n\n const visitedNodes = new Set<UnknownRecord>();\n const pendingNodes: unknown[] = [rootNode];\n\n while (pendingNodes.length > 0) {\n const currentNode = pendingNodes.pop();\n\n if (\n !isUnknownRecord(currentNode) ||\n setContainsValue(visitedNodes, currentNode)\n ) {\n continue;\n }\n\n visitedNodes.add(currentNode);\n\n if (\n currentNode[\"type\"] === \"TSTypeReference\" &&\n isTypeScriptEslintQualifiedTypeName(\n currentNode[\"typeName\"],\n namespaceNames\n )\n ) {\n return true;\n }\n\n if (isTypeScriptEslintQualifiedTypeName(currentNode, namespaceNames)) {\n return true;\n }\n\n for (const key in currentNode) {\n if (\n !objectHasOwn(currentNode, key) ||\n shouldSkipTraversalKey(key)\n ) {\n continue;\n }\n\n const value = currentNode[key];\n\n if (Array.isArray(value)) {\n for (const entry of value) {\n pendingNodes.push(entry);\n }\n continue;\n }\n\n if (isUnknownRecord(value)) {\n pendingNodes.push(value);\n }\n }\n }\n\n return false;\n};\n\nconst containsTypeScriptEslintTypeReferenceText = (\n text: string,\n namespaceNames: ReadonlySet<string>\n): boolean => {\n if (namespaceNames.size === 0) {\n return false;\n }\n\n let containsPotentialNamespaceTextReference = false;\n\n for (const namespaceName of namespaceNames) {\n let searchStartIndex = 0;\n\n while (searchStartIndex < text.length) {\n const namespaceIndex = text.indexOf(\n namespaceName,\n searchStartIndex\n );\n\n if (namespaceIndex === -1) {\n break;\n }\n\n const afterNamespaceIndex = namespaceIndex + namespaceName.length;\n\n if (\n isIdentifierBoundaryAt(text, namespaceIndex - 1) &&\n isIdentifierBoundaryAt(text, afterNamespaceIndex)\n ) {\n const nextTokenIndex = skipAsciiWhitespace(\n text,\n afterNamespaceIndex\n );\n\n if (text.at(nextTokenIndex) === \".\") {\n containsPotentialNamespaceTextReference = true;\n break;\n }\n }\n\n searchStartIndex = afterNamespaceIndex;\n }\n\n if (containsPotentialNamespaceTextReference) {\n break;\n }\n }\n\n if (!containsPotentialNamespaceTextReference) {\n return false;\n }\n\n const parsedProgram = parseDefinitionTextProgram(text);\n\n if (parsedProgram === null) {\n return false;\n }\n\n return containsTypeScriptEslintTypeReference(parsedProgram, namespaceNames);\n};\n\nconst createTypeScriptEslintNodeLikeExpressionByDefinitionChecker = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n namespaceNames: ReadonlySet<string>\n): ((expression: Readonly<TSESTree.Expression>) => boolean) => {\n const definitionNodeTextByNode = new WeakMap<\n Readonly<TSESTree.Node>,\n string\n >();\n\n const astNodeLikeByVariable = new WeakMap<\n Readonly<TSESLint.Scope.Variable>,\n boolean\n >();\n\n const sourceCode = context.sourceCode;\n\n const getDefinitionNodeText = (\n definitionNode: Readonly<TSESTree.Node>\n ): string => {\n const cachedText = definitionNodeTextByNode.get(definitionNode);\n if (isDefined(cachedText)) {\n return cachedText;\n }\n\n const definitionNodeText = sourceCode.getText(definitionNode);\n\n definitionNodeTextByNode.set(definitionNode, definitionNodeText);\n\n return definitionNodeText;\n };\n\n return (expression) => {\n if (namespaceNames.size === 0) {\n return false;\n }\n\n if (expression.type !== \"Identifier\") {\n return false;\n }\n\n const resolutionResult = safeTypeOperation({\n operation: () => {\n const currentScope = sourceCode.getScope(expression);\n const variable = getVariableInScopeChain(\n currentScope,\n expression.name\n );\n\n if (variable === null) {\n return false;\n }\n\n const cachedVariableResult =\n astNodeLikeByVariable.get(variable);\n\n if (isDefined(cachedVariableResult)) {\n return cachedVariableResult;\n }\n\n const visitedDefinitionNodes = new Set<TSESTree.Node>();\n const pendingDefinitionNodes: TSESTree.Node[] = [];\n\n const enqueueDefinitionNode = (\n node: null | Readonly<TSESTree.Node> | undefined\n ): void => {\n if (node === null || !isDefined(node)) {\n return;\n }\n\n if (setContainsValue(visitedDefinitionNodes, node)) {\n return;\n }\n\n pendingDefinitionNodes.push(node);\n };\n\n for (const definition of variable.defs) {\n enqueueDefinitionNode(definition.node);\n }\n\n let variableReferencesTypeScriptEslintNode = false;\n\n while (pendingDefinitionNodes.length > 0) {\n const definitionNode = pendingDefinitionNodes.pop();\n\n if (!isDefined(definitionNode)) {\n continue;\n }\n\n visitedDefinitionNodes.add(definitionNode);\n\n if (\n containsTypeScriptEslintTypeReference(\n definitionNode,\n namespaceNames\n )\n ) {\n variableReferencesTypeScriptEslintNode = true;\n break;\n }\n\n const definitionNodeText =\n getDefinitionNodeText(definitionNode);\n if (\n containsTypeScriptEslintTypeReferenceText(\n definitionNodeText,\n namespaceNames\n )\n ) {\n variableReferencesTypeScriptEslintNode = true;\n break;\n }\n\n if (\n definitionNode.type === \"VariableDeclarator\" &&\n definitionNode.init !== null &&\n definitionNode.init.type === \"MemberExpression\" &&\n definitionNode.init.object.type === \"Identifier\"\n ) {\n const { object } = definitionNode.init;\n const objectVariable = getVariableInScopeChain(\n currentScope,\n object.name\n );\n\n if (objectVariable === null) {\n continue;\n }\n\n const cachedObjectVariableResult =\n astNodeLikeByVariable.get(objectVariable);\n\n if (cachedObjectVariableResult === true) {\n variableReferencesTypeScriptEslintNode = true;\n break;\n }\n\n for (const objectDefinition of objectVariable.defs) {\n enqueueDefinitionNode(objectDefinition.node);\n }\n }\n }\n\n astNodeLikeByVariable.set(\n variable,\n variableReferencesTypeScriptEslintNode\n );\n\n return variableReferencesTypeScriptEslintNode;\n },\n reason: \"ts-eslint-node-autofix-definition-fallback-failed\",\n });\n\n if (!resolutionResult.ok) {\n return false;\n }\n\n return resolutionResult.value;\n };\n};\n\nconst collectNestedTypeArguments = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): readonly ts.Type[] => {\n const collectedTypes: ts.Type[] = [];\n\n const aliasTypeArguments = safeCastTo<\n Readonly<{\n aliasTypeArguments?: readonly ts.Type[];\n }>\n >(type).aliasTypeArguments;\n\n if (isDefined(aliasTypeArguments)) {\n for (const aliasTypeArgument of aliasTypeArguments) {\n collectedTypes.push(aliasTypeArgument);\n }\n }\n\n const checkerTypeArgumentsResult = safeTypeOperation({\n operation: () => getTypeCheckerTypeArguments(checker, type) ?? [],\n reason: \"ts-eslint-node-autofix-get-type-arguments-failed\",\n });\n\n if (checkerTypeArgumentsResult.ok) {\n for (const checkerTypeArgument of checkerTypeArgumentsResult.value) {\n collectedTypes.push(checkerTypeArgument);\n }\n }\n\n return collectedTypes;\n};\n\n/**\n * Determine whether a TypeScript type resolves to an `@typescript-eslint` AST\n * node type.\n *\n * @param checker - Type checker for symbol and declaration inspection.\n * @param type - Candidate type to inspect.\n *\n * @returns `true` when the candidate resolves to a `TSESTree` AST type.\n */\nexport const isTypeScriptEslintAstType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n const visitedTypes = new Set<ts.Type>();\n const pendingTypes: ts.Type[] = [safeCastTo<ts.Type>(type)];\n\n while (pendingTypes.length > 0) {\n const currentType = pendingTypes.pop();\n\n if (\n !isDefined(currentType) ||\n setContainsValue(visitedTypes, currentType)\n ) {\n continue;\n }\n\n visitedTypes.add(currentType);\n\n if (isTypeAnyType(currentType) || isTypeUnknownType(currentType)) {\n continue;\n }\n\n const symbol = currentType.aliasSymbol ?? currentType.getSymbol();\n\n if (isDefined(symbol)) {\n const declarations = symbol.getDeclarations() ?? [];\n\n const hasTypeScriptEslintDeclaration = declarations.some(\n (declaration) =>\n isTypeScriptEslintDeclarationPath(\n declaration.getSourceFile().fileName\n )\n );\n\n if (hasTypeScriptEslintDeclaration) {\n return true;\n }\n }\n\n if (currentType.isUnionOrIntersection()) {\n for (const typePart of currentType.types) {\n pendingTypes.push(typePart);\n }\n }\n\n const nestedTypeArguments = collectNestedTypeArguments(\n checker,\n currentType\n );\n if (nestedTypeArguments.length > 0) {\n for (const nestedTypeArgument of nestedTypeArguments) {\n pendingTypes.push(nestedTypeArgument);\n }\n }\n\n const apparentType = getTypeCheckerApparentType(checker, currentType);\n if (isDefined(apparentType) && apparentType !== currentType) {\n pendingTypes.push(apparentType);\n }\n\n const baseConstraintType = getTypeCheckerBaseConstraintType(\n checker,\n currentType\n );\n if (\n isDefined(baseConstraintType) &&\n baseConstraintType !== currentType\n ) {\n pendingTypes.push(baseConstraintType);\n }\n }\n\n return false;\n};\n\n/**\n * Build a predicate that skips rule reporting/fixing when the compared\n * expression resolves to an `@typescript-eslint` AST node.\n *\n * @param context - Rule context for typed parser services.\n * @param typedServices - Prevalidated typed services. Pass `null`/`undefined`\n * to run definition-only fallback logic with no checker calls.\n *\n * @returns Expression predicate that returns `true` when the current rule\n * should skip reporting/fixing for the expression.\n */\nexport const createTypeScriptEslintNodeExpressionSkipChecker = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>(\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n typedServices?: Readonly<TypedRuleServices>\n): ((expression: Readonly<TSESTree.Expression>) => boolean) => {\n const shouldSkipExpressionCache = new WeakMap<\n Readonly<TSESTree.Expression>,\n boolean\n >();\n\n const namespaceNames = getTypeScriptEslintNamespaceImportNames(\n context.sourceCode\n );\n\n const isTypeScriptEslintNodeLikeExpressionByDefinition =\n createTypeScriptEslintNodeLikeExpressionByDefinitionChecker(\n context,\n namespaceNames\n );\n const telemetryFilePath = context.physicalFilename;\n\n return (expression) => {\n const cachedResult = shouldSkipExpressionCache.get(expression);\n\n if (isDefined(cachedResult)) {\n return cachedResult;\n }\n\n const shouldSkipByDefinition =\n isTypeScriptEslintNodeLikeExpressionByDefinition(expression);\n\n recordTypedPathPrefilterEvaluation({\n filePath: telemetryFilePath,\n prefilterHit: shouldSkipByDefinition,\n });\n\n if (shouldSkipByDefinition) {\n shouldSkipExpressionCache.set(expression, true);\n\n return true;\n }\n\n if (!isDefined(typedServices)) {\n shouldSkipExpressionCache.set(expression, false);\n\n return false;\n }\n\n const { checker, parserServices } = typedServices;\n\n const isNodeTypedExpressionResult = safeTypeOperation({\n operation: () => {\n const expressionType = getConstrainedTypeAtLocationWithFallback(\n checker,\n expression,\n parserServices,\n \"ts-eslint-node-autofix-expression-type-resolution-failed\"\n );\n\n if (!isDefined(expressionType)) {\n return false;\n }\n\n return isTypeScriptEslintAstType(checker, expressionType);\n },\n reason: \"ts-eslint-node-autofix-expression-check-failed\",\n });\n\n if (\n isNodeTypedExpressionResult.ok &&\n isNodeTypedExpressionResult.value\n ) {\n shouldSkipExpressionCache.set(expression, true);\n\n return true;\n }\n\n shouldSkipExpressionCache.set(expression, false);\n\n return false;\n };\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-defined`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isWithinFilterCallback } from \"../_internal/filter-callback.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueArgumentFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { safeTypeOperation } from \"../_internal/safe-type-operation.js\";\nimport { getVariableInScopeChain } from \"../_internal/scope-variable.js\";\nimport { isTypePredicateExpressionAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport {\n createTypedRule,\n getTypedRuleServicesOrUndefined,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\nimport { createTypeScriptEslintNodeExpressionSkipChecker } from \"../_internal/typescript-eslint-node-autofix.js\";\n\n/** Concrete rule context type inferred from `createTypedRule`. */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Matched undefined-comparison metadata used to produce the replacement.\n */\ntype UndefinedComparisonMatch = {\n readonly comparedExpression: TSESTree.Expression;\n readonly prefersNegatedHelper: boolean;\n};\n\n/**\n * Narrow an expression to an Identifier with an expected name.\n */\nconst isIdentifierWithName = (\n expression: Readonly<TSESTree.Expression>,\n name: string\n): expression is TSESTree.Identifier =>\n expression.type === \"Identifier\" && expression.name === name;\n\n/**\n * Narrow an expression to a `typeof ...` unary expression.\n */\nconst isTypeofExpression = (\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.UnaryExpression & { argument: TSESTree.Expression } =>\n expression.type === \"UnaryExpression\" && expression.operator === \"typeof\";\n\n/**\n * Check whether an identifier expression resolves to a bound symbol in scope.\n *\n * @remarks\n * This prevents rewriting `typeof` checks where the identifier would be treated\n * as an unbound global reference.\n */\nconst isBoundIdentifierReference = (\n context: RuleContext,\n expression: Readonly<TSESTree.Expression>\n): boolean => {\n if (expression.type !== \"Identifier\") {\n return true;\n }\n\n const result = safeTypeOperation({\n operation: () => {\n const initialScope = context.sourceCode.getScope(expression);\n const variable = getVariableInScopeChain(\n initialScope,\n expression.name\n );\n\n return variable !== null && variable.defs.length > 0;\n },\n reason: \"is-defined-scope-resolution-failed\",\n });\n\n if (!result.ok) {\n return false;\n }\n\n return result.value;\n};\n\n/**\n * Narrow an expression to the string literal `\"undefined\"`.\n */\nconst isUndefinedStringLiteral = (\n expression: Readonly<TSESTree.Expression>\n): expression is TSESTree.Literal & { value: \"undefined\" } =>\n expression.type === \"Literal\" && expression.value === \"undefined\";\n\n/**\n * Determine whether an expression references the global `undefined` binding.\n *\n * @param context - Active rule context for scope resolution.\n * @param expression - Expression node to inspect.\n *\n * @returns `true` when the expression is an unshadowed `undefined` identifier.\n */\nconst isUndefinedIdentifier = (\n context: RuleContext,\n expression: Readonly<TSESTree.Expression>\n): boolean =>\n isIdentifierWithName(expression, \"undefined\") &&\n isGlobalUndefinedIdentifier(context, expression);\n\n/**\n * Match supported undefined-comparison patterns used by this rule.\n *\n * @param context - Active rule context for global-binding checks.\n * @param node - Binary expression to inspect.\n *\n * @returns Comparison metadata when the expression is supported; otherwise\n * `null`.\n */\nconst getUndefinedComparisonMatch = (\n context: RuleContext,\n node: Readonly<TSESTree.BinaryExpression>\n): null | UndefinedComparisonMatch => {\n const isPositiveComparison = node.operator === \"!==\";\n const isNegativeComparison = node.operator === \"===\";\n\n if (!isPositiveComparison && !isNegativeComparison) {\n return null;\n }\n\n const prefersNegatedHelper = isNegativeComparison;\n\n if (isUndefinedIdentifier(context, node.right)) {\n return {\n comparedExpression: node.left,\n prefersNegatedHelper,\n };\n }\n\n if (isUndefinedIdentifier(context, node.left)) {\n return {\n comparedExpression: node.right,\n prefersNegatedHelper,\n };\n }\n\n if (isTypeofExpression(node.left) && isUndefinedStringLiteral(node.right)) {\n if (!isBoundIdentifierReference(context, node.left.argument)) {\n return null;\n }\n\n return {\n comparedExpression: node.left.argument,\n prefersNegatedHelper,\n };\n }\n\n if (isTypeofExpression(node.right) && isUndefinedStringLiteral(node.left)) {\n if (!isBoundIdentifierReference(context, node.right.argument)) {\n return null;\n }\n\n return {\n comparedExpression: node.right.argument,\n prefersNegatedHelper,\n };\n }\n\n return null;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-defined`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsDefinedRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n const typedServices = getTypedRuleServicesOrUndefined(context);\n const shouldSkipComparedExpression =\n createTypeScriptEslintNodeExpressionSkipChecker(\n context,\n typedServices\n );\n\n return {\n BinaryExpression(node) {\n if (isWithinFilterCallback(node)) {\n return;\n }\n\n const match = getUndefinedComparisonMatch(context, node);\n if (!match) {\n return;\n }\n\n if (\n shouldSkipComparedExpression(match.comparedExpression)\n ) {\n return;\n }\n\n const canAutofix =\n isTypePredicateExpressionAutofixSafe(node);\n\n reportWithOptionalFix({\n context,\n fix: canAutofix\n ? createSafeValueArgumentFunctionCallFix({\n argumentNode: match.comparedExpression,\n context,\n importedName: \"isDefined\",\n imports: tsExtrasImports,\n negated: match.prefersNegatedHelper,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n })\n : null,\n messageId: match.prefersNegatedHelper\n ? \"preferTsExtrasIsDefinedNegated\"\n : \"preferTsExtrasIsDefined\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isDefined over inline undefined comparisons outside filter callbacks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-defined\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsDefined:\n \"Prefer `isDefined(value)` from `ts-extras` over inline undefined comparisons.\",\n preferTsExtrasIsDefinedNegated:\n \"Prefer `!isDefined(value)` from `ts-extras` over inline undefined comparisons.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-defined\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-defined` rule module.\n */\nexport default preferTsExtrasIsDefinedRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-empty`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { createIsArrayLikeExpressionChecker } from \"../_internal/array-like-expression.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueArgumentFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\nimport { createTypeScriptEslintNodeExpressionSkipChecker } from \"../_internal/typescript-eslint-node-autofix.js\";\n\n/**\n * Checks whether an expression is the numeric literal `0`.\n *\n * @param node - Expression node to inspect.\n *\n * @returns `true` when the node is a `Literal` whose value is `0`.\n */\n\nconst isZeroLiteral = (node: Readonly<TSESTree.Expression>): boolean =>\n node.type === \"Literal\" && node.value === 0;\n\n/**\n * Narrows expressions to direct `.length` member access.\n *\n * @param node - Expression node to inspect.\n *\n * @returns `true` when the node is a non-computed member expression whose\n * property identifier is `length`.\n */\n\nconst isLengthMemberExpression = (\n node: Readonly<TSESTree.Expression>\n): node is TSESTree.MemberExpression & { property: TSESTree.Identifier } =>\n node.type === \"MemberExpression\" &&\n !node.computed &&\n node.property.type === \"Identifier\" &&\n node.property.name === \"length\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-empty`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsEmptyRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const isArrayLikeExpression = createIsArrayLikeExpressionChecker({\n checker,\n parserServices,\n telemetryFilePath: context.physicalFilename,\n unionMatchMode: \"every\",\n });\n const shouldSkipComparedExpression =\n createTypeScriptEslintNodeExpressionSkipChecker(context, {\n checker,\n parserServices,\n });\n\n return {\n BinaryExpression(node) {\n if (node.operator !== \"==\" && node.operator !== \"===\") {\n return;\n }\n\n const isLeftLengthCheck =\n isLengthMemberExpression(node.left) &&\n isZeroLiteral(node.right);\n const isRightLengthCheck =\n isLengthMemberExpression(node.right) &&\n isZeroLiteral(node.left);\n\n if (!isLeftLengthCheck && !isRightLengthCheck) {\n return;\n }\n\n const lengthNode = isLeftLengthCheck\n ? node.left\n : node.right;\n\n if (!isLengthMemberExpression(lengthNode)) {\n return;\n }\n\n if (!isArrayLikeExpression(lengthNode.object)) {\n return;\n }\n\n if (shouldSkipComparedExpression(lengthNode.object)) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: createSafeValueArgumentFunctionCallFix({\n argumentNode: lengthNode.object,\n context,\n importedName: \"isEmpty\",\n imports: tsExtrasImports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n }),\n messageId: \"preferTsExtrasIsEmpty\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isEmpty over direct array.length === 0 checks for consistent emptiness guards.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.recommended-type-checked\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-empty\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsEmpty:\n \"Prefer `isEmpty` from `ts-extras` over direct `array.length === 0` checks.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-empty\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-empty` rule module.\n */\nexport default preferTsExtrasIsEmptyRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-equal-type`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport {\n collectNamedImportLocalNamesFromSource,\n collectNamespaceImportLocalNamesFromSource,\n} from \"../_internal/imported-type-aliases.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport {\n TS_EXTRAS_MODULE_SOURCE,\n TYPE_FEST_MODULE_SOURCE,\n} from \"../_internal/module-source.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n} from \"../_internal/rule-reporting.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst IS_EQUAL_TYPE_NAME = \"IsEqual\";\nconst IS_EQUAL_TYPE_FUNCTION_NAME = \"isEqualType\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-equal-type`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsEqualTypeRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const isEqualLocalNames = collectNamedImportLocalNamesFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE,\n IS_EQUAL_TYPE_NAME\n );\n const typeFestNamespaceImportNames =\n collectNamespaceImportLocalNamesFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n /**\n * Resolve `IsEqual<...>` type references from direct or namespace\n * imports.\n */\n const getIsEqualTypeReference = (\n node: Readonly<TSESTree.TypeNode>\n ): null | TSESTree.TSTypeReference => {\n if (node.type !== \"TSTypeReference\") {\n return null;\n }\n\n if (node.typeName.type === \"Identifier\") {\n return setContainsValue(\n isEqualLocalNames,\n node.typeName.name\n )\n ? node\n : null;\n }\n\n if (node.typeName.type !== \"TSQualifiedName\") {\n return null;\n }\n\n if (\n node.typeName.left.type === \"Identifier\" &&\n setContainsValue(\n typeFestNamespaceImportNames,\n node.typeName.left.name\n ) &&\n node.typeName.right.type === \"Identifier\" &&\n node.typeName.right.name === IS_EQUAL_TYPE_NAME\n ) {\n return node;\n }\n\n return null;\n };\n\n return {\n VariableDeclarator(node) {\n if (\n node.id.type !== \"Identifier\" ||\n !isDefined(node.id.typeAnnotation?.typeAnnotation) ||\n node.init?.type !== \"Literal\" ||\n typeof node.init.value !== \"boolean\"\n ) {\n return;\n }\n\n const isEqualTypeReference = getIsEqualTypeReference(\n node.id.typeAnnotation.typeAnnotation\n );\n\n if (!isEqualTypeReference) {\n return;\n }\n\n const typeArguments =\n isEqualTypeReference.typeArguments?.params ?? [];\n const identifierName = node.id.name;\n const initializerValue = node.init.value;\n const [leftType, rightType] = typeArguments;\n\n if (leftType === undefined || rightType === undefined) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasIsEqualType\",\n node,\n });\n\n return;\n }\n\n const leftTypeText = context.sourceCode.getText(leftType);\n const rightTypeText = context.sourceCode.getText(rightType);\n const isEqualTypeSuggestionFix =\n createSafeValueNodeTextReplacementFix({\n context,\n importedName: IS_EQUAL_TYPE_FUNCTION_NAME,\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) => {\n const callText = `${replacementName}<${leftTypeText}, ${rightTypeText}>()`;\n const runtimePreservingExpression =\n initializerValue\n ? `${callText} || true`\n : `${callText} && false`;\n\n return `${identifierName} = ${runtimePreservingExpression}`;\n },\n reportFixIntent: \"suggestion\",\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n\n if (\n typeArguments.length !== 2 ||\n isEqualTypeSuggestionFix === null\n ) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasIsEqualType\",\n node,\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasIsEqualType\",\n node,\n suggest: [\n {\n fix: isEqualTypeSuggestionFix,\n messageId: \"suggestTsExtrasIsEqualType\",\n },\n ],\n },\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isEqualType over IsEqual<T, U> boolean assertion variables.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: \"typefest.configs.all\",\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-equal-type\",\n },\n hasSuggestions: true,\n messages: {\n preferTsExtrasIsEqualType:\n \"Prefer `isEqualType<T, U>()` from `ts-extras` over `IsEqual<T, U>` boolean assertion variables.\",\n suggestTsExtrasIsEqualType:\n \"Replace this boolean `IsEqual<...>` assertion variable with `isEqualType<...>()`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-equal-type\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-equal-type` rule module.\n */\nexport default preferTsExtrasIsEqualTypeRule;\n", "/**\n * @packageDocumentation\n * Helpers for matching static member calls that resolve to global bindings.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport {\n getIdentifierMemberCall,\n type IdentifierMemberCallExpression,\n} from \"./member-call.js\";\nimport { isGlobalIdentifierNamed } from \"./typed-rule.js\";\n\n/**\n * Match `GlobalName.memberName(...)` calls where `GlobalName` resolves to the\n * unshadowed global binding.\n *\n * @param options - Rule context and candidate call details.\n *\n * @returns Narrowed call expression when matched against the global binding;\n * otherwise `null`.\n */\nexport const getGlobalIdentifierMemberCall = <\n MessageIds extends string,\n Options extends Readonly<UnknownArray>,\n>({\n context,\n memberName,\n node,\n objectName,\n}: Readonly<{\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>;\n memberName: string;\n node: Readonly<TSESTree.CallExpression>;\n objectName: string;\n}>): IdentifierMemberCallExpression | null => {\n const memberCall = getIdentifierMemberCall({\n memberName,\n node,\n objectName,\n });\n\n if (memberCall === null) {\n return null;\n }\n\n return isGlobalIdentifierNamed(\n context,\n memberCall.callee.object,\n objectName\n )\n ? memberCall\n : null;\n};\n", "/**\n * @packageDocumentation\n * Shared reporting helper for ts-extras global static member-call replacement\n * rules.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { getGlobalIdentifierMemberCall } from \"./global-identifier-member-call.js\";\nimport {\n createSafeValueReferenceReplacementFix,\n type ImportedValueAliasMap,\n} from \"./imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"./module-source.js\";\nimport {\n reportResolvedAutofixOrSuggestionOutcome,\n resolveAutofixOrSuggestionOutcome,\n} from \"./rule-reporting.js\";\n\n/** Direct named value imports collection type from shared import helper. */\ntype DirectNamedValueImports = ImportedValueAliasMap;\n\n/** Typed rule context shape for global-member call rules. */\ntype GlobalMemberRuleContext<MessageId extends string> = Readonly<\n TSESLint.RuleContext<MessageId, Readonly<UnknownArray>>\n>;\n\n/**\n * Match `GlobalName.memberName(...)` calls that resolve to unshadowed globals\n * and report a standardized ts-extras replacement.\n */\nexport const reportTsExtrasGlobalMemberCall = <MessageId extends string>({\n canAutofix,\n context,\n importedName,\n imports,\n memberName,\n messageId,\n minimumArgumentCount,\n node,\n objectName,\n reportSuggestion,\n suggestionMessageId,\n}: Readonly<{\n canAutofix?: (node: Readonly<TSESTree.CallExpression>) => boolean;\n context: GlobalMemberRuleContext<MessageId>;\n importedName: string;\n imports: DirectNamedValueImports;\n memberName: string;\n messageId: MessageId;\n minimumArgumentCount?: number;\n node: Readonly<TSESTree.CallExpression>;\n objectName: string;\n reportSuggestion?: (\n input: Readonly<{\n fix: TSESLint.ReportFixFunction;\n messageId: MessageId;\n node: Readonly<TSESTree.CallExpression>;\n suggestionMessageId: MessageId;\n }>\n ) => void;\n suggestionMessageId?: MessageId;\n}>): void => {\n const globalMemberCall = getGlobalIdentifierMemberCall({\n context,\n memberName,\n node,\n objectName,\n });\n\n if (globalMemberCall === null) {\n return;\n }\n\n if (\n typeof minimumArgumentCount === \"number\" &&\n node.arguments.length < minimumArgumentCount\n ) {\n return;\n }\n\n const shouldAutofix = canAutofix?.(node) ?? true;\n const fix = createSafeValueReferenceReplacementFix({\n context,\n importedName,\n imports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: globalMemberCall.callee,\n });\n\n const outcome = resolveAutofixOrSuggestionOutcome({\n canAutofix: shouldAutofix,\n fix,\n });\n\n if (outcome.kind === \"suggestion\" && reportSuggestion !== undefined) {\n reportSuggestion({\n fix: outcome.fix,\n messageId,\n node,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n\n return;\n }\n\n reportResolvedAutofixOrSuggestionOutcome({\n context,\n messageId,\n node,\n outcome,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-finite`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-finite`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsFiniteRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Number\"][callee.property.type=\"Identifier\"][callee.property.name=\"isFinite\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"isFinite\",\n imports: tsExtrasImports,\n memberName: \"isFinite\",\n messageId: \"preferTsExtrasIsFinite\",\n node,\n objectName: \"Number\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isFinite over Number.isFinite for consistent predicate helper usage.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-finite\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsFinite:\n \"Prefer `isFinite` from `ts-extras` over `Number.isFinite(...)`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-finite\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-finite` rule module.\n */\nexport default preferTsExtrasIsFiniteRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-infinite`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueArgumentFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentExpressions } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n getTypedRuleServicesOrUndefined,\n isGlobalIdentifierNamed,\n} from \"../_internal/typed-rule.js\";\nimport { createTypeScriptEslintNodeExpressionSkipChecker } from \"../_internal/typescript-eslint-node-autofix.js\";\n\n/**\n * Parsed infinity comparison extracted from a binary expression.\n */\ntype InfinityComparison = Readonly<{\n comparedExpression: TSESTree.Expression;\n kind: InfinityKind;\n operator: \"==\" | \"===\";\n}>;\n\n/**\n * Infinity polarity represented by a reference expression.\n */\ntype InfinityKind = \"negative\" | \"positive\";\n\n/**\n * Concrete rule context type derived from `createTypedRule`.\n */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Classifies an expression as positive or negative infinity.\n *\n * @param context - Rule context used to validate global `Infinity`/`Number`\n * bindings.\n * @param node - Expression to inspect.\n *\n * @returns The infinity kind when the expression is a supported infinity\n * reference; otherwise `null`.\n */\nconst extractInfinityKind = (\n context: RuleContext,\n node: Readonly<TSESTree.Expression>\n): InfinityKind | null => {\n if (isGlobalIdentifierNamed(context, node, \"Infinity\")) {\n return \"positive\";\n }\n\n if (\n node.type !== \"MemberExpression\" ||\n node.computed ||\n node.object.type !== \"Identifier\" ||\n node.object.name !== \"Number\" ||\n !isGlobalIdentifierNamed(context, node.object, \"Number\") ||\n node.property.type !== \"Identifier\"\n ) {\n return null;\n }\n\n if (node.property.name === \"POSITIVE_INFINITY\") {\n return \"positive\";\n }\n\n if (node.property.name === \"NEGATIVE_INFINITY\") {\n return \"negative\";\n }\n\n return null;\n};\n\n/**\n * Extracts a comparison where exactly one side references infinity.\n *\n * @param context - Rule context used to resolve global identifiers.\n * @param expression - Expression candidate.\n *\n * @returns Normalized comparison data when the expression matches value ===\n * Infinity style checks; otherwise null.\n */\nconst extractInfinityComparison = (\n context: RuleContext,\n expression: Readonly<TSESTree.Expression>\n): InfinityComparison | null => {\n if (\n expression.type !== \"BinaryExpression\" ||\n (expression.operator !== \"==\" && expression.operator !== \"===\")\n ) {\n return null;\n }\n\n const leftKind = extractInfinityKind(context, expression.left);\n const rightKind = extractInfinityKind(context, expression.right);\n\n if (leftKind && !rightKind) {\n return {\n comparedExpression: expression.right,\n kind: leftKind,\n operator: expression.operator,\n };\n }\n\n if (!leftKind && rightKind) {\n return {\n comparedExpression: expression.left,\n kind: rightKind,\n operator: expression.operator,\n };\n }\n\n return null;\n};\n\n/**\n * Extracts the shared target from strict disjunction checks against both\n * positive and negative infinity.\n *\n * @param context - Rule context used during infinity comparison extraction.\n * @param node - Logical expression candidate.\n *\n * @returns The compared expression from value === Infinity || value ===\n * Number.NEGATIVE_INFINITY style patterns; otherwise null.\n */\nconst extractSafeInfinityDisjunctionTarget = (\n context: RuleContext,\n node: Readonly<TSESTree.LogicalExpression>\n): null | TSESTree.Expression => {\n if (node.operator !== \"||\") {\n return null;\n }\n\n const left = extractInfinityComparison(context, node.left);\n const right = extractInfinityComparison(context, node.right);\n\n if (!left || !right) {\n return null;\n }\n\n if (left.operator !== \"===\" || right.operator !== \"===\") {\n return null;\n }\n\n if (left.kind === right.kind) {\n return null;\n }\n\n return areEquivalentExpressions(\n left.comparedExpression,\n right.comparedExpression\n )\n ? left.comparedExpression\n : null;\n};\n\n/** Rule module definition for `prefer-ts-extras-is-infinite`. */\nconst preferTsExtrasIsInfiniteRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n const typedServices = getTypedRuleServicesOrUndefined(context);\n const shouldSkipComparedExpression =\n createTypeScriptEslintNodeExpressionSkipChecker(\n context,\n typedServices\n );\n\n return {\n BinaryExpression(node) {\n const parent = node.parent;\n if (\n parent?.type === \"LogicalExpression\" &&\n extractSafeInfinityDisjunctionTarget(context, parent)\n ) {\n return;\n }\n\n if (node.operator !== \"==\" && node.operator !== \"===\") {\n return;\n }\n\n if (\n extractInfinityKind(context, node.left) === null &&\n extractInfinityKind(context, node.right) === null\n ) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasIsInfinite\",\n node,\n });\n },\n LogicalExpression(node) {\n const comparedExpression =\n extractSafeInfinityDisjunctionTarget(context, node);\n\n if (!comparedExpression) {\n return;\n }\n\n if (shouldSkipComparedExpression(comparedExpression)) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: createSafeValueArgumentFunctionCallFix({\n argumentNode: comparedExpression,\n context,\n importedName: \"isInfinite\",\n imports: tsExtrasImports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n }),\n messageId: \"preferTsExtrasIsInfinite\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isInfinite over direct Infinity equality checks for consistent predicate helper usage.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-infinite\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsInfinite:\n \"Prefer `isInfinite` from `ts-extras` over direct Infinity equality checks.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-infinite\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-infinite` rule module.\n */\nexport default preferTsExtrasIsInfiniteRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-integer`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-integer`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsIntegerRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Number\"][callee.property.type=\"Identifier\"][callee.property.name=\"isInteger\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"isInteger\",\n imports: tsExtrasImports,\n memberName: \"isInteger\",\n messageId: \"preferTsExtrasIsInteger\",\n node,\n objectName: \"Number\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isInteger over Number.isInteger for consistent predicate helper usage.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-integer\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsInteger:\n \"Prefer `isInteger` from `ts-extras` over `Number.isInteger(...)`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-integer\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-integer` rule module.\n */\nexport default preferTsExtrasIsIntegerRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-present-filter`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getSingleParameterExpressionArrowFilterCallback } from \"../_internal/filter-callback.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueReferenceReplacementFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentExpressions } from \"../_internal/normalize-expression-text.js\";\nimport {\n flattenLogicalTerms,\n getNullishComparison,\n isExpressionPair,\n} from \"../_internal/nullish-comparison.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport {\n createTypedRule,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * Normalized metadata for one nullish inequality comparison part.\n */\ntype NullishInequalityPart = {\n readonly expression: TSESTree.Expression;\n readonly kind: \"null\" | \"undefined\";\n readonly operator: \"!=\" | \"!==\";\n};\n\n/** Concrete rule context type inferred from `createTypedRule`. */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\nconst nullishInequalityOperators = [\"!=\", \"!==\"] as const;\n\n/**\n * Extract one nullish inequality comparison part from an expression.\n *\n * @param context - Active rule context for global-binding checks.\n * @param expression - Expression to inspect.\n * @param parameterName - Callback parameter name.\n *\n * @returns Comparison metadata when matched; otherwise `null`.\n */\nconst extractNullishInequalityPart = (\n context: RuleContext,\n expression: Readonly<TSESTree.Expression>,\n parameterName: string\n): null | NullishInequalityPart => {\n const comparison = getNullishComparison({\n allowedOperators: nullishInequalityOperators,\n allowTypeofComparedIdentifierForUndefined: true,\n comparedIdentifierName: parameterName,\n expression,\n isGlobalUndefinedIdentifier: (candidateExpression) =>\n isGlobalUndefinedIdentifier(context, candidateExpression),\n });\n\n if (!comparison) {\n return null;\n }\n\n if (comparison.operator !== \"!=\" && comparison.operator !== \"!==\") {\n return null;\n }\n\n return {\n expression: comparison.comparedExpression,\n kind: comparison.kind,\n operator: comparison.operator,\n };\n};\n\n/**\n * Check whether an expression contains a supported null-inequality comparison\n * part for the callback parameter.\n *\n * @param context - Active rule context for global-binding checks.\n * @param node - Expression to inspect.\n * @param parameterName - Callback parameter name.\n *\n * @returns `true` when the expression represents a null comparison.\n */\nconst isNullComparison = (\n context: RuleContext,\n node: Readonly<TSESTree.Expression>,\n parameterName: string\n): node is TSESTree.BinaryExpression => {\n const comparison = extractNullishInequalityPart(\n context,\n node,\n parameterName\n );\n\n return comparison?.kind === \"null\";\n};\n\n/**\n * Check whether an expression contains a supported undefined-inequality\n * comparison part for the callback parameter.\n *\n * @param context - Active rule context for global-binding checks.\n * @param node - Expression to inspect.\n * @param parameterName - Callback parameter name.\n *\n * @returns `true` when the expression represents an undefined comparison.\n */\nconst isUndefinedComparison = (\n context: RuleContext,\n node: Readonly<TSESTree.Expression>,\n parameterName: string\n): node is TSESTree.BinaryExpression => {\n const comparison = extractNullishInequalityPart(\n context,\n node,\n parameterName\n );\n\n return comparison?.kind === \"undefined\";\n};\n\n/**\n * Check whether a filter callback body is a supported nullish guard pattern.\n *\n * @param context - Active rule context for global-binding checks.\n * @param callback - Arrow callback to inspect.\n * @param parameterName - Callback parameter name.\n *\n * @returns `true` when the callback can be replaced by `isPresent` (with\n * possible suggestion fallback based on strictness of operators).\n */\nconst isNullishFilterGuardBody = (\n context: RuleContext,\n callback: Readonly<\n TSESTree.ArrowFunctionExpression & { body: TSESTree.Expression }\n >,\n parameterName: string\n): boolean => {\n const { body } = callback;\n\n if (\n isNullComparison(context, body, parameterName) ||\n isUndefinedComparison(context, body, parameterName)\n ) {\n if (body.operator === \"!=\") {\n return true;\n }\n\n return callback.returnType?.typeAnnotation.type === \"TSTypePredicate\";\n }\n\n const andTerms = flattenLogicalTerms({\n expression: body,\n operator: \"&&\",\n });\n\n let hasNullComparison = false;\n let hasUndefinedComparison = false;\n\n for (const term of andTerms) {\n const comparison = extractNullishInequalityPart(\n context,\n term,\n parameterName\n );\n\n if (comparison) {\n if (comparison.kind === \"null\") {\n hasNullComparison = true;\n }\n\n if (comparison.kind === \"undefined\") {\n hasUndefinedComparison = true;\n }\n\n if (hasNullComparison && hasUndefinedComparison) {\n return true;\n }\n }\n }\n\n return hasNullComparison && hasUndefinedComparison;\n};\n\n/**\n * Check whether the callback is safe to auto-fix directly to `isPresent`.\n *\n * @param callback - Arrow callback to inspect.\n * @param context - Active rule context for global-binding checks.\n * @param parameterName - Callback parameter name.\n *\n * @returns `true` when the callback is safely auto-fixable; otherwise `false`.\n */\nconst isSafePresentFilterAutoFixableCallback = ({\n callback,\n context,\n parameterName,\n}: Readonly<{\n callback: TSESTree.ArrowFunctionExpression & { body: TSESTree.Expression };\n context: RuleContext;\n parameterName: string;\n}>): boolean => {\n const { body } = callback;\n\n const singlePart = extractNullishInequalityPart(\n context,\n body,\n parameterName\n );\n if (singlePart?.operator === \"!=\") {\n return true;\n }\n\n if (body.type !== \"LogicalExpression\") {\n return false;\n }\n\n /* v8 ignore start */\n if (body.operator !== \"&&\") {\n return false;\n }\n /* v8 ignore stop */\n\n const andTerms = flattenLogicalTerms({\n expression: body,\n operator: \"&&\",\n });\n if (!isExpressionPair(andTerms)) {\n return false;\n }\n\n const [firstTerm, secondTerm] = andTerms;\n\n const first = extractNullishInequalityPart(\n context,\n firstTerm,\n parameterName\n );\n const second = extractNullishInequalityPart(\n context,\n secondTerm,\n parameterName\n );\n\n if (first?.operator !== \"!==\" || second?.operator !== \"!==\") {\n return false;\n }\n\n return areEquivalentExpressions(first.expression, second.expression);\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-present-filter`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsPresentFilterRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.property.type=\"Identifier\"][callee.property.name=\"filter\"]'(\n node\n ) {\n const callbackMatch =\n getSingleParameterExpressionArrowFilterCallback(node);\n if (!callbackMatch) {\n return;\n }\n\n const { callback: expressionCallback, parameter } =\n callbackMatch;\n\n if (\n !isNullishFilterGuardBody(\n context,\n expressionCallback,\n parameter.name\n )\n ) {\n return;\n }\n\n const isAutoFixable =\n isSafePresentFilterAutoFixableCallback({\n callback: expressionCallback,\n context,\n parameterName: parameter.name,\n });\n\n reportWithOptionalFix({\n context,\n fix: isAutoFixable\n ? createSafeValueReferenceReplacementFix({\n context,\n importedName: \"isPresent\",\n imports: tsExtrasImports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: expressionCallback,\n })\n : null,\n messageId: \"preferTsExtrasIsPresentFilter\",\n node: expressionCallback,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isPresent in Array.filter callbacks instead of inline nullish checks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-present-filter\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsPresentFilter:\n \"Prefer `isPresent` from `ts-extras` in `filter(...)` callbacks over inline nullish comparisons.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-present-filter\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-present-filter` rule module.\n */\nexport default preferTsExtrasIsPresentFilterRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-present`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isWithinFilterCallback } from \"../_internal/filter-callback.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueArgumentFunctionCallFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentExpressions } from \"../_internal/normalize-expression-text.js\";\nimport {\n flattenLogicalTerms,\n getNullishComparison as getSharedNullishComparison,\n isExpressionPair,\n} from \"../_internal/nullish-comparison.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isTypePredicateExpressionAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport {\n createTypedRule,\n getTypedRuleServicesOrUndefined,\n isGlobalUndefinedIdentifier,\n} from \"../_internal/typed-rule.js\";\nimport { createTypeScriptEslintNodeExpressionSkipChecker } from \"../_internal/typescript-eslint-node-autofix.js\";\n\n/**\n * Concrete rule context type derived from `createTypedRule`.\n */\ntype RuleContext = Readonly<\n Parameters<ReturnType<typeof createTypedRule>[\"create\"]>[0]\n>;\n\n/**\n * Adapter for shared nullish comparison parsing with this rule's context.\n */\nconst getRuleNullishComparison = (\n context: RuleContext,\n expression: Readonly<TSESTree.Expression>\n): ReturnType<typeof getSharedNullishComparison> =>\n getSharedNullishComparison({\n expression,\n isGlobalUndefinedIdentifier: (candidateExpression) =>\n isGlobalUndefinedIdentifier(context, candidateExpression),\n });\n\n/**\n * Checks whether two expressions are syntactically equivalent targets.\n *\n * @param options - Pair of expressions to compare.\n *\n * @returns `true` when both expressions resolve to the same normalized text.\n */\n\nconst haveSameComparedExpression = ({\n first,\n second,\n}: Readonly<{\n first: TSESTree.Expression;\n second: TSESTree.Expression;\n}>): boolean => areEquivalentExpressions(first, second);\n\n/**\n * Detects the strict two-term present check pattern: value !== null && value\n * !== undefined.\n *\n * @param options - Context plus logical expression to inspect.\n *\n * @returns `true` when the logical expression is a strict present check.\n */\n\nconst isStrictPresentCheck = ({\n context,\n expression,\n}: Readonly<{\n context: RuleContext;\n expression: TSESTree.LogicalExpression;\n}>): boolean => {\n if (expression.operator !== \"&&\") {\n return false;\n }\n\n const terms = flattenLogicalTerms({\n expression,\n operator: \"&&\",\n });\n\n if (!isExpressionPair(terms)) {\n return false;\n }\n\n const [firstTerm, secondTerm] = terms;\n\n const first = getRuleNullishComparison(context, firstTerm);\n const second = getRuleNullishComparison(context, secondTerm);\n\n if (!first || !second) {\n return false;\n }\n\n if (first.operator !== \"!==\" || second.operator !== \"!==\") {\n return false;\n }\n\n if (first.kind === second.kind) {\n return false;\n }\n\n return haveSameComparedExpression({\n first: first.comparedExpression,\n second: second.comparedExpression,\n });\n};\n\n/**\n * Detects the strict two-term absent check pattern: value === null || value ===\n * undefined.\n *\n * @param options - Context plus logical expression to inspect.\n *\n * @returns `true` when the logical expression is a strict absent check.\n */\n\nconst isStrictAbsentCheck = ({\n context,\n expression,\n}: Readonly<{\n context: RuleContext;\n expression: TSESTree.LogicalExpression;\n}>): boolean => {\n if (expression.operator !== \"||\") {\n return false;\n }\n\n const terms = flattenLogicalTerms({\n expression,\n operator: \"||\",\n });\n\n if (!isExpressionPair(terms)) {\n return false;\n }\n\n const [firstTerm, secondTerm] = terms;\n\n const first = getRuleNullishComparison(context, firstTerm);\n const second = getRuleNullishComparison(context, secondTerm);\n\n if (!first || !second) {\n return false;\n }\n\n if (first.operator !== \"===\" || second.operator !== \"===\") {\n return false;\n }\n\n if (first.kind === second.kind) {\n return false;\n }\n\n return haveSameComparedExpression({\n first: first.comparedExpression,\n second: second.comparedExpression,\n });\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-present`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsPresentRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n const typedServices = getTypedRuleServicesOrUndefined(context);\n const shouldSkipComparedExpression =\n createTypeScriptEslintNodeExpressionSkipChecker(\n context,\n typedServices\n );\n\n return {\n BinaryExpression(node) {\n if (isWithinFilterCallback(node)) {\n return;\n }\n\n const comparison = getRuleNullishComparison(context, node);\n if (comparison?.kind !== \"null\") {\n return;\n }\n\n if (\n shouldSkipComparedExpression(\n comparison.comparedExpression\n )\n ) {\n return;\n }\n\n const canAutofix =\n isTypePredicateExpressionAutofixSafe(node);\n\n if (comparison.operator === \"!=\") {\n reportWithOptionalFix({\n context,\n fix: canAutofix\n ? createSafeValueArgumentFunctionCallFix({\n argumentNode:\n comparison.comparedExpression,\n context,\n importedName: \"isPresent\",\n imports: tsExtrasImports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n })\n : null,\n messageId: \"preferTsExtrasIsPresent\",\n node,\n });\n }\n\n if (comparison.operator === \"==\") {\n reportWithOptionalFix({\n context,\n fix: canAutofix\n ? createSafeValueArgumentFunctionCallFix({\n argumentNode:\n comparison.comparedExpression,\n context,\n importedName: \"isPresent\",\n imports: tsExtrasImports,\n negated: true,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n })\n : null,\n messageId: \"preferTsExtrasIsPresentNegated\",\n node,\n });\n }\n },\n LogicalExpression(node) {\n if (isWithinFilterCallback(node)) {\n return;\n }\n\n if (\n isStrictPresentCheck({\n context,\n expression: node,\n })\n ) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasIsPresent\",\n node,\n });\n return;\n }\n\n if (\n isStrictAbsentCheck({\n context,\n expression: node,\n })\n ) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferTsExtrasIsPresentNegated\",\n node,\n });\n }\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isPresent over inline nullish comparisons outside filter callbacks.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-present\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsPresent:\n \"Prefer `isPresent(value)` from `ts-extras` over inline nullish comparisons.\",\n preferTsExtrasIsPresentNegated:\n \"Prefer `!isPresent(value)` from `ts-extras` over inline nullish comparisons.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-present\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-present` rule module.\n */\nexport default preferTsExtrasIsPresentRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-is-safe-integer`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-is-safe-integer`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasIsSafeIntegerRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Number\"][callee.property.type=\"Identifier\"][callee.property.name=\"isSafeInteger\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"isSafeInteger\",\n imports: tsExtrasImports,\n memberName: \"isSafeInteger\",\n messageId: \"preferTsExtrasIsSafeInteger\",\n node,\n objectName: \"Number\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras isSafeInteger over Number.isSafeInteger for consistent predicate helper usage.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-is-safe-integer\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasIsSafeInteger:\n \"Prefer `isSafeInteger` from `ts-extras` over `Number.isSafeInteger(...)`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-is-safe-integer\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-is-safe-integer` rule module.\n */\nexport default preferTsExtrasIsSafeIntegerRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-key-in`.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { safeTypeOperation } from \"../_internal/safe-type-operation.js\";\nimport { getVariableInScopeChain } from \"../_internal/scope-variable.js\";\nimport { isTypePredicateExpressionAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Determine whether a key expression can be safely reordered into `keyIn(...)`\n * argument position without changing side-effect semantics.\n */\nconst isAutofixSafeKeyExpression = (\n context: Readonly<TSESLint.RuleContext<string, readonly []>>,\n node: Readonly<TSESTree.Expression | TSESTree.PrivateIdentifier>\n): node is TSESTree.Expression => {\n if (node.type === \"PrivateIdentifier\") {\n return false;\n }\n\n if (node.type === \"Identifier\") {\n const scopeResolutionResult = safeTypeOperation({\n operation: () => {\n const sourceScope = context.sourceCode.getScope(node);\n\n return getVariableInScopeChain(sourceScope, node.name) !== null;\n },\n reason: \"key-in-autofix-key-scope-resolution-failed\",\n });\n\n if (!scopeResolutionResult.ok) {\n return false;\n }\n\n return scopeResolutionResult.value;\n }\n\n if (node.type === \"Literal\") {\n return true;\n }\n\n if (node.type === \"TemplateLiteral\") {\n return node.expressions.length === 0;\n }\n\n if (\n node.type === \"TSAsExpression\" ||\n node.type === \"TSNonNullExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"TSTypeAssertion\"\n ) {\n return isAutofixSafeKeyExpression(context, node.expression);\n }\n\n return false;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-key-in`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasKeyInRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n /**\n * Build a safe fixer that rewrites `key in object` to\n * `keyIn(object, key)` when key/object operand ordering is safe.\n */\n const createKeyInFix = (\n node: Readonly<TSESTree.BinaryExpression>\n ): null | TSESLint.ReportFixFunction => {\n if (\n !isTypePredicateExpressionAutofixSafe(node) ||\n !isAutofixSafeKeyExpression(context, node.left)\n ) {\n return null;\n }\n\n const keyText = getFunctionCallArgumentText({\n argumentNode: node.left,\n sourceCode: context.sourceCode,\n });\n const objectText = getFunctionCallArgumentText({\n argumentNode: node.right,\n sourceCode: context.sourceCode,\n });\n\n if (keyText === null || objectText === null) {\n return null;\n }\n\n return createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"keyIn\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${objectText}, ${keyText})`,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n };\n\n return {\n BinaryExpression(node) {\n if (node.operator !== \"in\") {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: createKeyInFix(node),\n messageId: \"preferTsExtrasKeyIn\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras keyIn over `in` key checks for stronger narrowing.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-key-in\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasKeyIn:\n \"Prefer `keyIn` from `ts-extras` over `key in object` checks for stronger narrowing.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-key-in\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-key-in` rule module.\n */\nexport default preferTsExtrasKeyInRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-not`.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { getFilterCallbackFunctionArgument } from \"../_internal/filter-callback.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Checks whether a call argument refers to the callback parameter identifier.\n *\n * @param argument - Predicate call argument candidate.\n * @param parameterName - Callback parameter name expected by the rule.\n *\n * @returns `true` when the argument is the same identifier as the callback's\n * sole parameter.\n */\n\nconst isTargetCallbackParameter = (\n argument: Readonly<TSESTree.CallExpressionArgument>,\n parameterName: string\n): boolean => argument.type === \"Identifier\" && argument.name === parameterName;\n\n/**\n * Extracts predicate calls from callbacks that negate a predicate call applied\n * to the callback parameter.\n *\n * @param callback - Filter callback candidate.\n *\n * @returns The inner predicate call when callback structure is compatible with\n * `not(predicate)` replacement; otherwise `null`.\n */\n\nconst getNegatedPredicateCall = (\n callback: Readonly<\n TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression\n >\n): null | TSESTree.CallExpression => {\n if (callback.params.length !== 1) {\n return null;\n }\n\n const [firstParameter] = callback.params;\n if (firstParameter?.type !== \"Identifier\") {\n return null;\n }\n\n const callbackBody = callback.body;\n if (\n callbackBody.type !== \"UnaryExpression\" ||\n callbackBody.operator !== \"!\" ||\n callbackBody.argument.type !== \"CallExpression\"\n ) {\n return null;\n }\n\n const predicateCall = callbackBody.argument;\n if (predicateCall.arguments.length !== 1) {\n return null;\n }\n\n const [firstArgument] = predicateCall.arguments;\n return firstArgument &&\n isTargetCallbackParameter(firstArgument, firstParameter.name)\n ? predicateCall\n : null;\n};\n\n/**\n * ESLint rule definition for `prefer-ts-extras-not`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasNotRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n /**\n * Create a safe replacement fix that rewrites negated predicate\n * callbacks into `not(predicate)`.\n */\n const createNotFilterCallbackFix = ({\n callbackNode,\n predicateCall,\n }: Readonly<{\n callbackNode:\n | TSESTree.ArrowFunctionExpression\n | TSESTree.FunctionExpression;\n predicateCall: TSESTree.CallExpression;\n }>): null | TSESLint.ReportFixFunction => {\n if ((predicateCall.typeArguments?.params.length ?? 0) > 0) {\n return null;\n }\n\n if (\n predicateCall.optional ||\n predicateCall.callee.type !== \"Identifier\"\n ) {\n return null;\n }\n\n const predicateText = context.sourceCode\n .getText(predicateCall.callee)\n .trim();\n\n if (predicateText.length === 0) {\n return null;\n }\n\n return createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"not\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}(${predicateText})`,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: callbackNode,\n });\n };\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.property.type=\"Identifier\"][callee.property.name=\"filter\"]'(\n node\n ) {\n const callbackArgument =\n getFilterCallbackFunctionArgument(node);\n if (!callbackArgument) {\n return;\n }\n\n const negatedPredicateCall =\n getNegatedPredicateCall(callbackArgument);\n\n if (!negatedPredicateCall) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: createNotFilterCallbackFix({\n callbackNode: callbackArgument,\n predicateCall: negatedPredicateCall,\n }),\n messageId: \"preferTsExtrasNot\",\n node: callbackArgument,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras not helper over inline negated predicate callbacks in filter calls.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-not\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasNot:\n \"Prefer `not(<predicate>)` from `ts-extras` over inline `value => !predicate(value)` callbacks.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-not\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-not` rule module.\n */\nexport default preferTsExtrasNotRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-entries`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-entries`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectEntriesRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Object\"][callee.property.type=\"Identifier\"][callee.property.name=\"entries\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"objectEntries\",\n imports: tsExtrasImports,\n memberName: \"entries\",\n messageId: \"preferTsExtrasObjectEntries\",\n node,\n objectName: \"Object\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectEntries over Object.entries for stronger key/value inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-entries\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasObjectEntries:\n \"Prefer `objectEntries` from `ts-extras` over `Object.entries(...)` for stronger key and value inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-entries\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-entries` rule module.\n */\nexport default preferTsExtrasObjectEntriesRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-from-entries`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-from-entries`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectFromEntriesRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Object\"][callee.property.type=\"Identifier\"][callee.property.name=\"fromEntries\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"objectFromEntries\",\n imports: tsExtrasImports,\n memberName: \"fromEntries\",\n messageId: \"preferTsExtrasObjectFromEntries\",\n node,\n objectName: \"Object\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectFromEntries over Object.fromEntries for stronger key/value inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-from-entries\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasObjectFromEntries:\n \"Prefer `objectFromEntries` from `ts-extras` over `Object.fromEntries(...)` for stronger key and value inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-from-entries\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-from-entries` rule module.\n */\nexport default preferTsExtrasObjectFromEntriesRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-has-in`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithTypefestPolicy } from \"../_internal/rule-reporting.js\";\nimport { isTypePredicateExpressionAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-has-in`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectHasInRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Reflect\"][callee.property.type=\"Identifier\"][callee.property.name=\"has\"]'(\n node: TSESTree.CallExpression\n ) {\n reportTsExtrasGlobalMemberCall({\n canAutofix: isTypePredicateExpressionAutofixSafe,\n context,\n importedName: \"objectHasIn\",\n imports: tsExtrasImports,\n memberName: \"has\",\n messageId: \"preferTsExtrasObjectHasIn\",\n minimumArgumentCount: 2,\n node,\n objectName: \"Reflect\",\n reportSuggestion: ({ fix, node: suggestionNode }) => {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasObjectHasIn\",\n node: suggestionNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestTsExtrasObjectHasIn\",\n },\n ],\n },\n });\n },\n suggestionMessageId: \"suggestTsExtrasObjectHasIn\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectHasIn over Reflect.has for stronger key-in-object narrowing.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-has-in\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasObjectHasIn:\n \"Prefer `objectHasIn` from `ts-extras` over `Reflect.has` for better type narrowing.\",\n suggestTsExtrasObjectHasIn:\n \"Replace this `Reflect.has(...)` call with `objectHasIn(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-has-in\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-has-in` rule module.\n */\nexport default preferTsExtrasObjectHasInRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-has-own`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithTypefestPolicy } from \"../_internal/rule-reporting.js\";\nimport { isTypePredicateExpressionAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-has-own`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectHasOwnRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Object\"][callee.property.type=\"Identifier\"][callee.property.name=\"hasOwn\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n canAutofix: isTypePredicateExpressionAutofixSafe,\n context,\n importedName: \"objectHasOwn\",\n imports: tsExtrasImports,\n memberName: \"hasOwn\",\n messageId: \"preferTsExtrasObjectHasOwn\",\n node,\n objectName: \"Object\",\n reportSuggestion: ({ fix, node: suggestionNode }) => {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasObjectHasOwn\",\n node: suggestionNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestTsExtrasObjectHasOwn\",\n },\n ],\n },\n });\n },\n suggestionMessageId: \"suggestTsExtrasObjectHasOwn\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectHasOwn over Object.hasOwn for own-property checks that should also narrow object types.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-has-own\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasObjectHasOwn:\n \"Prefer `objectHasOwn` from `ts-extras` over `Object.hasOwn` for own-property guards with stronger type narrowing.\",\n suggestTsExtrasObjectHasOwn:\n \"Replace this `Object.hasOwn(...)` call with `objectHasOwn(...)` from `ts-extras`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-has-own\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-has-own` rule module.\n */\nexport default preferTsExtrasObjectHasOwnRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-keys`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-keys`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectKeysRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Object\"][callee.property.type=\"Identifier\"][callee.property.name=\"keys\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"objectKeys\",\n imports: tsExtrasImports,\n memberName: \"keys\",\n messageId: \"preferTsExtrasObjectKeys\",\n node,\n objectName: \"Object\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectKeys over Object.keys for stronger key inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-keys\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasObjectKeys:\n \"Prefer `objectKeys` from `ts-extras` over `Object.keys(...)` for stronger key inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-keys\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-keys` rule module.\n */\nexport default preferTsExtrasObjectKeysRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-object-values`.\n */\nimport { reportTsExtrasGlobalMemberCall } from \"../_internal/global-member-call-rule.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-ts-extras-object-values`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasObjectValuesRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.object.type=\"Identifier\"][callee.object.name=\"Object\"][callee.property.type=\"Identifier\"][callee.property.name=\"values\"]'(\n node\n ) {\n reportTsExtrasGlobalMemberCall({\n context,\n importedName: \"objectValues\",\n imports: tsExtrasImports,\n memberName: \"values\",\n messageId: \"preferTsExtrasObjectValues\",\n node,\n objectName: \"Object\",\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras objectValues over Object.values for stronger value inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-object-values\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasObjectValues:\n \"Prefer `objectValues` from `ts-extras` over `Object.values(...)` for stronger value inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-object-values\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-object-values` rule module.\n */\nexport default preferTsExtrasObjectValuesRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-safe-cast-to`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n containsAllTypesByName,\n isTypeAnyType,\n isTypeNeverType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport { isDefined } from \"ts-extras\";\nimport ts from \"typescript\";\n\nimport { getConstrainedTypeAtLocationWithFallback } from \"../_internal/constrained-type-at-location.js\";\nimport {\n collectDirectNamedValueImportsFromSource,\n createSafeValueNodeTextReplacementFix,\n getFunctionCallArgumentText,\n} from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { safeTypeOperation } from \"../_internal/safe-type-operation.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n isTypeAssignableTo,\n} from \"../_internal/typed-rule.js\";\n\n/**\n * Checks whether a type assertion target should be excluded from `safeCastTo`\n * suggestions.\n *\n * @param typeAnnotation - Asserted type annotation to inspect.\n *\n * @returns `true` for broad or intentionally unsafe targets (`any`, `unknown`,\n * `never`, and `const` assertions) where replacement is not desirable.\n */\n\nconst isIgnoredTypeAnnotation = (\n typeAnnotation: Readonly<TSESTree.TypeNode>\n): boolean =>\n typeAnnotation.type === \"TSAnyKeyword\" ||\n typeAnnotation.type === \"TSNeverKeyword\" ||\n typeAnnotation.type === \"TSUnknownKeyword\" ||\n (typeAnnotation.type === \"TSTypeReference\" &&\n typeAnnotation.typeName.type === \"Identifier\" &&\n typeAnnotation.typeName.name === \"const\");\n\nconst IGNORED_TARGET_TYPE_NAMES = new Set([\n \"any\",\n \"never\",\n \"unknown\",\n]);\n\nconst resolvesToIgnoredTargetTypeName = (\n targetType: Readonly<ts.Type>\n): boolean => {\n const containsIgnoredTypeNameResult = safeTypeOperation({\n operation: () =>\n containsAllTypesByName(targetType, true, IGNORED_TARGET_TYPE_NAMES),\n reason: \"safe-cast-to-ignored-target-name-check-failed\",\n });\n\n return (\n containsIgnoredTypeNameResult.ok && containsIgnoredTypeNameResult.value\n );\n};\n\n/**\n * Checks whether a resolved target type should be excluded from `safeCastTo`\n * suggestions.\n *\n * @param targetType - Resolved target type.\n *\n * @returns `true` for broad or intentionally unsafe targets (`any`, `unknown`,\n * and `never`) including aliased forms.\n */\nconst isIgnoredTargetType = (targetType: Readonly<ts.Type>): boolean =>\n isTypeAnyType(targetType) ||\n isTypeNeverType(targetType) ||\n isTypeUnknownType(targetType) ||\n resolvesToIgnoredTargetTypeName(targetType);\n\n/**\n * ESLint rule definition for `prefer-ts-extras-safe-cast-to`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasSafeCastToRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n\n /**\n * Report assertions that can be replaced by `safeCastTo<T>(value)`\n * without changing assignability behavior.\n */\n const reportIfSafeCastCandidate = ({\n expression,\n node,\n typeAnnotation,\n }: Readonly<{\n expression: TSESTree.Expression;\n node: TSESTree.Node;\n typeAnnotation: TSESTree.TypeNode;\n }>): void => {\n if (isIgnoredTypeAnnotation(typeAnnotation)) {\n return;\n }\n\n const result = safeTypeOperation({\n operation: () => {\n const annotationTsNode =\n parserServices.esTreeNodeToTSNodeMap.get(\n typeAnnotation\n );\n\n if (!ts.isTypeNode(annotationTsNode)) {\n return null;\n }\n\n const sourceType =\n getConstrainedTypeAtLocationWithFallback(\n checker,\n expression,\n parserServices,\n \"safe-cast-to-source-type-resolution-failed\"\n );\n\n if (!isDefined(sourceType)) {\n return null;\n }\n\n const targetType =\n checker.getTypeFromTypeNode(annotationTsNode);\n\n if (isIgnoredTargetType(targetType)) {\n return null;\n }\n\n if (\n !isTypeAssignableTo(checker, sourceType, targetType)\n ) {\n return null;\n }\n\n const expressionArgumentText =\n getFunctionCallArgumentText({\n argumentNode: expression,\n sourceCode: context.sourceCode,\n });\n\n if (expressionArgumentText === null) {\n return null;\n }\n\n return createSafeValueNodeTextReplacementFix({\n context,\n importedName: \"safeCastTo\",\n imports: tsExtrasImports,\n replacementTextFactory: (replacementName) =>\n `${replacementName}<${context.sourceCode.getText(typeAnnotation)}>(${expressionArgumentText})`,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n targetNode: node,\n });\n },\n reason: \"safe-cast-to-candidate-analysis-failed\",\n });\n\n if (!result.ok || result.value === null) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: result.value,\n messageId: \"preferTsExtrasSafeCastTo\",\n node,\n });\n };\n\n return {\n TSAsExpression(node) {\n reportIfSafeCastCandidate({\n expression: node.expression,\n node,\n typeAnnotation: node.typeAnnotation,\n });\n },\n TSTypeAssertion(node) {\n reportIfSafeCastCandidate({\n expression: node.expression,\n node,\n typeAnnotation: node.typeAnnotation,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras safeCastTo for assignable type assertions instead of direct `as` casts.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.recommended-type-checked\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-safe-cast-to\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasSafeCastTo:\n \"Prefer `safeCastTo<T>(value)` from `ts-extras` over direct `as` assertions when the cast is already type-safe.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-safe-cast-to\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-safe-cast-to` rule module.\n */\nexport default preferTsExtrasSafeCastToRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-set-has`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n containsAllTypesByName,\n getTypeName,\n isBuiltinSymbolLike,\n isTypeAnyType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport { isDefined, isPresent } from \"ts-extras\";\nimport ts from \"typescript\";\n\nimport { getConstrainedTypeAtLocationWithFallback } from \"../_internal/constrained-type-at-location.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { getIdentifierPropertyMemberCall } from \"../_internal/member-call.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithTypefestPolicy } from \"../_internal/rule-reporting.js\";\nimport { safeTypeOperation } from \"../_internal/safe-type-operation.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport {\n getTypeCheckerApparentType,\n getTypeCheckerBaseTypes,\n} from \"../_internal/type-checker-compat.js\";\nimport { isTypePredicateAutofixSafe } from \"../_internal/type-predicate-autofix-safety.js\";\nimport { reportTsExtrasTypedMemberCall } from \"../_internal/typed-member-call-rule.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n} from \"../_internal/typed-rule.js\";\n\nconst UNION_SET_MATCHING_MODE_ALL_BRANCHES = \"allBranches\";\nconst UNION_SET_MATCHING_MODE_ANY_BRANCH = \"anyBranch\";\nconst DEFAULT_UNION_SET_MATCHING_MODE = UNION_SET_MATCHING_MODE_ALL_BRANCHES;\nconst unionSetMatchingModeValues = [\n UNION_SET_MATCHING_MODE_ALL_BRANCHES,\n UNION_SET_MATCHING_MODE_ANY_BRANCH,\n] as const;\n\ntype PreferTsExtrasSetHasOption = Readonly<{\n unionBranchMatchingMode?: UnionSetMatchingMode;\n}>;\n\ntype SetHasCallAnalysis = Readonly<{\n canAutofix: boolean;\n matchesDefaultUnionMode: boolean;\n}>;\n\ntype UnionSetMatchingMode = (typeof unionSetMatchingModeValues)[number];\n\nconst defaultOption = {\n unionBranchMatchingMode: DEFAULT_UNION_SET_MATCHING_MODE,\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\nconst setTypeNameList = [\"ReadonlySet\", \"Set\"];\nconst setTypeNames = new Set(setTypeNameList);\n\n/**\n * ESLint rule definition for `prefer-ts-extras-set-has`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasSetHasRule: ReturnType<typeof createTypedRule> =\n createTypedRule<\n readonly [PreferTsExtrasSetHasOption],\n \"preferTsExtrasSetHas\" | \"suggestTsExtrasSetHas\"\n >({\n create(context, [options] = defaultOptions) {\n const unionSetMatchingMode: UnionSetMatchingMode =\n options.unionBranchMatchingMode ??\n DEFAULT_UNION_SET_MATCHING_MODE;\n\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const program = parserServices.program;\n const setTypeResolutionCaches: Readonly<\n Record<UnionSetMatchingMode, Map<Readonly<ts.Type>, boolean>>\n > = {\n [UNION_SET_MATCHING_MODE_ALL_BRANCHES]: new Map<\n Readonly<ts.Type>,\n boolean\n >(),\n [UNION_SET_MATCHING_MODE_ANY_BRANCH]: new Map<\n Readonly<ts.Type>,\n boolean\n >(),\n };\n const setLikeExpressionResolutionCache = new WeakMap<\n Readonly<TSESTree.Expression>,\n Partial<Record<UnionSetMatchingMode, boolean>>\n >();\n const setHasCallAnalysisCache = new WeakMap<\n Readonly<TSESTree.CallExpression>,\n SetHasCallAnalysis\n >();\n\n const hasClassOrInterfaceLikeDeclaration = (\n candidateType: Readonly<ts.Type>\n ): boolean => {\n const declarations = candidateType.getSymbol()?.declarations;\n if (!isDefined(declarations)) {\n return false;\n }\n\n return declarations.some(\n (declaration) =>\n declaration.kind === ts.SyntaxKind.ClassDeclaration ||\n declaration.kind === ts.SyntaxKind.InterfaceDeclaration\n );\n };\n\n /**\n * Determine whether a type resolves to `Set`/`ReadonlySet`,\n * traversing unions, intersections, and apparent types.\n */\n const isSetType = (\n type: Readonly<ts.Type>,\n unionMatchingMode: UnionSetMatchingMode\n ): boolean => {\n const setTypeResolutionCache =\n setTypeResolutionCaches[unionMatchingMode];\n\n const cachedRootResult = setTypeResolutionCache.get(type);\n if (isDefined(cachedRootResult)) {\n return cachedRootResult;\n }\n\n const seenTypes = new Set<ts.Type>();\n\n const isSetTypeInternal = (\n candidateType: Readonly<ts.Type>\n ): boolean => {\n const cachedResult =\n setTypeResolutionCache.get(candidateType);\n\n if (isDefined(cachedResult)) {\n return cachedResult;\n }\n\n if (setContainsValue(seenTypes, candidateType)) {\n return false;\n }\n\n seenTypes.add(candidateType);\n\n if (candidateType.isUnion()) {\n const isSetLike =\n unionMatchingMode ===\n UNION_SET_MATCHING_MODE_ALL_BRANCHES\n ? candidateType.types.every((partType) =>\n isSetTypeInternal(partType)\n )\n : candidateType.types.some((partType) =>\n isSetTypeInternal(partType)\n );\n\n setTypeResolutionCache.set(candidateType, isSetLike);\n\n return isSetLike;\n }\n\n if (candidateType.isIntersection()) {\n const isSetLike = candidateType.types.some((partType) =>\n isSetTypeInternal(partType)\n );\n setTypeResolutionCache.set(candidateType, isSetLike);\n\n return isSetLike;\n }\n\n if (\n isTypeAnyType(candidateType) ||\n isTypeUnknownType(candidateType)\n ) {\n setTypeResolutionCache.set(candidateType, false);\n\n return false;\n }\n\n const builtinSetLikeResult = safeTypeOperation({\n operation: () => {\n if (!isPresent(program)) {\n return false;\n }\n\n return isBuiltinSymbolLike(\n program,\n candidateType,\n setTypeNameList\n );\n },\n reason: \"set-has-builtin-symbol-analysis-failed\",\n });\n\n if (builtinSetLikeResult.ok && builtinSetLikeResult.value) {\n setTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const shouldUseNameBasedFallback = !isPresent(program);\n\n if (shouldUseNameBasedFallback) {\n const candidateTypeNameResult = safeTypeOperation({\n operation: () =>\n getTypeName(checker, candidateType),\n reason: \"set-has-type-name-analysis-failed\",\n });\n\n const candidateTypeName = candidateTypeNameResult.ok\n ? candidateTypeNameResult.value\n : \"\";\n const candidateSymbolName = candidateType\n .getSymbol()\n ?.getName();\n\n if (\n candidateTypeName === \"ReadonlySet\" ||\n candidateTypeName === \"Set\" ||\n candidateSymbolName === \"ReadonlySet\" ||\n candidateSymbolName === \"Set\"\n ) {\n setTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n }\n\n const containsSetLikeResult = safeTypeOperation({\n operation: () =>\n isPresent(program)\n ? false\n : containsAllTypesByName(\n candidateType,\n true,\n setTypeNames,\n true\n ),\n reason: \"set-has-contains-all-types-analysis-failed\",\n });\n\n if (\n containsSetLikeResult.ok &&\n containsSetLikeResult.value\n ) {\n setTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const apparentType = getTypeCheckerApparentType(\n checker,\n candidateType\n );\n if (\n isDefined(apparentType) &&\n apparentType !== candidateType &&\n isSetTypeInternal(apparentType)\n ) {\n setTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n if (!hasClassOrInterfaceLikeDeclaration(candidateType)) {\n setTypeResolutionCache.set(candidateType, false);\n\n return false;\n }\n\n const baseTypesResult = safeTypeOperation({\n operation: () =>\n getTypeCheckerBaseTypes(checker, candidateType),\n reason: \"set-has-base-type-analysis-failed\",\n });\n\n if (!baseTypesResult.ok) {\n setTypeResolutionCache.set(candidateType, false);\n\n return false;\n }\n\n const baseTypes = baseTypesResult.value;\n\n const isSetLike =\n baseTypes?.some((baseType) =>\n isSetTypeInternal(baseType)\n ) ?? false;\n\n setTypeResolutionCache.set(candidateType, isSetLike);\n\n return isSetLike;\n };\n\n return isSetTypeInternal(type);\n };\n\n const isSetLikeExpression = (\n expression: Readonly<TSESTree.Expression>,\n unionMatchingMode: UnionSetMatchingMode\n ): boolean => {\n const cachedExpressionModes =\n setLikeExpressionResolutionCache.get(expression);\n const cachedModeResult =\n cachedExpressionModes?.[unionMatchingMode];\n\n if (isDefined(cachedModeResult)) {\n return cachedModeResult;\n }\n\n const result = safeTypeOperation({\n operation: () => {\n const objectType =\n getConstrainedTypeAtLocationWithFallback(\n checker,\n expression,\n parserServices,\n \"set-has-expression-type-resolution-failed\"\n );\n\n if (!isDefined(objectType)) {\n return false;\n }\n\n return isSetType(objectType, unionMatchingMode);\n },\n reason: \"set-has-type-analysis-failed\",\n });\n\n const isSetLike = result.ok && result.value;\n const nextExpressionModes = {\n ...cachedExpressionModes,\n [unionMatchingMode]: isSetLike,\n };\n\n setLikeExpressionResolutionCache.set(\n expression,\n nextExpressionModes\n );\n\n return isSetLike;\n };\n\n const analyzeSetHasCall = (\n node: Readonly<TSESTree.CallExpression>\n ): SetHasCallAnalysis => {\n const cachedAnalysis = setHasCallAnalysisCache.get(node);\n\n if (isDefined(cachedAnalysis)) {\n return cachedAnalysis;\n }\n\n const receiverExpression = getIdentifierPropertyMemberCall({\n memberName: \"has\",\n node,\n })?.callee.object;\n\n if (!isDefined(receiverExpression)) {\n const notSetLikeAnalysis: SetHasCallAnalysis = {\n canAutofix: false,\n matchesDefaultUnionMode: false,\n };\n\n setHasCallAnalysisCache.set(node, notSetLikeAnalysis);\n\n return notSetLikeAnalysis;\n }\n\n const matchesConfiguredUnionMode = isSetLikeExpression(\n receiverExpression,\n unionSetMatchingMode\n );\n const matchesDefaultUnionMode =\n unionSetMatchingMode === DEFAULT_UNION_SET_MATCHING_MODE\n ? matchesConfiguredUnionMode\n : isSetLikeExpression(\n receiverExpression,\n DEFAULT_UNION_SET_MATCHING_MODE\n );\n\n const analysis: SetHasCallAnalysis = {\n canAutofix:\n matchesDefaultUnionMode &&\n isTypePredicateAutofixSafe(node),\n matchesDefaultUnionMode,\n };\n\n setHasCallAnalysisCache.set(node, analysis);\n\n return analysis;\n };\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"has\"]'(\n node\n ) {\n reportTsExtrasTypedMemberCall({\n canAutofix: (callNode) =>\n analyzeSetHasCall(callNode).canAutofix,\n context,\n importedName: \"setHas\",\n imports: tsExtrasImports,\n isMatchingObjectExpression: (expression) =>\n isSetLikeExpression(\n expression,\n unionSetMatchingMode\n ),\n memberName: \"has\",\n messageId: \"preferTsExtrasSetHas\",\n node,\n reportSuggestion: ({ fix, node: suggestionNode }) => {\n const callAnalysis =\n analyzeSetHasCall(suggestionNode);\n\n if (!callAnalysis.matchesDefaultUnionMode) {\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasSetHas\",\n node: suggestionNode,\n },\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferTsExtrasSetHas\",\n node: suggestionNode,\n suggest: [\n {\n fix,\n messageId: \"suggestTsExtrasSetHas\",\n },\n ],\n },\n });\n },\n suggestionMessageId: \"suggestTsExtrasSetHas\",\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require direct ts-extras setHas over Set#has at membership call sites for stronger element narrowing.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.recommended-type-checked\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.ts-extras/type-guards\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-set-has\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n preferTsExtrasSetHas:\n \"Prefer `setHas` from `ts-extras` over `set.has(...)` for stronger element narrowing.\",\n suggestTsExtrasSetHas:\n \"Replace this `set.has(...)` call with `setHas(...)` from `ts-extras`.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for mixed-union matching in prefer-ts-extras-set-has.\",\n minProperties: 1,\n properties: {\n unionBranchMatchingMode: {\n description:\n \"How union-typed receivers are matched: allBranches requires every union branch to be Set-like, anyBranch reports when at least one branch is Set-like.\",\n enum: [...unionSetMatchingModeValues],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-set-has\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-set-has` rule module.\n */\nexport default preferTsExtrasSetHasRule;\n", "/**\n * @packageDocumentation\n * Shared reporting helper for typed ts-extras identifier-member call rules.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport {\n createMethodToFunctionCallFix,\n type ImportedValueAliasMap,\n} from \"./imported-value-symbols.js\";\nimport { getIdentifierPropertyMemberCall } from \"./member-call.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"./module-source.js\";\nimport {\n reportResolvedAutofixOrSuggestionOutcome,\n resolveAutofixOrSuggestionOutcome,\n} from \"./rule-reporting.js\";\n\n/** Direct named value imports collection type from shared import helper. */\ntype DirectNamedValueImports = ImportedValueAliasMap;\n\n/** Typed rule context shape for typed member-call rules. */\ntype TypedMemberCallRuleContext<MessageId extends string> = Readonly<\n TSESLint.RuleContext<MessageId, Readonly<UnknownArray>>\n>;\n\n/**\n * Match `<expr>.<memberName>(...)` and report a standardized ts-extras helper\n * replacement when the receiver expression satisfies a caller-provided type\n * predicate.\n */\nexport const reportTsExtrasTypedMemberCall = <MessageId extends string>({\n canAutofix,\n context,\n importedName,\n imports,\n isMatchingObjectExpression,\n memberName,\n messageId,\n node,\n reportSuggestion,\n suggestionMessageId,\n}: Readonly<{\n canAutofix?: (node: Readonly<TSESTree.CallExpression>) => boolean;\n context: TypedMemberCallRuleContext<MessageId>;\n importedName: string;\n imports: DirectNamedValueImports;\n isMatchingObjectExpression: (\n expression: Readonly<TSESTree.Expression>\n ) => boolean;\n memberName: string;\n messageId: MessageId;\n node: Readonly<TSESTree.CallExpression>;\n reportSuggestion?: (\n input: Readonly<{\n fix: TSESLint.ReportFixFunction;\n messageId: MessageId;\n node: Readonly<TSESTree.CallExpression>;\n suggestionMessageId: MessageId;\n }>\n ) => void;\n suggestionMessageId?: MessageId;\n}>): void => {\n const memberCall = getIdentifierPropertyMemberCall({\n memberName,\n node,\n });\n\n if (memberCall === null) {\n return;\n }\n\n if (!isMatchingObjectExpression(memberCall.callee.object)) {\n return;\n }\n\n const fix = createMethodToFunctionCallFix({\n callNode: node,\n context,\n importedName,\n imports,\n sourceModuleName: TS_EXTRAS_MODULE_SOURCE,\n });\n\n const shouldAutofix = canAutofix?.(node) ?? true;\n\n const outcome = resolveAutofixOrSuggestionOutcome({\n canAutofix: shouldAutofix,\n fix,\n });\n\n if (outcome.kind === \"suggestion\" && reportSuggestion !== undefined) {\n reportSuggestion({\n fix: outcome.fix,\n messageId,\n node,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n\n return;\n }\n\n reportResolvedAutofixOrSuggestionOutcome({\n context,\n messageId,\n node,\n outcome,\n suggestionMessageId: suggestionMessageId ?? messageId,\n });\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-ts-extras-string-split`.\n */\nimport type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getTypeName,\n isBuiltinSymbolLike,\n isTypeAnyType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport { isDefined, isPresent } from \"ts-extras\";\n\nimport { getConstrainedTypeAtLocationWithFallback } from \"../_internal/constrained-type-at-location.js\";\nimport { memoizeExpressionBooleanPredicate } from \"../_internal/expression-boolean-memoizer.js\";\nimport { collectDirectNamedValueImportsFromSource } from \"../_internal/imported-value-symbols.js\";\nimport { TS_EXTRAS_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { safeTypeOperation } from \"../_internal/safe-type-operation.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport {\n getTypeCheckerApparentType,\n getTypeCheckerStringType,\n} from \"../_internal/type-checker-compat.js\";\nimport { reportTsExtrasTypedMemberCall } from \"../_internal/typed-member-call-rule.js\";\nimport {\n createTypedRule,\n getTypedRuleServices,\n isTypeAssignableTo,\n} from \"../_internal/typed-rule.js\";\n\nconst stringObjectTypeNames = new Set([\"String\"]);\n\n/**\n * ESLint rule definition for `prefer-ts-extras-string-split`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTsExtrasStringSplitRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const tsExtrasImports = collectDirectNamedValueImportsFromSource(\n context.sourceCode,\n TS_EXTRAS_MODULE_SOURCE\n );\n\n const { checker, parserServices } = getTypedRuleServices(context);\n const program = parserServices.program;\n const stringPrimitiveType = getTypeCheckerStringType(checker);\n const stringTypeResolutionCache = new Map<\n Readonly<ts.Type>,\n boolean\n >();\n\n /**\n * Determine whether a type behaves like a string, traversing\n * unions/intersections and apparent types while guarding cycles.\n */\n const isStringLikeType = (\n type: Readonly<ReturnType<typeof checker.getTypeAtLocation>>\n ): boolean => {\n const cachedRootResult = stringTypeResolutionCache.get(type);\n\n if (isDefined(cachedRootResult)) {\n return cachedRootResult;\n }\n\n const seenTypes = new Set<ts.Type>();\n\n const isStringLikeTypeInternal = (\n candidateType: Readonly<ts.Type>\n ): boolean => {\n const cachedResult =\n stringTypeResolutionCache.get(candidateType);\n\n if (isDefined(cachedResult)) {\n return cachedResult;\n }\n\n if (setContainsValue(seenTypes, candidateType)) {\n return false;\n }\n\n seenTypes.add(candidateType);\n\n if (candidateType.isUnion()) {\n const isStringLike = candidateType.types.some(\n (partType) => isStringLikeTypeInternal(partType)\n );\n\n stringTypeResolutionCache.set(\n candidateType,\n isStringLike\n );\n\n return isStringLike;\n }\n\n if (candidateType.isIntersection()) {\n const isStringLike = candidateType.types.some(\n (partType) => isStringLikeTypeInternal(partType)\n );\n\n stringTypeResolutionCache.set(\n candidateType,\n isStringLike\n );\n\n return isStringLike;\n }\n\n if (\n isTypeAnyType(candidateType) ||\n isTypeUnknownType(candidateType)\n ) {\n stringTypeResolutionCache.set(candidateType, false);\n\n return false;\n }\n\n if (\n isDefined(stringPrimitiveType) &&\n isTypeAssignableTo(\n checker,\n candidateType,\n stringPrimitiveType\n )\n ) {\n stringTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const builtinStringLikeResult = safeTypeOperation({\n operation: () => {\n if (!isPresent(program)) {\n return false;\n }\n\n return isBuiltinSymbolLike(\n program,\n candidateType,\n \"String\"\n );\n },\n reason: \"string-split-builtin-symbol-analysis-failed\",\n });\n\n if (\n builtinStringLikeResult.ok &&\n builtinStringLikeResult.value\n ) {\n stringTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const shouldUseNameBasedFallback = !isPresent(program);\n\n if (shouldUseNameBasedFallback) {\n const candidateTypeNameResult = safeTypeOperation({\n operation: () =>\n getTypeName(checker, candidateType),\n reason: \"string-split-type-name-analysis-failed\",\n });\n\n if (\n candidateTypeNameResult.ok &&\n candidateTypeNameResult.value === \"String\"\n ) {\n stringTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n }\n\n const containsStringObjectLikeResult = safeTypeOperation({\n operation: () =>\n isPresent(program)\n ? false\n : containsAllTypesByName(\n candidateType,\n true,\n stringObjectTypeNames,\n true\n ),\n reason: \"string-split-contains-all-types-analysis-failed\",\n });\n\n if (\n containsStringObjectLikeResult.ok &&\n containsStringObjectLikeResult.value\n ) {\n stringTypeResolutionCache.set(candidateType, true);\n\n return true;\n }\n\n const apparentType = getTypeCheckerApparentType(\n checker,\n candidateType\n );\n\n const isStringLike =\n !isDefined(apparentType) ||\n apparentType === candidateType\n ? false\n : isStringLikeTypeInternal(apparentType);\n\n stringTypeResolutionCache.set(candidateType, isStringLike);\n\n return isStringLike;\n };\n\n return isStringLikeTypeInternal(type);\n };\n\n const isStringLikeExpression = memoizeExpressionBooleanPredicate(\n (expression): boolean => {\n const result = safeTypeOperation({\n operation: () => {\n const objectType =\n getConstrainedTypeAtLocationWithFallback(\n checker,\n expression,\n parserServices,\n \"string-split-expression-type-resolution-failed\"\n );\n\n if (!isDefined(objectType)) {\n return false;\n }\n\n return isStringLikeType(objectType);\n },\n reason: \"string-split-type-analysis-failed\",\n });\n\n return result.ok && result.value;\n }\n );\n\n return {\n 'CallExpression[callee.type=\"MemberExpression\"][callee.computed=false][callee.property.type=\"Identifier\"][callee.property.name=\"split\"]'(\n node\n ) {\n reportTsExtrasTypedMemberCall({\n context,\n importedName: \"stringSplit\",\n imports: tsExtrasImports,\n isMatchingObjectExpression: isStringLikeExpression,\n memberName: \"split\",\n messageId: \"preferTsExtrasStringSplit\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require ts-extras stringSplit over String#split for stronger tuple inference.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n typefestConfigs: [\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-ts-extras-string-split\",\n },\n fixable: \"code\",\n messages: {\n preferTsExtrasStringSplit:\n \"Prefer `stringSplit` from `ts-extras` over `string.split(...)` for stronger tuple inference.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-ts-extras-string-split\",\n });\n\n/**\n * Default export for the `prefer-ts-extras-string-split` rule module.\n */\nexport default preferTsExtrasStringSplitRule;\n", "/**\n * @packageDocumentation\n * Shared helper for memoizing boolean expression predicates by ESTree node\n * identity.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\n/**\n * Memoize a boolean expression predicate using a `WeakMap` keyed by expression\n * node identity.\n *\n * @param evaluate - Predicate to memoize.\n *\n * @returns Memoized predicate that reuses previous results for the same node\n * object.\n */\nexport const memoizeExpressionBooleanPredicate = (\n evaluate: (expression: Readonly<TSESTree.Expression>) => boolean\n): ((expression: Readonly<TSESTree.Expression>) => boolean) => {\n const cache = new WeakMap<Readonly<TSESTree.Expression>, boolean>();\n\n return (expression) => {\n const cachedResult = cache.get(expression);\n\n if (isDefined(cachedResult)) {\n return cachedResult;\n }\n\n const result = evaluate(expression);\n\n cache.set(expression, result);\n\n return result;\n };\n};\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-abstract-constructor`.\n */\nimport { arrayJoin, isDefined } from \"ts-extras\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-abstract-constructor`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestAbstractConstructorRule: ReturnType<\n typeof createTypedRule\n> = createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n const { sourceCode } = context;\n\n return {\n TSConstructorType(node) {\n if (!node.abstract) {\n return;\n }\n\n const replacementFix =\n !isDefined(node.typeParameters) &&\n isDefined(node.returnType)\n ? createSafeTypeNodeTextReplacementFix(\n node,\n \"AbstractConstructor\",\n `AbstractConstructor<${sourceCode.getText(node.returnType.typeAnnotation)}, [${arrayJoin(\n node.params.map((parameter) =>\n sourceCode.getText(parameter)\n ),\n \", \"\n )}]>`,\n typeFestDirectImports\n )\n : null;\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferAbstractConstructorSignature\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n docs: {\n description:\n \"require TypeFest AbstractConstructor over explicit `abstract new (...) => ...` signatures.\",\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-abstract-constructor\",\n },\n fixable: \"code\",\n messages: {\n preferAbstractConstructorSignature:\n \"Prefer `AbstractConstructor<...>` from type-fest over explicit `abstract new (...) => ...` signatures.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-abstract-constructor\",\n});\n\n/**\n * Default export for the `prefer-type-fest-abstract-constructor` rule module.\n */\nexport default preferTypeFestAbstractConstructorRule;\n", "/**\n * @packageDocumentation\n * Predicate helpers for narrowing `TSTypeReference` nodes by identifier name.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * Checks whether a type node is an identifier-based type reference with a\n * specific symbol name.\n *\n * @param node - Type node candidate.\n * @param identifierName - Expected referenced identifier name.\n *\n * @returns `true` when the node is `TSTypeReference` and the referenced\n * `typeName` identifier matches exactly.\n */\nexport const isIdentifierTypeReference = (\n node: Readonly<TSESTree.TypeNode>,\n identifierName: string\n): node is TSESTree.TSTypeReference & { typeName: TSESTree.Identifier } =>\n node.type === \"TSTypeReference\" &&\n node.typeName.type === \"Identifier\" &&\n node.typeName.name === identifierName;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-arrayable`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentTypeNodes } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst ARRAY_TYPE_NAME = \"Array\";\n\n/**\n * Extract the element type from `Array<T>` type references.\n *\n * @param node - Type node to inspect.\n *\n * @returns Element type when the node is `Array<T>`; otherwise `null`.\n */\nconst getArrayTypeReferenceElementType = (\n node: Readonly<TSESTree.TypeNode>\n): null | TSESTree.TypeNode => {\n if (!isIdentifierTypeReference(node, ARRAY_TYPE_NAME)) {\n return null;\n }\n\n const typeArguments = node.typeArguments?.params ?? [];\n if (typeArguments.length !== 1) {\n return null;\n }\n\n const [firstTypeArgument] = typeArguments;\n return firstTypeArgument ?? null;\n};\n\n/**\n * Extract the scalar element type from `T | T[]` or `T | Array<T>` unions.\n *\n * @param node - Union type node to inspect.\n *\n * @returns The scalar `T` when the union matches an Arrayable pattern;\n * otherwise `null`.\n */\nconst getArrayableElementType = (\n node: Readonly<TSESTree.TSUnionType>\n): null | TSESTree.TypeNode => {\n const unionTypes = node.types;\n if (unionTypes.length !== 2) {\n return null;\n }\n\n const [firstUnionType, secondUnionType] = unionTypes;\n if (!firstUnionType || !secondUnionType) {\n return null;\n }\n\n if (firstUnionType.type === \"TSArrayType\") {\n return areEquivalentTypeNodes(\n firstUnionType.elementType,\n secondUnionType\n )\n ? secondUnionType\n : null;\n }\n\n if (secondUnionType.type === \"TSArrayType\") {\n return areEquivalentTypeNodes(\n secondUnionType.elementType,\n firstUnionType\n )\n ? firstUnionType\n : null;\n }\n\n const firstArrayElementType =\n getArrayTypeReferenceElementType(firstUnionType);\n if (firstArrayElementType) {\n return areEquivalentTypeNodes(firstArrayElementType, secondUnionType)\n ? secondUnionType\n : null;\n }\n\n const secondArrayElementType =\n getArrayTypeReferenceElementType(secondUnionType);\n if (secondArrayElementType) {\n return areEquivalentTypeNodes(secondArrayElementType, firstUnionType)\n ? firstUnionType\n : null;\n }\n\n return null;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-arrayable`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestArrayableRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const { sourceCode } = context;\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSUnionType(node) {\n const arrayableElementType = getArrayableElementType(node);\n\n if (!arrayableElementType) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeTextReplacementFix(\n node,\n \"Arrayable\",\n `Arrayable<${sourceCode.getText(arrayableElementType)}>`,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferArrayable\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Arrayable over T | T[] and T | Array<T> unions.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-arrayable\",\n },\n fixable: \"code\",\n messages: {\n preferArrayable:\n \"Prefer `Arrayable<T>` from type-fest over `T | T[]` or `T | Array<T>` unions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-arrayable\",\n });\n\n/**\n * Default export for the `prefer-type-fest-arrayable` rule module.\n */\nexport default preferTypeFestArrayableRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-async-return-type`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Built-in utility type used in verbose async return patterns. */\nconst AWAITED_TYPE_NAME = \"Awaited\";\n\n/** Built-in utility type nested inside awaited return compositions. */\nconst RETURN_TYPE_NAME = \"ReturnType\";\n\n/**\n * Extracts a single generic type argument from a type reference.\n *\n * @param node - Type reference node to inspect.\n *\n * @returns The only type argument when exactly one is present; otherwise\n * `null`.\n */\n\nconst getSingleTypeArgument = (\n node: Readonly<TSESTree.TSTypeReference>\n): null | TSESTree.TypeNode => {\n const typeArguments = node.typeArguments?.params ?? [];\n\n if (typeArguments.length !== 1) {\n return null;\n }\n\n const [onlyTypeArgument] = typeArguments;\n /* v8 ignore next -- defensive fallback for malformed synthetic AST arrays containing holes. */\n return onlyTypeArgument ?? null;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-async-return-type`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestAsyncReturnTypeRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n const { sourceCode } = context;\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (!isIdentifierTypeReference(node, AWAITED_TYPE_NAME)) {\n return;\n }\n\n const awaitedInnerType = getSingleTypeArgument(node);\n if (awaitedInnerType?.type !== \"TSTypeReference\") {\n return;\n }\n\n if (\n !isIdentifierTypeReference(\n awaitedInnerType,\n RETURN_TYPE_NAME\n )\n ) {\n return;\n }\n\n const returnTypeArgument =\n getSingleTypeArgument(awaitedInnerType);\n\n if (returnTypeArgument === null) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeTextReplacementFix(\n node,\n \"AsyncReturnType\",\n `AsyncReturnType<${sourceCode.getText(returnTypeArgument)}>`,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferAsyncReturnType\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest AsyncReturnType over Awaited<ReturnType<T>> compositions for async return extraction.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-async-return-type\",\n },\n fixable: \"code\",\n messages: {\n preferAsyncReturnType:\n \"Prefer `AsyncReturnType<T>` from type-fest over `Awaited<ReturnType<T>>`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-async-return-type\",\n });\n\n/**\n * Default export for the `prefer-type-fest-async-return-type` rule module.\n */\nexport default preferTypeFestAsyncReturnTypeRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-conditional-pick`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst conditionalPickAliasReplacements = {\n PickByTypes: \"ConditionalPick\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-conditional-pick`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestConditionalPickRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n conditionalPickAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferConditionalPick\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest ConditionalPick over imported aliases such as PickByTypes.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-conditional-pick\",\n },\n fixable: \"code\",\n messages: {\n preferConditionalPick:\n \"Prefer `{{replacement}}` from type-fest to pick keys whose values match a condition instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-conditional-pick\",\n });\n\n/**\n * Default export for the `prefer-type-fest-conditional-pick` rule module.\n */\nexport default preferTypeFestConditionalPickRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-constructor`.\n */\nimport { arrayJoin, isDefined } from \"ts-extras\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-constructor`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestConstructorRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n const { sourceCode } = context;\n\n return {\n TSConstructorType(node) {\n if (node.abstract) {\n return;\n }\n\n const replacementFix =\n !isDefined(node.typeParameters) &&\n isDefined(node.returnType)\n ? createSafeTypeNodeTextReplacementFix(\n node,\n \"Constructor\",\n `Constructor<${sourceCode.getText(node.returnType.typeAnnotation)}, [${arrayJoin(\n node.params.map((parameter) =>\n sourceCode.getText(parameter)\n ),\n \", \"\n )}]>`,\n typeFestDirectImports\n )\n : null;\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferConstructorSignature\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Constructor over explicit `new (...) => ...` constructor signatures.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-constructor\",\n },\n fixable: \"code\",\n messages: {\n preferConstructorSignature:\n \"Prefer `Constructor<...>` from type-fest over explicit `new (...) => ...` constructor signatures.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-constructor\",\n });\n\n/**\n * Default export for the `prefer-type-fest-constructor` rule module.\n */\nexport default preferTypeFestConstructorRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-except`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\ntype PreferTypeFestExceptOption = Readonly<{\n enforceBuiltinOmit?: boolean;\n}>;\n\nconst OMIT_TYPE_NAME = \"Omit\";\nconst exceptAliasReplacements = {\n HomomorphicOmit: \"Except\",\n} as const;\n\nconst defaultOption = {\n enforceBuiltinOmit: true,\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-except`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestExceptRule: ReturnType<typeof createTypedRule> =\n createTypedRule<readonly [PreferTypeFestExceptOption], \"preferExcept\">({\n create(context, [options] = defaultOptions) {\n const enforceBuiltinOmit = options.enforceBuiltinOmit ?? true;\n\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n exceptAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n const isBuiltinOmitReference = isIdentifierTypeReference(\n node,\n OMIT_TYPE_NAME\n );\n\n if (isBuiltinOmitReference) {\n if (!enforceBuiltinOmit) {\n return;\n }\n\n const typeArgumentCount =\n node.typeArguments?.params.length ?? 0;\n if (typeArgumentCount < 2) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferExcept\",\n node,\n });\n return;\n }\n\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferExcept\",\n node,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Except over Omit when removing properties from object types.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-except\",\n },\n fixable: \"code\",\n messages: {\n preferExcept:\n \"Prefer `Except<T, K>` from type-fest over `Omit<T, K>` for stricter omitted-key modeling.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for builtin Omit enforcement in prefer-type-fest-except.\",\n minProperties: 1,\n properties: {\n enforceBuiltinOmit: {\n description:\n \"Whether to report builtin Omit<T, K> references in addition to imported legacy aliases.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-except\",\n });\n\n/**\n * Default export for the `prefer-type-fest-except` rule module.\n */\nexport default preferTypeFestExceptRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-if`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Deprecated `If*` aliases mapped to preferred `Is*` counterparts. */\nconst ifAliasReplacements = {\n IfAny: \"IsAny\",\n IfEmptyObject: \"IsEmptyObject\",\n IfNever: \"IsNever\",\n IfNull: \"IsNull\",\n IfUnknown: \"IsUnknown\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-if`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestIfRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n ifAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferTypeFestIf\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest If + Is* utilities over deprecated If* aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-if\",\n },\n fixable: \"code\",\n messages: {\n preferTypeFestIf:\n \"`{{alias}}` is deprecated in type-fest. Prefer `If` combined with `{{replacement}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-if\",\n });\n\n/**\n * Default export for the `prefer-type-fest-if` rule module.\n */\nexport default preferTypeFestIfRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-iterable-element`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst iterableElementAliasReplacements = {\n SetElement: \"IterableElement\",\n SetEntry: \"IterableElement\",\n SetValues: \"IterableElement\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-iterable-element`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestIterableElementRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n iterableElementAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferIterableElement\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest IterableElement over imported aliases such as SetElement/SetEntry/SetValues.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-iterable-element\",\n },\n fixable: \"code\",\n messages: {\n preferIterableElement:\n \"Prefer `{{replacement}}` from type-fest to extract element types from iterable containers instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-iterable-element\",\n });\n\n/**\n * Default export for the `prefer-type-fest-iterable-element` rule module.\n */\nexport default preferTypeFestIterableElementRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-json-array`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Built-in generic array type name. */\nconst ARRAY_TYPE_NAME = \"Array\";\n\n/** TypeFest JSON value alias used by supported union patterns. */\nconst JSON_VALUE_TYPE_NAME = \"JsonValue\";\n\n/** Built-in readonly generic array type name. */\nconst READONLY_ARRAY_TYPE_NAME = \"ReadonlyArray\";\n\n/**\n * Checks whether a node references `JsonValue`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is the identifier type reference `JsonValue`.\n */\n\nconst isJsonValueType = (node: Readonly<TSESTree.TypeNode>): boolean =>\n isIdentifierTypeReference(node, JSON_VALUE_TYPE_NAME);\n\n/**\n * Checks whether a node is `JsonValue[]`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is an array type whose element type is\n * `JsonValue`.\n */\n\nconst isJsonValueArrayType = (node: Readonly<TSESTree.TypeNode>): boolean =>\n node.type === \"TSArrayType\" && isJsonValueType(node.elementType);\n\n/**\n * Checks whether a node is `readonly JsonValue[]`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is a readonly type operator wrapping a\n * `JsonValue[]` array.\n */\n\nconst isReadonlyJsonValueArrayType = (\n node: Readonly<TSESTree.TypeNode>\n): boolean => {\n if (node.type !== \"TSTypeOperator\" || node.operator !== \"readonly\") {\n return false;\n }\n\n const { typeAnnotation } = node;\n if (typeAnnotation?.type !== \"TSArrayType\") {\n return false;\n }\n\n return isJsonValueType(typeAnnotation.elementType);\n};\n\n/**\n * Checks whether a node is `Array<JsonValue>`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is the generic `Array` reference with\n * `JsonValue` as its single type argument.\n */\n\nconst isGenericJsonValueArrayType = (\n node: Readonly<TSESTree.TypeNode>\n): boolean => {\n if (!isIdentifierTypeReference(node, ARRAY_TYPE_NAME)) {\n return false;\n }\n\n const typeArguments = node.typeArguments?.params;\n if (typeArguments?.length !== 1) {\n return false;\n }\n\n const [firstTypeArgument] = typeArguments as [TSESTree.TypeNode];\n\n return isJsonValueType(firstTypeArgument);\n};\n\n/**\n * Checks whether a node is `ReadonlyArray<JsonValue>`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is the generic `ReadonlyArray` reference with\n * `JsonValue` as its single type argument.\n */\n\nconst isGenericReadonlyJsonValueArrayType = (\n node: Readonly<TSESTree.TypeNode>\n): boolean => {\n if (!isIdentifierTypeReference(node, READONLY_ARRAY_TYPE_NAME)) {\n return false;\n }\n\n const typeArguments = node.typeArguments?.params;\n if (typeArguments?.length !== 1) {\n return false;\n }\n\n const [firstTypeArgument] = typeArguments as [TSESTree.TypeNode];\n\n return isJsonValueType(firstTypeArgument);\n};\n\n/**\n * Determines whether a union matches one of the explicit JSON array forms this\n * rule can replace.\n *\n * @param node - Union node to inspect.\n *\n * @returns `true` for two-member unions equivalent to either JsonValue[] |\n * readonly JsonValue[]`or`Array<JsonValue> | ReadonlyArray<JsonValue>.\n */\n\nconst hasJsonArrayUnionShape = (\n node: Readonly<TSESTree.TSUnionType>\n): boolean => {\n if (node.types.length !== 2) {\n return false;\n }\n\n const [firstType, secondType] = node.types as [\n TSESTree.TypeNode,\n TSESTree.TypeNode,\n ];\n\n const isNativePair = (\n leftType: Readonly<TSESTree.TypeNode>,\n rightType: Readonly<TSESTree.TypeNode>\n ): boolean =>\n isJsonValueArrayType(leftType) &&\n isReadonlyJsonValueArrayType(rightType);\n const isGenericPair = (\n leftType: Readonly<TSESTree.TypeNode>,\n rightType: Readonly<TSESTree.TypeNode>\n ): boolean =>\n isGenericJsonValueArrayType(leftType) &&\n isGenericReadonlyJsonValueArrayType(rightType);\n\n if (\n isNativePair(firstType, secondType) ||\n isNativePair(secondType, firstType)\n ) {\n return true;\n }\n\n return (\n isGenericPair(firstType, secondType) ||\n isGenericPair(secondType, firstType)\n );\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-json-array`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestJsonArrayRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSUnionType(node) {\n if (!hasJsonArrayUnionShape(node)) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeReplacementFix(\n node,\n \"JsonArray\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferJsonArray\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest JsonArray over explicit JsonValue[] | readonly JsonValue[] style unions.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-json-array\",\n },\n fixable: \"code\",\n messages: {\n preferJsonArray:\n \"Prefer `JsonArray` from type-fest over explicit JsonValue array unions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-json-array\",\n });\n\n/**\n * Default export for the `prefer-type-fest-json-array` rule module.\n */\nexport default preferTypeFestJsonArrayRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-json-object`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** TypeFest JSON value alias used in equivalent object shapes. */\nconst JSON_VALUE_TYPE_NAME = \"JsonValue\";\n\n/** Built-in object utility type used by explicit JSON object aliases. */\nconst RECORD_TYPE_NAME = \"Record\";\n\n/**\n * Checks whether a type node represents a string index key.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` for `string` keyword nodes and literal `'string'` aliases.\n */\n\nconst isStringKeyType = (node: Readonly<TSESTree.TypeNode>): boolean =>\n node.type === \"TSStringKeyword\" ||\n (node.type === \"TSLiteralType\" &&\n node.literal.type === \"Literal\" &&\n node.literal.value === \"string\");\n\n/**\n * Checks whether a node references `JsonValue`.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is the identifier type reference `JsonValue`.\n */\n\nconst isJsonValueType = (node: Readonly<TSESTree.TypeNode>): boolean =>\n isIdentifierTypeReference(node, JSON_VALUE_TYPE_NAME);\n\n/**\n * Detects `Record<string, JsonValue>` style aliases.\n *\n * @param node - Type reference to inspect.\n *\n * @returns `true` when the node is a two-argument `Record` whose key type is\n * string and value type is `JsonValue`.\n */\n\nconst isRecordJsonValueReference = (\n node: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n if (!isIdentifierTypeReference(node, RECORD_TYPE_NAME)) {\n return false;\n }\n\n const typeArguments = node.typeArguments?.params;\n if (typeArguments?.length !== 2) {\n return false;\n }\n\n const [keyType, valueType] = typeArguments as [\n TSESTree.TypeNode,\n TSESTree.TypeNode,\n ];\n\n return isStringKeyType(keyType) && isJsonValueType(valueType);\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-json-object`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestJsonObjectRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (!isRecordJsonValueReference(node)) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeReplacementFix(\n node,\n \"JsonObject\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferJsonObject\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest JsonObject over equivalent Record<string, JsonValue> object aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-json-object\",\n },\n fixable: \"code\",\n messages: {\n preferJsonObject:\n \"Prefer `JsonObject` from type-fest over equivalent explicit JSON-object type shapes.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-json-object\",\n });\n\n/**\n * Default export for the `prefer-type-fest-json-object` rule module.\n */\nexport default preferTypeFestJsonObjectRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-json-primitive`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Narrows a type node to JSON-primitive keyword members.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` when the node is one of `boolean`, `null`, `number`, or\n * `string` keyword types.\n */\n\nconst isJsonPrimitiveKeywordNode = (\n node: Readonly<TSESTree.TypeNode>\n): node is\n | TSESTree.TSBooleanKeyword\n | TSESTree.TSNullKeyword\n | TSESTree.TSNumberKeyword\n | TSESTree.TSStringKeyword =>\n node.type === \"TSBooleanKeyword\" ||\n node.type === \"TSNullKeyword\" ||\n node.type === \"TSNumberKeyword\" ||\n node.type === \"TSStringKeyword\";\n\n/**\n * Detects explicit JSON primitive unions that can be replaced with\n * `JsonPrimitive`.\n *\n * @param node - Union node to inspect.\n *\n * @returns `true` when the union contains exactly the four JSON primitive\n * keyword members, regardless of order.\n */\n\nconst hasJsonPrimitiveUnionShape = (\n node: Readonly<TSESTree.TSUnionType>\n): boolean => {\n if (node.types.length !== 4) {\n return false;\n }\n\n let hasBoolean = false;\n let hasNull = false;\n let hasNumber = false;\n let hasString = false;\n\n for (const typeNode of node.types) {\n if (!isJsonPrimitiveKeywordNode(typeNode)) {\n return false;\n }\n\n if (typeNode.type === \"TSBooleanKeyword\") {\n hasBoolean = true;\n continue;\n }\n\n if (typeNode.type === \"TSNullKeyword\") {\n hasNull = true;\n continue;\n }\n\n if (typeNode.type === \"TSNumberKeyword\") {\n hasNumber = true;\n continue;\n }\n\n if (typeNode.type === \"TSStringKeyword\") {\n hasString = true;\n continue;\n }\n\n return false;\n }\n\n return hasBoolean && hasNull && hasNumber && hasString;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-json-primitive`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestJsonPrimitiveRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSUnionType(node) {\n if (!hasJsonPrimitiveUnionShape(node)) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeReplacementFix(\n node,\n \"JsonPrimitive\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferJsonPrimitive\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest JsonPrimitive over explicit null|boolean|number|string unions.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-json-primitive\",\n },\n fixable: \"code\",\n messages: {\n preferJsonPrimitive:\n \"Prefer `JsonPrimitive` from type-fest over explicit primitive JSON keyword unions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-json-primitive\",\n });\n\n/**\n * Default export for the `prefer-type-fest-json-primitive` rule module.\n */\nexport default preferTypeFestJsonPrimitiveRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-json-value`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport {\n reportWithOptionalFix,\n reportWithTypefestPolicy,\n} from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Checks whether a key type is compatible with string-indexed JSON records.\n *\n * @param node - Type node to inspect.\n *\n * @returns `true` for `string` keyword and `'string'` literal key aliases.\n */\nconst isStringLikeKeyType = (node: Readonly<TSESTree.TypeNode>): boolean =>\n node.type === \"TSStringKeyword\" ||\n (node.type === \"TSLiteralType\" &&\n node.literal.type === \"Literal\" &&\n node.literal.value === \"string\");\n\n/**\n * Detects `Record<string, unknown|any>` patterns targeted by this rule.\n *\n * @param typeNode - Type reference candidate.\n *\n * @returns `true` when the type reference matches a string-keyed record with\n * `unknown` or `any` value type.\n */\nconst isRecordLikeUnknownOrAny = (\n typeNode: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n if (\n typeNode.typeName.type !== \"Identifier\" ||\n typeNode.typeName.name !== \"Record\" ||\n typeNode.typeArguments?.params.length !== 2\n ) {\n return false;\n }\n\n const [keyType, valueType] = typeNode.typeArguments.params;\n\n return (\n isDefined(keyType) &&\n isDefined(valueType) &&\n isStringLikeKeyType(keyType) &&\n (valueType.type === \"TSUnknownKeyword\" ||\n valueType.type === \"TSAnyKeyword\")\n );\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-json-value`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestJsonValueRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (!isRecordLikeUnknownOrAny(node)) {\n return;\n }\n\n const jsonObjectSuggestionFix =\n createSafeTypeNodeReplacementFix(\n node,\n \"JsonObject\",\n typeFestDirectImports,\n TYPE_FEST_MODULE_SOURCE,\n \"suggestion\"\n );\n\n if (jsonObjectSuggestionFix === null) {\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferJsonValue\",\n node,\n });\n\n return;\n }\n\n reportWithTypefestPolicy({\n context,\n descriptor: {\n messageId: \"preferJsonValue\",\n node,\n suggest: [\n {\n fix: jsonObjectSuggestionFix,\n messageId: \"suggestJsonObject\",\n },\n ],\n },\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest JsonObject for string-keyed JSON record contract types in serialization boundaries.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-json-value\",\n },\n hasSuggestions: true,\n messages: {\n preferJsonValue:\n \"Use `JsonObject` from type-fest for string-keyed JSON record contracts in serialization boundaries instead of Record<string, unknown|any>.\",\n suggestJsonObject:\n \"Replace with `JsonObject` from type-fest (review value constraints, this may narrow accepted shapes).\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-json-value\",\n });\n\n/**\n * Default export for the `prefer-type-fest-json-value` rule module.\n */\nexport default preferTypeFestJsonValueRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-keys-of-union`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst keysOfUnionAliasReplacements = {\n AllKeys: \"KeysOfUnion\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-keys-of-union`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestKeysOfUnionRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n keysOfUnionAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferKeysOfUnion\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest KeysOfUnion over imported aliases such as AllKeys.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-keys-of-union\",\n },\n fixable: \"code\",\n messages: {\n preferKeysOfUnion:\n \"Prefer `{{replacement}}` from type-fest to derive keys from union members instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-keys-of-union\",\n });\n\n/**\n * Default export for the `prefer-type-fest-keys-of-union` rule module.\n */\nexport default preferTypeFestKeysOfUnionRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-literal-union`.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, safeCastTo } from \"ts-extras\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Primitive families supported by TypeFest `LiteralUnion`.\n */\ntype LiteralUnionFamily = \"bigint\" | \"boolean\" | \"number\" | \"string\";\n\n/**\n * Ordered family candidates evaluated when scanning union members.\n */\nconst literalUnionFamilies = [\n \"bigint\",\n \"boolean\",\n \"number\",\n \"string\",\n] as const satisfies readonly LiteralUnionFamily[];\n\n/**\n * Checks whether a union member is the primitive keyword for a family.\n *\n * @param node - Member node to inspect.\n * @param family - Primitive family currently being matched.\n *\n * @returns `true` when the node is the corresponding keyword type.\n */\nconst isKeywordMemberForFamily = (\n node: Readonly<TSESTree.TypeNode>,\n family: LiteralUnionFamily\n): boolean => {\n if (family === \"bigint\") {\n return node.type === \"TSBigIntKeyword\";\n }\n\n if (family === \"boolean\") {\n return node.type === \"TSBooleanKeyword\";\n }\n\n if (family === \"number\") {\n return node.type === \"TSNumberKeyword\";\n }\n\n return node.type === \"TSStringKeyword\";\n};\n\n/**\n * Checks whether a union member is a literal of the requested primitive family.\n *\n * @param node - Member node to inspect.\n * @param family - Primitive family currently being matched.\n *\n * @returns `true` when the node is a literal member compatible with the family\n * (including bigint parser variants).\n */\nconst isLiteralMemberForFamily = (\n node: Readonly<TSESTree.TypeNode>,\n family: LiteralUnionFamily\n): boolean => {\n if (node.type !== \"TSLiteralType\" || node.literal.type !== \"Literal\") {\n return false;\n }\n\n if (family === \"bigint\") {\n if (typeof node.literal.value === \"bigint\") {\n return true;\n }\n\n const literalWithPotentialBigInt = safeCastTo<\n TSESTree.Literal & {\n readonly bigint?: unknown;\n }\n >(node.literal);\n\n return typeof literalWithPotentialBigInt.bigint === \"string\";\n }\n\n if (family === \"boolean\") {\n return typeof node.literal.value === \"boolean\";\n }\n\n if (family === \"number\") {\n return typeof node.literal.value === \"number\";\n }\n\n return typeof node.literal.value === \"string\";\n};\n\n/**\n * Resolves which primitive family a replaceable literal union belongs to.\n *\n * @param node - Union node to inspect.\n *\n * @returns The matching family when the union has a `LiteralUnion`-compatible\n * shape; otherwise `null`.\n */\nconst getLiteralUnionFamily = (\n node: Readonly<TSESTree.TSUnionType>\n): LiteralUnionFamily | null => {\n for (const family of literalUnionFamilies) {\n let allMembersAreFamilyMembers = true;\n let hasKeywordMember = false;\n let hasLiteralMember = false;\n\n for (const unionMember of node.types) {\n if (isKeywordMemberForFamily(unionMember, family)) {\n hasKeywordMember = true;\n continue;\n }\n\n if (isLiteralMemberForFamily(unionMember, family)) {\n hasLiteralMember = true;\n continue;\n }\n\n allMembersAreFamilyMembers = false;\n break;\n }\n\n if (\n allMembersAreFamilyMembers &&\n hasKeywordMember &&\n hasLiteralMember\n ) {\n return family;\n }\n }\n\n return null;\n};\n\n/**\n * Builds `LiteralUnion<...>` text for a matched family.\n *\n * @param sourceCode - Source code instance used to preserve original literal\n * formatting.\n * @param node - Union node being replaced.\n * @param family - Primitive family for the replacement's second generic\n * argument.\n *\n * @returns Replacement text when at least one literal member exists; otherwise\n * `null`.\n */\nconst getLiteralUnionReplacementText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<TSESTree.TSUnionType>,\n family: LiteralUnionFamily\n): null | string => {\n const literalMembers = node.types.filter((member) =>\n isLiteralMemberForFamily(member, family)\n );\n\n if (literalMembers.length === 0) {\n return null;\n }\n\n const literalText =\n literalMembers.length === 1\n ? sourceCode.getText(arrayFirst(literalMembers))\n : arrayJoin(\n literalMembers.map((member) => sourceCode.getText(member)),\n \" | \"\n );\n\n return `LiteralUnion<${literalText}, ${family}>`;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-literal-union`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestLiteralUnionRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSUnionType(node) {\n const family = getLiteralUnionFamily(node);\n\n if (!family) {\n return;\n }\n\n const replacementText = getLiteralUnionReplacementText(\n context.sourceCode,\n node,\n family\n );\n\n if (\n replacementText === null ||\n replacementText.length === 0\n ) {\n return;\n }\n\n const familyAtReportTime = getLiteralUnionFamily(node);\n if (familyAtReportTime !== family) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeTextReplacementFix(\n node,\n \"LiteralUnion\",\n replacementText,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferLiteralUnion\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest LiteralUnion over unions that combine primitive keywords with same-family literal members.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-literal-union\",\n },\n fixable: \"code\",\n messages: {\n preferLiteralUnion:\n \"Prefer `LiteralUnion<...>` from type-fest over unions that mix primitive keywords and same-family literal members.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-literal-union\",\n });\n\n/**\n * Default export for the `prefer-type-fest-literal-union` rule module.\n */\nexport default preferTypeFestLiteralUnionRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-merge-exclusive`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-merge-exclusive`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestMergeExclusiveRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (\n node.typeName.type !== \"Identifier\" ||\n node.typeName.name !== \"XOR\"\n ) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n \"MergeExclusive\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferMergeExclusive\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest MergeExclusive over `XOR` aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-merge-exclusive\",\n },\n fixable: \"code\",\n messages: {\n preferMergeExclusive:\n \"Prefer `MergeExclusive` from type-fest over `XOR`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-merge-exclusive\",\n });\n\n/**\n * Default export for the `prefer-type-fest-merge-exclusive` rule module.\n */\nexport default preferTypeFestMergeExclusiveRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-non-empty-tuple`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFixPreservingReadonly,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentTypeNodes } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Tuple rest annotation node variants accepted by the parser. */\ntype RestAnnotation = TSESTree.TSRestType[\"typeAnnotation\"];\n\n/** Individual tuple element node variants used in readonly tuple checks. */\ntype TupleElement = TSESTree.TSTupleType[\"elementTypes\"][number];\n\n/**\n * Extracts the required head element type from a tuple member.\n *\n * @param element - Tuple element candidate.\n *\n * @returns The non-optional, non-rest head type node when present; otherwise\n * `null`.\n */\n\nconst getRequiredTupleElementType = (\n element: Readonly<TupleElement>\n): null | TSESTree.TypeNode => {\n if (element.type === \"TSNamedTupleMember\") {\n if (element.optional) {\n return null;\n }\n\n return element.elementType;\n }\n\n if (element.type === \"TSOptionalType\" || element.type === \"TSRestType\") {\n return null;\n }\n\n return element;\n};\n\n/**\n * Normalizes rest annotations by unwrapping named tuple members.\n *\n * @param annotation - Rest annotation to normalize.\n *\n * @returns The underlying type node represented by the annotation.\n */\n\nconst unwrapRestAnnotation = (\n annotation: Readonly<RestAnnotation>\n): null | TSESTree.TypeNode => {\n if (annotation.type === \"TSNamedTupleMember\") {\n return annotation.elementType;\n }\n\n return annotation;\n};\n\n/**\n * Extracts `T` from rest elements shaped like `...T[]`.\n *\n * @param element - Tuple element candidate.\n *\n * @returns The array element type used by a rest tuple element; otherwise\n * `null`.\n */\n\nconst getRestArrayElementType = (\n element: Readonly<TupleElement>\n): null | TSESTree.TypeNode => {\n if (element.type !== \"TSRestType\") {\n return null;\n }\n\n const restType = unwrapRestAnnotation(element.typeAnnotation);\n if (restType?.type !== \"TSArrayType\") {\n return null;\n }\n\n return restType.elementType;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-non-empty-tuple`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestNonEmptyTupleRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const { sourceCode } = context;\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSTypeOperator(node) {\n if (node.operator !== \"readonly\") {\n return;\n }\n\n const tupleType = node.typeAnnotation;\n if (tupleType?.type !== \"TSTupleType\") {\n return;\n }\n\n if (tupleType.elementTypes.length !== 2) {\n return;\n }\n\n const [firstElement, restElement] = tupleType.elementTypes;\n\n if (!firstElement || !restElement) {\n return;\n }\n\n const firstType = getRequiredTupleElementType(firstElement);\n if (!firstType) {\n return;\n }\n\n const restArrayElementType =\n getRestArrayElementType(restElement);\n if (!restArrayElementType) {\n return;\n }\n\n if (\n !areEquivalentTypeNodes(firstType, restArrayElementType)\n ) {\n return;\n }\n\n const replacementFix =\n createSafeTypeNodeTextReplacementFixPreservingReadonly(\n node,\n \"NonEmptyTuple\",\n `NonEmptyTuple<${sourceCode.getText(firstType)}>`,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferNonEmptyTuple\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest NonEmptyTuple over readonly [T, ...T[]] tuple patterns.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-non-empty-tuple\",\n },\n fixable: \"code\",\n messages: {\n preferNonEmptyTuple:\n \"Prefer `Readonly<NonEmptyTuple<T>>` from type-fest over `readonly [T, ...T[]]`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-non-empty-tuple\",\n });\n\n/**\n * Default export for the `prefer-type-fest-non-empty-tuple` rule module.\n */\nexport default preferTypeFestNonEmptyTupleRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-omit-index-signature`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst omitIndexSignatureAliasReplacements = {\n RemoveIndexSignature: \"OmitIndexSignature\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-omit-index-signature`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestOmitIndexSignatureRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n omitIndexSignatureAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferOmitIndexSignature\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest OmitIndexSignature over imported aliases such as RemoveIndexSignature.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-omit-index-signature\",\n },\n fixable: \"code\",\n messages: {\n preferOmitIndexSignature:\n \"Prefer `{{replacement}}` from type-fest to strip index signatures from object types instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-omit-index-signature\",\n });\n\n/**\n * Default export for the `prefer-type-fest-omit-index-signature` rule module.\n */\nexport default preferTypeFestOmitIndexSignatureRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-partial-deep`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-partial-deep`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestPartialDeepRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (\n node.typeName.type !== \"Identifier\" ||\n node.typeName.name !== \"DeepPartial\"\n ) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n \"PartialDeep\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferPartialDeep\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest PartialDeep over `DeepPartial` aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-partial-deep\",\n },\n fixable: \"code\",\n messages: {\n preferPartialDeep:\n \"Prefer `PartialDeep` from type-fest over `DeepPartial`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-partial-deep\",\n });\n\n/**\n * Default export for the `prefer-type-fest-partial-deep` rule module.\n */\nexport default preferTypeFestPartialDeepRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-primitive`.\n */\nimport { AST_NODE_TYPES, type TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Canonical primitive keyword node types required by `Primitive`. */\nconst primitiveKeywordTypes = [\n AST_NODE_TYPES.TSBigIntKeyword,\n AST_NODE_TYPES.TSBooleanKeyword,\n AST_NODE_TYPES.TSNullKeyword,\n AST_NODE_TYPES.TSNumberKeyword,\n AST_NODE_TYPES.TSStringKeyword,\n AST_NODE_TYPES.TSSymbolKeyword,\n AST_NODE_TYPES.TSUndefinedKeyword,\n] as const;\n\n/** Union of primitive keyword node type literals. */\ntype PrimitiveKeywordType = (typeof primitiveKeywordTypes)[number];\n\n/** Lookup set used to validate primitive-keyword union members quickly. */\nconst primitiveKeywordTypeSet = new Set<string>(primitiveKeywordTypes);\n\n/**\n * Check whether a node type string is one of the primitive keyword literals.\n */\nconst isPrimitiveKeywordType = (\n candidate: string\n): candidate is PrimitiveKeywordType =>\n setContainsValue(primitiveKeywordTypeSet, candidate);\n\n/**\n * Detects explicit unions equivalent to the TypeFest `Primitive` alias.\n *\n * @param node - Union node to inspect.\n *\n * @returns `true` when the union contains each primitive keyword type exactly\n * once, independent of order.\n */\n\nconst hasPrimitiveUnionShape = (\n node: Readonly<TSESTree.TSUnionType>\n): boolean => {\n if (node.types.length !== primitiveKeywordTypes.length) {\n return false;\n }\n\n const presentPrimitiveTypes = new Set<PrimitiveKeywordType>();\n\n for (const typeNode of node.types) {\n if (!isPrimitiveKeywordType(typeNode.type)) {\n return false;\n }\n\n presentPrimitiveTypes.add(typeNode.type);\n }\n\n return presentPrimitiveTypes.size === primitiveKeywordTypes.length;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-primitive`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestPrimitiveRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSUnionType(node) {\n if (!hasPrimitiveUnionShape(node)) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeReplacementFix(\n node,\n \"Primitive\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferPrimitive\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Primitive over explicit primitive keyword unions.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-primitive\",\n },\n fixable: \"code\",\n messages: {\n preferPrimitive:\n \"Prefer `Primitive` from type-fest over explicit primitive keyword unions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-primitive\",\n });\n\n/**\n * Default export for the `prefer-type-fest-primitive` rule module.\n */\nexport default preferTypeFestPrimitiveRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-promisable`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, isDefined } from \"ts-extras\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentTypeNodes } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\ntype PreferTypeFestPromisableOption = Readonly<{\n enforceLegacyAliases?: boolean;\n enforcePromiseUnions?: boolean;\n}>;\n\n/** Canonical TypeFest alias preferred by this rule. */\nconst PROMISABLE_TYPE_NAME = \"Promisable\";\n\n/** Built-in promise type name used for union normalization checks. */\nconst PROMISE_TYPE_NAME = \"Promise\";\n\n/** Legacy alias names that should be normalized to `Promisable`. */\nconst promisableAliasReplacements = {\n MaybePromise: \"Promisable\",\n} as const;\n\nconst defaultOption = {\n enforceLegacyAliases: true,\n enforcePromiseUnions: true,\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\n\n/**\n * Extracts the type argument from `Promise<T>` references.\n *\n * @param node - Type node to inspect.\n *\n * @returns The inner `T` node from `Promise<T>`; otherwise `null`.\n */\nconst getPromiseInnerType = (\n node: Readonly<TSESTree.TypeNode>\n): null | TSESTree.TypeNode => {\n if (!isIdentifierTypeReference(node, PROMISE_TYPE_NAME)) {\n return null;\n }\n\n const typeArguments = node.typeArguments?.params;\n if (!isDefined(typeArguments)) {\n return null;\n }\n\n return arrayFirst(typeArguments) ?? null;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-promisable`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestPromisableRule: ReturnType<typeof createTypedRule> =\n createTypedRule<\n readonly [PreferTypeFestPromisableOption],\n \"preferPromisable\"\n >({\n create(context, [options] = defaultOptions) {\n const enforceLegacyAliases = options.enforceLegacyAliases ?? true;\n const enforcePromiseUnions = options.enforcePromiseUnions ?? true;\n\n const { sourceCode } = context;\n const importedAliasMatches = collectImportedTypeAliasMatches(\n sourceCode,\n promisableAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (!enforceLegacyAliases) {\n return;\n }\n\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferPromisable\",\n node,\n });\n },\n TSUnionType(node) {\n if (!enforcePromiseUnions) {\n return;\n }\n\n if (node.types.length !== 2) {\n return;\n }\n\n const [firstMember, secondMember] = node.types;\n\n if (!firstMember || !secondMember) {\n return;\n }\n\n if (\n node.types.some((member) =>\n isIdentifierTypeReference(\n member,\n PROMISABLE_TYPE_NAME\n )\n )\n ) {\n return;\n }\n\n const firstPromiseInner = getPromiseInnerType(firstMember);\n const secondPromiseInner =\n getPromiseInnerType(secondMember);\n\n const pair =\n firstPromiseInner && !secondPromiseInner\n ? {\n promiseInner: firstPromiseInner,\n synchronousMember: secondMember,\n }\n : !firstPromiseInner && secondPromiseInner\n ? {\n promiseInner: secondPromiseInner,\n synchronousMember: firstMember,\n }\n : null;\n\n if (pair === null) {\n return;\n }\n\n const { promiseInner, synchronousMember } = pair;\n\n if (\n synchronousMember.type === \"TSNeverKeyword\" ||\n synchronousMember.type === \"TSNullKeyword\" ||\n synchronousMember.type === \"TSUndefinedKeyword\"\n ) {\n return;\n }\n\n if (\n !areEquivalentTypeNodes(promiseInner, synchronousMember)\n ) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferPromisable\",\n node,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Promisable over legacy MaybePromise aliases and Promise<T> | T unions for sync-or-async contracts.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-promisable\",\n },\n fixable: \"code\",\n messages: {\n preferPromisable:\n \"Prefer `Promisable<T>` from type-fest over `Promise<T> | T` for sync-or-async contracts.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for legacy alias and Promise-union enforcement in prefer-type-fest-promisable.\",\n minProperties: 1,\n properties: {\n enforceLegacyAliases: {\n description:\n \"Whether to report legacy imported aliases such as MaybePromise.\",\n type: \"boolean\",\n },\n enforcePromiseUnions: {\n description:\n \"Whether to report Promise<T> | T union contracts.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-promisable\",\n });\n\n/**\n * Default export for the `prefer-type-fest-promisable` rule module.\n */\nexport default preferTypeFestPromisableRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-readonly-deep`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-readonly-deep`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestReadonlyDeepRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (\n node.typeName.type !== \"Identifier\" ||\n node.typeName.name !== \"DeepReadonly\"\n ) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n \"ReadonlyDeep\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferReadonlyDeep\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest ReadonlyDeep over `DeepReadonly` aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-readonly-deep\",\n },\n fixable: \"code\",\n messages: {\n preferReadonlyDeep:\n \"Prefer `ReadonlyDeep` from type-fest over `DeepReadonly`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-readonly-deep\",\n });\n\n/**\n * Default export for the `prefer-type-fest-readonly-deep` rule module.\n */\nexport default preferTypeFestReadonlyDeepRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-require-all-or-none`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst requireAllOrNoneAliasReplacements = {\n AllOrNone: \"RequireAllOrNone\",\n AllOrNothing: \"RequireAllOrNone\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-require-all-or-none`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestRequireAllOrNoneRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n requireAllOrNoneAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferRequireAllOrNone\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest RequireAllOrNone over imported aliases such as AllOrNone/AllOrNothing.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-require-all-or-none\",\n },\n fixable: \"code\",\n messages: {\n preferRequireAllOrNone:\n \"Prefer `{{replacement}}` from type-fest to require all-or-none key groups instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-require-all-or-none\",\n });\n\n/**\n * Default export for the `prefer-type-fest-require-all-or-none` rule module.\n */\nexport default preferTypeFestRequireAllOrNoneRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-require-at-least-one`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst requireAtLeastOneAliasReplacements = {\n AtLeastOne: \"RequireAtLeastOne\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-require-at-least-one`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestRequireAtLeastOneRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n requireAtLeastOneAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferRequireAtLeastOne\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest RequireAtLeastOne over imported aliases such as AtLeastOne.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-require-at-least-one\",\n },\n fixable: \"code\",\n messages: {\n preferRequireAtLeastOne:\n \"Prefer `{{replacement}}` from type-fest to require at least one key from a group instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-require-at-least-one\",\n });\n\n/**\n * Default export for the `prefer-type-fest-require-at-least-one` rule module.\n */\nexport default preferTypeFestRequireAtLeastOneRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-require-exactly-one`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst requireExactlyOneLegacyAliases = [\"OneOf\", \"RequireOnlyOne\"] as const;\n\ntype PreferTypeFestRequireExactlyOneOption = Readonly<{\n enforcedAliasNames?: readonly (\"OneOf\" | \"RequireOnlyOne\")[];\n}>;\n\ntype RequireExactlyOneLegacyAlias =\n (typeof requireExactlyOneLegacyAliases)[number];\n\nconst defaultOption = {\n enforcedAliasNames: [...requireExactlyOneLegacyAliases],\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\n\nconst requireExactlyOneAliasReplacements = {\n OneOf: \"RequireExactlyOne\",\n RequireOnlyOne: \"RequireExactlyOne\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-require-exactly-one`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestRequireExactlyOneRule: ReturnType<typeof createTypedRule> =\n createTypedRule<\n readonly [PreferTypeFestRequireExactlyOneOption],\n \"preferRequireExactlyOne\"\n >({\n create(context, [options] = defaultOptions) {\n const enabledAliasReplacements: Partial<\n Record<RequireExactlyOneLegacyAlias, \"RequireExactlyOne\">\n > = {};\n\n for (const aliasName of options.enforcedAliasNames ??\n requireExactlyOneLegacyAliases) {\n enabledAliasReplacements[aliasName] =\n requireExactlyOneAliasReplacements[aliasName];\n }\n\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n enabledAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferRequireExactlyOne\",\n node,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require TypeFest RequireExactlyOne over imported aliases such as OneOf/RequireOnlyOne.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-require-exactly-one\",\n },\n fixable: \"code\",\n messages: {\n preferRequireExactlyOne:\n \"Prefer `{{replacement}}` from type-fest to require exactly one key from a group instead of legacy alias `{{alias}}`.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for alias names enforced by prefer-type-fest-require-exactly-one.\",\n minProperties: 1,\n properties: {\n enforcedAliasNames: {\n description:\n \"Legacy alias names to report and replace with RequireExactlyOne.\",\n items: {\n enum: [...requireExactlyOneLegacyAliases],\n type: \"string\",\n },\n minItems: 1,\n type: \"array\",\n uniqueItems: true,\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-require-exactly-one\",\n });\n\n/**\n * Default export for the `prefer-type-fest-require-exactly-one` rule module.\n */\nexport default preferTypeFestRequireExactlyOneRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-require-one-or-none`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst requireOneOrNoneAliasReplacements = {\n AtMostOne: \"RequireOneOrNone\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-require-one-or-none`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestRequireOneOrNoneRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n requireOneOrNoneAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferRequireOneOrNone\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest RequireOneOrNone over imported aliases such as AtMostOne.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-require-one-or-none\",\n },\n fixable: \"code\",\n messages: {\n preferRequireOneOrNone:\n \"Prefer `{{replacement}}` from type-fest to allow one-or-none key groups instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-require-one-or-none\",\n });\n\n/**\n * Default export for the `prefer-type-fest-require-one-or-none` rule module.\n */\nexport default preferTypeFestRequireOneOrNoneRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-required-deep`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-required-deep`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestRequiredDeepRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (\n node.typeName.type !== \"Identifier\" ||\n node.typeName.name !== \"DeepRequired\"\n ) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n \"RequiredDeep\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferRequiredDeep\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest RequiredDeep over `DeepRequired` aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-required-deep\",\n },\n fixable: \"code\",\n messages: {\n preferRequiredDeep:\n \"Prefer `RequiredDeep` from type-fest over `DeepRequired`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-required-deep\",\n });\n\n/**\n * Default export for the `prefer-type-fest-required-deep` rule module.\n */\nexport default preferTypeFestRequiredDeepRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-schema`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst schemaAliasReplacements = {\n RecordDeep: \"Schema\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-schema`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSchemaRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n schemaAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSchema\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Schema over imported aliases such as RecordDeep.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-schema\",\n },\n fixable: \"code\",\n messages: {\n preferSchema:\n \"Prefer `{{replacement}}` from type-fest to model recursive object schemas instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-schema\",\n });\n\n/**\n * Default export for the `prefer-type-fest-schema` rule module.\n */\nexport default preferTypeFestSchemaRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-set-non-nullable`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst setNonNullableAliasReplacements = {\n NonNullableBy: \"SetNonNullable\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-set-non-nullable`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSetNonNullableRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n setNonNullableAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSetNonNullable\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest SetNonNullable over imported aliases such as NonNullableBy.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-set-non-nullable\",\n },\n fixable: \"code\",\n messages: {\n preferSetNonNullable:\n \"Prefer `{{replacement}}` from type-fest to make selected keys non-nullable instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-set-non-nullable\",\n });\n\n/**\n * Default export for the `prefer-type-fest-set-non-nullable` rule module.\n */\nexport default preferTypeFestSetNonNullableRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-set-optional`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst setOptionalAliasReplacements = {\n PartialBy: \"SetOptional\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-set-optional`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSetOptionalRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n setOptionalAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSetOptional\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest SetOptional over imported alias types like PartialBy.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-set-optional\",\n },\n fixable: \"code\",\n messages: {\n preferSetOptional:\n \"Prefer `{{replacement}}` from type-fest to make selected keys optional instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-set-optional\",\n });\n\n/**\n * Default export for the `prefer-type-fest-set-optional` rule module.\n */\nexport default preferTypeFestSetOptionalRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-set-readonly`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst setReadonlyAliasReplacements = {\n ReadonlyBy: \"SetReadonly\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-set-readonly`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSetReadonlyRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n setReadonlyAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSetReadonly\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest SetReadonly over imported aliases such as ReadonlyBy.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-set-readonly\",\n },\n fixable: \"code\",\n messages: {\n preferSetReadonly:\n \"Prefer `{{replacement}}` from type-fest to mark selected keys readonly instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-set-readonly\",\n });\n\n/**\n * Default export for the `prefer-type-fest-set-readonly` rule module.\n */\nexport default preferTypeFestSetReadonlyRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-set-required`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst setRequiredAliasReplacements = {\n RequiredBy: \"SetRequired\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-set-required`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSetRequiredRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n setRequiredAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSetRequired\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest SetRequired over imported aliases such as RequiredBy.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-set-required\",\n },\n fixable: \"code\",\n messages: {\n preferSetRequired:\n \"Prefer `{{replacement}}` from type-fest to make selected keys required instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-set-required\",\n });\n\n/**\n * Default export for the `prefer-type-fest-set-required` rule module.\n */\nexport default preferTypeFestSetRequiredRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-simplify`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst simplifyAliasReplacements = {\n Expand: \"Simplify\",\n Prettify: \"Simplify\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-simplify`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestSimplifyRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n simplifyAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferSimplify\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Simplify over imported alias types like Prettify/Expand.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-simplify\",\n },\n fixable: \"code\",\n messages: {\n preferSimplify:\n \"Prefer `{{replacement}}` from type-fest to flatten resolved object and intersection types instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-simplify\",\n });\n\n/**\n * Default export for the `prefer-type-fest-simplify` rule module.\n */\nexport default preferTypeFestSimplifyRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-tagged-brands`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { setContainsValue } from \"../_internal/set-membership.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\ntype PreferTypeFestTaggedBrandsOption = Readonly<{\n enforceAdHocBrandIntersections?: boolean;\n enforceLegacyAliases?: boolean;\n}>;\n\n/** Property keys commonly used in ad-hoc branded intersections. */\nconst BRAND_PROPERTY_NAMES = new Set([\n \"__brand\",\n \"__tag\",\n \"brand\",\n]);\n/** Legacy alias names normalized by this rule to `Tagged`. */\nconst taggedAliasReplacements = {\n Branded: \"Tagged\",\n Opaque: \"Tagged\",\n} as const;\n\nconst defaultOption = {\n enforceAdHocBrandIntersections: true,\n enforceLegacyAliases: true,\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\n\n/**\n * Detects intersection members that use object-literal branding fields.\n *\n * @param typeNode - Type node to inspect.\n *\n * @returns `true` when an intersection includes a `TSTypeLiteral` with a\n * brand-like property key.\n */\n\nconst hasAdHocBrandLiteral = (\n typeNode: Readonly<TSESTree.TypeNode>\n): boolean => {\n if (typeNode.type !== \"TSIntersectionType\") {\n return false;\n }\n\n return typeNode.types.some((member) => {\n if (member.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n return member.members.some((literalMember) => {\n if (literalMember.type !== \"TSPropertySignature\") {\n return false;\n }\n\n const { key } = literalMember;\n return (\n key.type === \"Identifier\" &&\n setContainsValue(BRAND_PROPERTY_NAMES, key.name)\n );\n });\n });\n};\n\n/**\n * Recursively checks whether a type already references `Tagged`.\n *\n * @param typeNode - Type node to inspect.\n *\n * @returns `true` when the node or any nested union/intersection member is a\n * `Tagged` type reference.\n */\n\nconst typeContainsTaggedReference = (\n typeNode: Readonly<TSESTree.TypeNode>\n): boolean => {\n if (\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Tagged\"\n ) {\n return true;\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.some((member) =>\n typeContainsTaggedReference(member)\n );\n }\n\n return false;\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-tagged-brands`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestTaggedBrandsRule: ReturnType<typeof createTypedRule> =\n createTypedRule<\n readonly [PreferTypeFestTaggedBrandsOption],\n \"preferTaggedAlias\" | \"preferTaggedBrand\"\n >({\n create(context, [options] = defaultOptions) {\n const enforceAdHocBrandIntersections =\n options.enforceAdHocBrandIntersections ?? true;\n const enforceLegacyAliases = options.enforceLegacyAliases ?? true;\n\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n taggedAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSTypeAliasDeclaration(node) {\n if (!enforceAdHocBrandIntersections) {\n return;\n }\n\n if (typeContainsTaggedReference(node.typeAnnotation)) {\n return;\n }\n\n if (!hasAdHocBrandLiteral(node.typeAnnotation)) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n data: {\n alias: node.id.name,\n },\n fix: null,\n messageId: \"preferTaggedBrand\",\n node: node.id,\n });\n },\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (!enforceLegacyAliases) {\n return;\n }\n\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferTaggedAlias\",\n node,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Tagged over ad-hoc intersection branding with __brand/__tag fields.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-tagged-brands\",\n },\n fixable: \"code\",\n messages: {\n preferTaggedAlias:\n \"Prefer `{{replacement}}` from type-fest for canonical tagged-brand aliases instead of legacy alias `{{alias}}`.\",\n preferTaggedBrand:\n \"Type alias '{{alias}}' uses ad-hoc branding. Prefer `Tagged` from type-fest for branded primitive identifiers.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for tagged-brand enforcement surfaces.\",\n minProperties: 1,\n properties: {\n enforceAdHocBrandIntersections: {\n description:\n \"Whether to report ad-hoc branded intersections using __brand/__tag/brand fields.\",\n type: \"boolean\",\n },\n enforceLegacyAliases: {\n description:\n \"Whether to report imported legacy branded aliases such as Opaque and Branded.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-tagged-brands\",\n });\n\n/**\n * Default export for the `prefer-type-fest-tagged-brands` rule module.\n */\nexport default preferTypeFestTaggedBrandsRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-tuple-of`.\n */\nimport type { TSESLint, TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeNodeTextReplacementFix,\n isTypeParameterNameShadowed,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst tupleOfLegacyAliases = [\"ReadonlyTuple\", \"Tuple\"] as const;\n\ntype PreferTypeFestTupleOfOption = Readonly<{\n enforcedAliasNames?: readonly (\"ReadonlyTuple\" | \"Tuple\")[];\n}>;\n\ntype TupleOfLegacyAlias = (typeof tupleOfLegacyAliases)[number];\n\nconst defaultOption = {\n enforcedAliasNames: [\"ReadonlyTuple\", \"Tuple\"],\n} as const;\n\nconst defaultOptions = [defaultOption] as const;\n\n/**\n * Legacy tuple aliases this rule normalizes to `TupleOf` forms.\n */\nconst tupleOfAliasReplacements = {\n ReadonlyTuple: \"Readonly<TupleOf<Length, Element>>\",\n Tuple: \"TupleOf<Length, Element>\",\n} as const;\n\n/**\n * Builds replacement text that preserves readonly semantics for legacy tuple\n * aliases.\n *\n * @param importedAliasName - Alias name detected in source.\n * @param lengthTypeText - Serialized tuple length type argument.\n * @param elementTypeText - Serialized tuple element type argument.\n *\n * @returns Replacement text using canonical `TupleOf` syntax.\n */\nconst createTupleOfReplacementText = (\n importedAliasName: string,\n lengthTypeText: string,\n elementTypeText: string\n): string =>\n importedAliasName === \"ReadonlyTuple\"\n ? `Readonly<TupleOf<${lengthTypeText}, ${elementTypeText}>>`\n : `TupleOf<${lengthTypeText}, ${elementTypeText}>`;\n\n/**\n * ESLint rule definition for `prefer-type-fest-tuple-of`.\n *\n * @remarks\n * Defines metadata, diagnostics, and fixes for replacing legacy tuple aliases\n * with canonical `TupleOf` forms.\n */\nconst preferTypeFestTupleOfRule: ReturnType<typeof createTypedRule> =\n createTypedRule<readonly [PreferTypeFestTupleOfOption], \"preferTupleOf\">({\n create(context, [options] = defaultOptions) {\n const enabledAliasReplacements: Partial<\n Record<TupleOfLegacyAlias, string>\n > = {};\n\n for (const aliasName of options.enforcedAliasNames ??\n tupleOfLegacyAliases) {\n enabledAliasReplacements[aliasName] =\n tupleOfAliasReplacements[aliasName];\n }\n\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n enabledAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const tupleTypeParameters = node.typeArguments?.params;\n let fix: null | TSESLint.ReportFixFunction = null;\n\n if (tupleTypeParameters?.length === 2) {\n const [elementType, lengthType] = tupleTypeParameters;\n const elementTypeText =\n context.sourceCode.getText(elementType);\n const lengthTypeText =\n context.sourceCode.getText(lengthType);\n const usesReadonlyWrapper =\n importedAliasMatch.importedName === \"ReadonlyTuple\";\n\n if (\n !usesReadonlyWrapper ||\n !isTypeParameterNameShadowed(node, \"Readonly\")\n ) {\n const replacementText =\n createTupleOfReplacementText(\n importedAliasMatch.importedName,\n lengthTypeText,\n elementTypeText\n );\n\n fix = createSafeTypeNodeTextReplacementFix(\n node,\n \"TupleOf\",\n replacementText,\n typeFestDirectImports\n );\n }\n }\n\n const reportData = {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n };\n\n reportWithOptionalFix({\n context,\n data: reportData,\n fix,\n messageId: \"preferTupleOf\",\n node,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [defaultOption],\n deprecated: false,\n docs: {\n description:\n \"require TypeFest TupleOf over imported aliases such as ReadonlyTuple and Tuple.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-tuple-of\",\n },\n fixable: \"code\",\n messages: {\n preferTupleOf:\n \"Prefer `{{replacement}}` from type-fest to model fixed-length homogeneous tuples instead of legacy alias `{{alias}}`.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for alias names enforced by prefer-type-fest-tuple-of.\",\n minProperties: 1,\n properties: {\n enforcedAliasNames: {\n description:\n \"Legacy alias names to report and replace with TupleOf forms.\",\n items: {\n enum: [...tupleOfLegacyAliases],\n type: \"string\",\n },\n minItems: 1,\n type: \"array\",\n uniqueItems: true,\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-tuple-of\",\n });\n\n/**\n * Default export for the `prefer-type-fest-tuple-of` rule module.\n */\nexport default preferTypeFestTupleOfRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-unknown-array`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFixPreservingReadonly,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Built-in readonly array type targeted by this rule. */\nconst READONLY_ARRAY_TYPE_NAME = \"ReadonlyArray\";\n\n/** Preferred TypeFest alias for readonly arrays of unknown values. */\nconst UNKNOWN_ARRAY_TYPE_NAME = \"UnknownArray\";\n\n/**\n * Checks whether a generic type reference has exactly one `unknown` argument.\n *\n * @param node - Type reference candidate.\n *\n * @returns `true` when the reference shape is `<unknown>`.\n */\n\nconst hasSingleUnknownTypeArgument = (\n node: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n const typeArguments = node.typeArguments?.params ?? [];\n\n if (typeArguments.length !== 1) {\n return false;\n }\n\n const [firstTypeArgument] = typeArguments;\n return firstTypeArgument?.type === \"TSUnknownKeyword\";\n};\n\n/**\n * Detects `readonly unknown[]` type-operator syntax.\n *\n * @param node - Type-operator node to inspect.\n *\n * @returns `true` when the node is a readonly operator around an array type\n * whose element type is `unknown`.\n */\n\nconst isReadonlyUnknownArrayType = (\n node: Readonly<TSESTree.TSTypeOperator>\n): boolean => {\n if (node.operator !== \"readonly\") {\n return false;\n }\n\n const { typeAnnotation } = node;\n if (typeAnnotation?.type !== \"TSArrayType\") {\n return false;\n }\n\n return typeAnnotation.elementType.type === \"TSUnknownKeyword\";\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-unknown-array`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestUnknownArrayRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSTypeOperator(node) {\n if (!isReadonlyUnknownArrayType(node)) {\n return;\n }\n\n const replacementFix =\n createSafeTypeNodeReplacementFixPreservingReadonly(\n node,\n UNKNOWN_ARRAY_TYPE_NAME,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferUnknownArray\",\n node,\n });\n },\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (\n !isIdentifierTypeReference(\n node,\n READONLY_ARRAY_TYPE_NAME\n )\n ) {\n return;\n }\n\n if (!hasSingleUnknownTypeArgument(node)) {\n return;\n }\n\n const replacementFix =\n createSafeTypeNodeReplacementFixPreservingReadonly(\n node,\n UNKNOWN_ARRAY_TYPE_NAME,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferUnknownArray\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest UnknownArray over readonly unknown[] and ReadonlyArray<unknown> aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-unknown-array\",\n },\n fixable: \"code\",\n messages: {\n preferUnknownArray:\n \"Prefer `Readonly<UnknownArray>` from type-fest over `readonly unknown[]` or `ReadonlyArray<unknown>`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-unknown-array\",\n });\n\n/**\n * Default export for the `prefer-type-fest-unknown-array` rule module.\n */\nexport default preferTypeFestUnknownArrayRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-unknown-map`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFixPreservingReadonly,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Built-in map alias targeted by this rule. */\nconst READONLY_MAP_TYPE_NAME = \"ReadonlyMap\";\n\n/** Preferred TypeFest alias for readonly unknown-key/unknown-value maps. */\nconst UNKNOWN_MAP_TYPE_NAME = \"UnknownMap\";\n\n/**\n * Checks whether a map type reference is parameterized as `<unknown, unknown>`.\n *\n * @param node - Type reference candidate.\n *\n * @returns `true` when both map type arguments are `unknown`.\n */\nconst hasUnknownMapTypeArguments = (\n node: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n const typeArguments = node.typeArguments?.params ?? [];\n\n if (typeArguments.length !== 2) {\n return false;\n }\n\n const [firstTypeArgument, secondTypeArgument] = typeArguments;\n\n return (\n firstTypeArgument?.type === \"TSUnknownKeyword\" &&\n secondTypeArgument?.type === \"TSUnknownKeyword\"\n );\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-unknown-map`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestUnknownMapRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (\n !isIdentifierTypeReference(node, READONLY_MAP_TYPE_NAME)\n ) {\n return;\n }\n\n if (!hasUnknownMapTypeArguments(node)) {\n return;\n }\n\n const replacementFix =\n createSafeTypeNodeTextReplacementFixPreservingReadonly(\n node,\n UNKNOWN_MAP_TYPE_NAME,\n UNKNOWN_MAP_TYPE_NAME,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferUnknownMap\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest UnknownMap over ReadonlyMap<unknown, unknown> aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-unknown-map\",\n },\n fixable: \"code\",\n messages: {\n preferUnknownMap:\n \"Prefer `Readonly<UnknownMap>` from type-fest over `ReadonlyMap<unknown, unknown>`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-unknown-map\",\n });\n\n/**\n * Default export for the `prefer-type-fest-unknown-map` rule module.\n */\nexport default preferTypeFestUnknownMapRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-unknown-record`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * Detects `Record<string, unknown>` references.\n *\n * @param node - Type reference candidate.\n *\n * @returns `true` when the node is a two-argument `Record` with `string` keys\n * and `unknown` values.\n */\n\nconst isRecordStringUnknown = (\n node: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n if (\n node.typeName.type !== \"Identifier\" ||\n node.typeName.name !== \"Record\" ||\n node.typeArguments?.params.length !== 2\n ) {\n return false;\n }\n\n const [keyType, valueType] = node.typeArguments.params;\n return (\n keyType?.type === \"TSStringKeyword\" &&\n valueType?.type === \"TSUnknownKeyword\"\n );\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-unknown-record`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestUnknownRecordRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (!isRecordStringUnknown(node)) {\n return;\n }\n\n const replacementFix = createSafeTypeNodeReplacementFix(\n node,\n \"UnknownRecord\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferUnknownRecord\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest UnknownRecord over Record<string, unknown> in architecture-critical layers.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.minimal\",\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-unknown-record\",\n },\n fixable: \"code\",\n messages: {\n preferUnknownRecord:\n \"Prefer `UnknownRecord` from type-fest over `Record<string, unknown>` for clearer intent and stronger shared typing conventions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-unknown-record\",\n });\n\n/**\n * Default export for the `prefer-type-fest-unknown-record` rule module.\n */\nexport default preferTypeFestUnknownRecordRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-unknown-set`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFixPreservingReadonly,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { isIdentifierTypeReference } from \"../_internal/type-reference-node.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Built-in set alias targeted by this rule. */\nconst READONLY_SET_TYPE_NAME = \"ReadonlySet\";\n\n/** Preferred TypeFest alias for readonly sets of unknown values. */\nconst UNKNOWN_SET_TYPE_NAME = \"UnknownSet\";\n\n/**\n * Checks whether a generic type reference has exactly one `unknown` argument.\n *\n * @param node - Type reference candidate.\n *\n * @returns `true` when the reference shape is `<unknown>`.\n */\n\nconst hasSingleUnknownTypeArgument = (\n node: Readonly<TSESTree.TSTypeReference>\n): boolean => {\n const typeArguments = node.typeArguments?.params ?? [];\n\n if (typeArguments.length !== 1) {\n return false;\n }\n\n const [firstTypeArgument] = typeArguments;\n return firstTypeArgument?.type === \"TSUnknownKeyword\";\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-unknown-set`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestUnknownSetRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(node) {\n if (\n !isIdentifierTypeReference(node, READONLY_SET_TYPE_NAME)\n ) {\n return;\n }\n\n if (!hasSingleUnknownTypeArgument(node)) {\n return;\n }\n\n const replacementFix =\n createSafeTypeNodeTextReplacementFixPreservingReadonly(\n node,\n UNKNOWN_SET_TYPE_NAME,\n UNKNOWN_SET_TYPE_NAME,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: replacementFix,\n messageId: \"preferUnknownSet\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest UnknownSet over ReadonlySet<unknown> aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-unknown-set\",\n },\n fixable: \"code\",\n messages: {\n preferUnknownSet:\n \"Prefer `Readonly<UnknownSet>` from type-fest over `ReadonlySet<unknown>`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-unknown-set\",\n });\n\n/**\n * Default export for the `prefer-type-fest-unknown-set` rule module.\n */\nexport default preferTypeFestUnknownSetRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-unwrap-tagged`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\nconst unwrapTaggedAliasReplacements = {\n UnwrapOpaque: \"UnwrapTagged\",\n} as const;\n\n/**\n * ESLint rule definition for `prefer-type-fest-unwrap-tagged`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestUnwrapTaggedRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const importedAliasMatches = collectImportedTypeAliasMatches(\n context.sourceCode,\n unwrapTaggedAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferUnwrapTagged\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest UnwrapTagged over imported aliases such as UnwrapOpaque.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-unwrap-tagged\",\n },\n fixable: \"code\",\n messages: {\n preferUnwrapTagged:\n \"Prefer `{{replacement}}` from type-fest to unwrap Tagged/Opaque values instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-unwrap-tagged\",\n });\n\n/**\n * Default export for the `prefer-type-fest-unwrap-tagged` rule module.\n */\nexport default preferTypeFestUnwrapTaggedRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-value-of`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeNodeTextReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentTypeNodes } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-value-of`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestValueOfRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const { sourceCode } = context;\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSIndexedAccessType(node) {\n if (\n node.indexType.type !== \"TSTypeOperator\" ||\n node.indexType.operator !== \"keyof\"\n ) {\n return;\n }\n\n const keyOfTargetType = node.indexType.typeAnnotation;\n /* v8 ignore start */\n if (!keyOfTargetType) {\n return;\n }\n /* v8 ignore stop */\n\n if (\n !areEquivalentTypeNodes(\n node.objectType,\n keyOfTargetType\n )\n ) {\n return;\n }\n\n const fix = createSafeTypeNodeTextReplacementFix(\n node,\n \"ValueOf\",\n `ValueOf<${sourceCode.getText(node.objectType)}>`,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix,\n messageId: \"preferValueOf\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest ValueOf over direct T[keyof T] indexed-access unions for object value extraction.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-value-of\",\n },\n fixable: \"code\",\n messages: {\n preferValueOf:\n \"Prefer `ValueOf<T>` from type-fest over `T[keyof T]` for object value unions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-value-of\",\n });\n\n/**\n * Default export for the `prefer-type-fest-value-of` rule module.\n */\nexport default preferTypeFestValueOfRule;\n", "import type { TSESTree } from \"@typescript-eslint/utils\";\n\n/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-writable-deep`.\n */\nimport {\n collectDirectNamedImportsFromSource,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/**\n * ESLint rule definition for `prefer-type-fest-writable-deep`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestWritableDeepRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n context.sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (\n node.typeName.type !== \"Identifier\" ||\n (node.typeName.name !== \"DeepMutable\" &&\n node.typeName.name !== \"MutableDeep\")\n ) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n \"WritableDeep\",\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n fix: aliasReplacementFix,\n messageId: \"preferWritableDeep\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest WritableDeep over `DeepMutable` and `MutableDeep` aliases.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-writable-deep\",\n },\n fixable: \"code\",\n messages: {\n preferWritableDeep:\n \"Prefer `WritableDeep` from type-fest over `DeepMutable`/`MutableDeep`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-writable-deep\",\n });\n\n/**\n * Default export for the `prefer-type-fest-writable-deep` rule module.\n */\nexport default preferTypeFestWritableDeepRule;\n", "/**\n * @packageDocumentation\n * ESLint rule implementation for `prefer-type-fest-writable`.\n */\nimport type { TSESTree } from \"@typescript-eslint/utils\";\n\nimport {\n collectDirectNamedImportsFromSource,\n collectImportedTypeAliasMatches,\n createSafeTypeReferenceReplacementFix,\n} from \"../_internal/imported-type-aliases.js\";\nimport { TYPE_FEST_MODULE_SOURCE } from \"../_internal/module-source.js\";\nimport { areEquivalentTypeNodes } from \"../_internal/normalize-expression-text.js\";\nimport { reportWithOptionalFix } from \"../_internal/rule-reporting.js\";\nimport { createTypedRule } from \"../_internal/typed-rule.js\";\n\n/** Legacy alias names normalized by this rule to `Writable`. */\nconst writableAliasReplacements = {\n Mutable: \"Writable\",\n} as const;\n\n/**\n * Detects mapped types equivalent to `Writable<T>`.\n *\n * @param node - Mapped type node to inspect.\n *\n * @returns `true` when the mapped type removes `readonly` via `-readonly` and\n * preserves property optionality and values as `T[K]`.\n */\nconst hasWritableMappedTypeShape = (\n node: Readonly<TSESTree.TSMappedType>\n): boolean => {\n if (node.readonly !== \"-\") {\n return false;\n }\n\n if (node.optional !== false) {\n return false;\n }\n\n if (node.nameType !== null) {\n return false;\n }\n\n const { constraint } = node;\n if (constraint?.type !== \"TSTypeOperator\") {\n return false;\n }\n\n if (constraint.operator !== \"keyof\") {\n return false;\n }\n\n const baseType = constraint.typeAnnotation;\n if (!baseType) {\n return false;\n }\n\n const { typeAnnotation } = node;\n if (typeAnnotation?.type !== \"TSIndexedAccessType\") {\n return false;\n }\n\n if (!areEquivalentTypeNodes(typeAnnotation.objectType, baseType)) {\n return false;\n }\n\n const { indexType } = typeAnnotation;\n if (\n indexType.type !== \"TSTypeReference\" ||\n indexType.typeName.type !== \"Identifier\"\n ) {\n return false;\n }\n\n return (\n node.key.type === \"Identifier\" &&\n indexType.typeName.name === node.key.name\n );\n};\n\n/**\n * ESLint rule definition for `prefer-type-fest-writable`.\n *\n * @remarks\n * Defines metadata, diagnostics, and suggestions/fixes for this rule.\n */\nconst preferTypeFestWritableRule: ReturnType<typeof createTypedRule> =\n createTypedRule({\n create(context) {\n const { sourceCode } = context;\n const importedAliasMatches = collectImportedTypeAliasMatches(\n sourceCode,\n writableAliasReplacements\n );\n const typeFestDirectImports = collectDirectNamedImportsFromSource(\n sourceCode,\n TYPE_FEST_MODULE_SOURCE\n );\n\n return {\n TSMappedType(node) {\n if (!hasWritableMappedTypeShape(node)) {\n return;\n }\n\n reportWithOptionalFix({\n context,\n fix: null,\n messageId: \"preferWritable\",\n node,\n });\n },\n 'TSTypeReference[typeName.type=\"Identifier\"]'(\n node: TSESTree.TSTypeReference\n ) {\n if (node.typeName.type !== \"Identifier\") {\n return;\n }\n\n const importedAliasMatch = importedAliasMatches.get(\n node.typeName.name\n );\n if (!importedAliasMatch) {\n return;\n }\n\n const aliasReplacementFix =\n createSafeTypeReferenceReplacementFix(\n node,\n importedAliasMatch.replacementName,\n typeFestDirectImports\n );\n\n reportWithOptionalFix({\n context,\n data: {\n alias: importedAliasMatch.importedName,\n replacement: importedAliasMatch.replacementName,\n },\n fix: aliasReplacementFix,\n messageId: \"preferWritableAlias\",\n node,\n });\n },\n };\n },\n defaultOptions: [],\n meta: {\n deprecated: false,\n docs: {\n description:\n \"require TypeFest Writable over manual mapped types that strip readonly with -readonly.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: false,\n typefestConfigs: [\n \"typefest.configs.recommended\",\n \"typefest.configs.strict\",\n \"typefest.configs.all\",\n \"typefest.configs.type-fest/types\",\n ],\n url: \"https://nick2bad4u.github.io/eslint-plugin-typefest/docs/rules/prefer-type-fest-writable\",\n },\n fixable: \"code\",\n messages: {\n preferWritable:\n \"Prefer `Writable<T>` from type-fest over `{-readonly [K in keyof T]: T[K]}`.\",\n preferWritableAlias:\n \"Prefer `{{replacement}}` from type-fest to remove readonly modifiers from selected keys instead of legacy alias `{{alias}}`.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-type-fest-writable\",\n });\n\n/**\n * Default export for the `prefer-type-fest-writable` rule module.\n */\nexport default preferTypeFestWritableRule;\n", "/**\n * @packageDocumentation\n * Canonical runtime registry of all rule modules shipped by eslint-plugin-typefest.\n */\n\nimport type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport preferTsExtrasArrayAtRule from \"../rules/prefer-ts-extras-array-at.js\";\nimport preferTsExtrasArrayConcatRule from \"../rules/prefer-ts-extras-array-concat.js\";\nimport preferTsExtrasArrayFindLastIndexRule from \"../rules/prefer-ts-extras-array-find-last-index.js\";\nimport preferTsExtrasArrayFindLastRule from \"../rules/prefer-ts-extras-array-find-last.js\";\nimport preferTsExtrasArrayFindRule from \"../rules/prefer-ts-extras-array-find.js\";\nimport preferTsExtrasArrayFirstRule from \"../rules/prefer-ts-extras-array-first.js\";\nimport preferTsExtrasArrayIncludesRule from \"../rules/prefer-ts-extras-array-includes.js\";\nimport preferTsExtrasArrayJoinRule from \"../rules/prefer-ts-extras-array-join.js\";\nimport preferTsExtrasArrayLastRule from \"../rules/prefer-ts-extras-array-last.js\";\nimport preferTsExtrasAsWritableRule from \"../rules/prefer-ts-extras-as-writable.js\";\nimport preferTsExtrasAssertDefinedRule from \"../rules/prefer-ts-extras-assert-defined.js\";\nimport preferTsExtrasAssertErrorRule from \"../rules/prefer-ts-extras-assert-error.js\";\nimport preferTsExtrasAssertPresentRule from \"../rules/prefer-ts-extras-assert-present.js\";\nimport preferTsExtrasIsDefinedFilterRule from \"../rules/prefer-ts-extras-is-defined-filter.js\";\nimport preferTsExtrasIsDefinedRule from \"../rules/prefer-ts-extras-is-defined.js\";\nimport preferTsExtrasIsEmptyRule from \"../rules/prefer-ts-extras-is-empty.js\";\nimport preferTsExtrasIsEqualTypeRule from \"../rules/prefer-ts-extras-is-equal-type.js\";\nimport preferTsExtrasIsFiniteRule from \"../rules/prefer-ts-extras-is-finite.js\";\nimport preferTsExtrasIsInfiniteRule from \"../rules/prefer-ts-extras-is-infinite.js\";\nimport preferTsExtrasIsIntegerRule from \"../rules/prefer-ts-extras-is-integer.js\";\nimport preferTsExtrasIsPresentFilterRule from \"../rules/prefer-ts-extras-is-present-filter.js\";\nimport preferTsExtrasIsPresentRule from \"../rules/prefer-ts-extras-is-present.js\";\nimport preferTsExtrasIsSafeIntegerRule from \"../rules/prefer-ts-extras-is-safe-integer.js\";\nimport preferTsExtrasKeyInRule from \"../rules/prefer-ts-extras-key-in.js\";\nimport preferTsExtrasNotRule from \"../rules/prefer-ts-extras-not.js\";\nimport preferTsExtrasObjectEntriesRule from \"../rules/prefer-ts-extras-object-entries.js\";\nimport preferTsExtrasObjectFromEntriesRule from \"../rules/prefer-ts-extras-object-from-entries.js\";\nimport preferTsExtrasObjectHasInRule from \"../rules/prefer-ts-extras-object-has-in.js\";\nimport preferTsExtrasObjectHasOwnRule from \"../rules/prefer-ts-extras-object-has-own.js\";\nimport preferTsExtrasObjectKeysRule from \"../rules/prefer-ts-extras-object-keys.js\";\nimport preferTsExtrasObjectValuesRule from \"../rules/prefer-ts-extras-object-values.js\";\nimport preferTsExtrasSafeCastToRule from \"../rules/prefer-ts-extras-safe-cast-to.js\";\nimport preferTsExtrasSetHasRule from \"../rules/prefer-ts-extras-set-has.js\";\nimport preferTsExtrasStringSplitRule from \"../rules/prefer-ts-extras-string-split.js\";\nimport preferTypeFestAbstractConstructorRule from \"../rules/prefer-type-fest-abstract-constructor.js\";\nimport preferTypeFestArrayableRule from \"../rules/prefer-type-fest-arrayable.js\";\nimport preferTypeFestAsyncReturnTypeRule from \"../rules/prefer-type-fest-async-return-type.js\";\nimport preferTypeFestConditionalPickRule from \"../rules/prefer-type-fest-conditional-pick.js\";\nimport preferTypeFestConstructorRule from \"../rules/prefer-type-fest-constructor.js\";\nimport preferTypeFestExceptRule from \"../rules/prefer-type-fest-except.js\";\nimport preferTypeFestIfRule from \"../rules/prefer-type-fest-if.js\";\nimport preferTypeFestIterableElementRule from \"../rules/prefer-type-fest-iterable-element.js\";\nimport preferTypeFestJsonArrayRule from \"../rules/prefer-type-fest-json-array.js\";\nimport preferTypeFestJsonObjectRule from \"../rules/prefer-type-fest-json-object.js\";\nimport preferTypeFestJsonPrimitiveRule from \"../rules/prefer-type-fest-json-primitive.js\";\nimport preferTypeFestJsonValueRule from \"../rules/prefer-type-fest-json-value.js\";\nimport preferTypeFestKeysOfUnionRule from \"../rules/prefer-type-fest-keys-of-union.js\";\nimport preferTypeFestLiteralUnionRule from \"../rules/prefer-type-fest-literal-union.js\";\nimport preferTypeFestMergeExclusiveRule from \"../rules/prefer-type-fest-merge-exclusive.js\";\nimport preferTypeFestNonEmptyTupleRule from \"../rules/prefer-type-fest-non-empty-tuple.js\";\nimport preferTypeFestOmitIndexSignatureRule from \"../rules/prefer-type-fest-omit-index-signature.js\";\nimport preferTypeFestPartialDeepRule from \"../rules/prefer-type-fest-partial-deep.js\";\nimport preferTypeFestPrimitiveRule from \"../rules/prefer-type-fest-primitive.js\";\nimport preferTypeFestPromisableRule from \"../rules/prefer-type-fest-promisable.js\";\nimport preferTypeFestReadonlyDeepRule from \"../rules/prefer-type-fest-readonly-deep.js\";\nimport preferTypeFestRequireAllOrNoneRule from \"../rules/prefer-type-fest-require-all-or-none.js\";\nimport preferTypeFestRequireAtLeastOneRule from \"../rules/prefer-type-fest-require-at-least-one.js\";\nimport preferTypeFestRequireExactlyOneRule from \"../rules/prefer-type-fest-require-exactly-one.js\";\nimport preferTypeFestRequireOneOrNoneRule from \"../rules/prefer-type-fest-require-one-or-none.js\";\nimport preferTypeFestRequiredDeepRule from \"../rules/prefer-type-fest-required-deep.js\";\nimport preferTypeFestSchemaRule from \"../rules/prefer-type-fest-schema.js\";\nimport preferTypeFestSetNonNullableRule from \"../rules/prefer-type-fest-set-non-nullable.js\";\nimport preferTypeFestSetOptionalRule from \"../rules/prefer-type-fest-set-optional.js\";\nimport preferTypeFestSetReadonlyRule from \"../rules/prefer-type-fest-set-readonly.js\";\nimport preferTypeFestSetRequiredRule from \"../rules/prefer-type-fest-set-required.js\";\nimport preferTypeFestSimplifyRule from \"../rules/prefer-type-fest-simplify.js\";\nimport preferTypeFestTaggedBrandsRule from \"../rules/prefer-type-fest-tagged-brands.js\";\nimport preferTypeFestTupleOfRule from \"../rules/prefer-type-fest-tuple-of.js\";\nimport preferTypeFestUnknownArrayRule from \"../rules/prefer-type-fest-unknown-array.js\";\nimport preferTypeFestUnknownMapRule from \"../rules/prefer-type-fest-unknown-map.js\";\nimport preferTypeFestUnknownRecordRule from \"../rules/prefer-type-fest-unknown-record.js\";\nimport preferTypeFestUnknownSetRule from \"../rules/prefer-type-fest-unknown-set.js\";\nimport preferTypeFestUnwrapTaggedRule from \"../rules/prefer-type-fest-unwrap-tagged.js\";\nimport preferTypeFestValueOfRule from \"../rules/prefer-type-fest-value-of.js\";\nimport preferTypeFestWritableDeepRule from \"../rules/prefer-type-fest-writable-deep.js\";\nimport preferTypeFestWritableRule from \"../rules/prefer-type-fest-writable.js\";\n\n/** Runtime rule module shape used by registry/preset builders. */\nexport type RuleWithDocs = TSESLint.RuleModule<string, UnknownArray>;\n\n/** Pattern for unqualified rule names supported by `eslint-plugin-typefest`. */\nexport type TypefestRuleNamePattern = `prefer-${string}`;\n\n/**\n * Runtime map of all rule modules keyed by unqualified rule name.\n */\nconst typefestRuleRegistry: Readonly<\n Record<TypefestRuleNamePattern, RuleWithDocs>\n> = {\n \"prefer-ts-extras-array-at\": preferTsExtrasArrayAtRule,\n \"prefer-ts-extras-array-concat\": preferTsExtrasArrayConcatRule,\n \"prefer-ts-extras-array-find\": preferTsExtrasArrayFindRule,\n \"prefer-ts-extras-array-find-last\": preferTsExtrasArrayFindLastRule,\n \"prefer-ts-extras-array-find-last-index\":\n preferTsExtrasArrayFindLastIndexRule,\n \"prefer-ts-extras-array-first\": preferTsExtrasArrayFirstRule,\n \"prefer-ts-extras-array-includes\": preferTsExtrasArrayIncludesRule,\n \"prefer-ts-extras-array-join\": preferTsExtrasArrayJoinRule,\n \"prefer-ts-extras-array-last\": preferTsExtrasArrayLastRule,\n \"prefer-ts-extras-as-writable\": preferTsExtrasAsWritableRule,\n \"prefer-ts-extras-assert-defined\": preferTsExtrasAssertDefinedRule,\n \"prefer-ts-extras-assert-error\": preferTsExtrasAssertErrorRule,\n \"prefer-ts-extras-assert-present\": preferTsExtrasAssertPresentRule,\n \"prefer-ts-extras-is-defined\": preferTsExtrasIsDefinedRule,\n \"prefer-ts-extras-is-defined-filter\": preferTsExtrasIsDefinedFilterRule,\n \"prefer-ts-extras-is-empty\": preferTsExtrasIsEmptyRule,\n \"prefer-ts-extras-is-equal-type\": preferTsExtrasIsEqualTypeRule,\n \"prefer-ts-extras-is-finite\": preferTsExtrasIsFiniteRule,\n \"prefer-ts-extras-is-infinite\": preferTsExtrasIsInfiniteRule,\n \"prefer-ts-extras-is-integer\": preferTsExtrasIsIntegerRule,\n \"prefer-ts-extras-is-present\": preferTsExtrasIsPresentRule,\n \"prefer-ts-extras-is-present-filter\": preferTsExtrasIsPresentFilterRule,\n \"prefer-ts-extras-is-safe-integer\": preferTsExtrasIsSafeIntegerRule,\n \"prefer-ts-extras-key-in\": preferTsExtrasKeyInRule,\n \"prefer-ts-extras-not\": preferTsExtrasNotRule,\n \"prefer-ts-extras-object-entries\": preferTsExtrasObjectEntriesRule,\n \"prefer-ts-extras-object-from-entries\": preferTsExtrasObjectFromEntriesRule,\n \"prefer-ts-extras-object-has-in\": preferTsExtrasObjectHasInRule,\n \"prefer-ts-extras-object-has-own\": preferTsExtrasObjectHasOwnRule,\n \"prefer-ts-extras-object-keys\": preferTsExtrasObjectKeysRule,\n \"prefer-ts-extras-object-values\": preferTsExtrasObjectValuesRule,\n \"prefer-ts-extras-safe-cast-to\": preferTsExtrasSafeCastToRule,\n \"prefer-ts-extras-set-has\": preferTsExtrasSetHasRule,\n \"prefer-ts-extras-string-split\": preferTsExtrasStringSplitRule,\n \"prefer-type-fest-abstract-constructor\":\n preferTypeFestAbstractConstructorRule,\n \"prefer-type-fest-arrayable\": preferTypeFestArrayableRule,\n \"prefer-type-fest-async-return-type\": preferTypeFestAsyncReturnTypeRule,\n \"prefer-type-fest-conditional-pick\": preferTypeFestConditionalPickRule,\n \"prefer-type-fest-constructor\": preferTypeFestConstructorRule,\n \"prefer-type-fest-except\": preferTypeFestExceptRule,\n \"prefer-type-fest-if\": preferTypeFestIfRule,\n \"prefer-type-fest-iterable-element\": preferTypeFestIterableElementRule,\n \"prefer-type-fest-json-array\": preferTypeFestJsonArrayRule,\n \"prefer-type-fest-json-object\": preferTypeFestJsonObjectRule,\n \"prefer-type-fest-json-primitive\": preferTypeFestJsonPrimitiveRule,\n \"prefer-type-fest-json-value\": preferTypeFestJsonValueRule,\n \"prefer-type-fest-keys-of-union\": preferTypeFestKeysOfUnionRule,\n \"prefer-type-fest-literal-union\": preferTypeFestLiteralUnionRule,\n \"prefer-type-fest-merge-exclusive\": preferTypeFestMergeExclusiveRule,\n \"prefer-type-fest-non-empty-tuple\": preferTypeFestNonEmptyTupleRule,\n \"prefer-type-fest-omit-index-signature\":\n preferTypeFestOmitIndexSignatureRule,\n \"prefer-type-fest-partial-deep\": preferTypeFestPartialDeepRule,\n \"prefer-type-fest-primitive\": preferTypeFestPrimitiveRule,\n \"prefer-type-fest-promisable\": preferTypeFestPromisableRule,\n \"prefer-type-fest-readonly-deep\": preferTypeFestReadonlyDeepRule,\n \"prefer-type-fest-require-all-or-none\": preferTypeFestRequireAllOrNoneRule,\n \"prefer-type-fest-require-at-least-one\":\n preferTypeFestRequireAtLeastOneRule,\n \"prefer-type-fest-require-exactly-one\": preferTypeFestRequireExactlyOneRule,\n \"prefer-type-fest-require-one-or-none\": preferTypeFestRequireOneOrNoneRule,\n \"prefer-type-fest-required-deep\": preferTypeFestRequiredDeepRule,\n \"prefer-type-fest-schema\": preferTypeFestSchemaRule,\n \"prefer-type-fest-set-non-nullable\": preferTypeFestSetNonNullableRule,\n \"prefer-type-fest-set-optional\": preferTypeFestSetOptionalRule,\n \"prefer-type-fest-set-readonly\": preferTypeFestSetReadonlyRule,\n \"prefer-type-fest-set-required\": preferTypeFestSetRequiredRule,\n \"prefer-type-fest-simplify\": preferTypeFestSimplifyRule,\n \"prefer-type-fest-tagged-brands\": preferTypeFestTaggedBrandsRule,\n \"prefer-type-fest-tuple-of\": preferTypeFestTupleOfRule,\n \"prefer-type-fest-unknown-array\": preferTypeFestUnknownArrayRule,\n \"prefer-type-fest-unknown-map\": preferTypeFestUnknownMapRule,\n \"prefer-type-fest-unknown-record\": preferTypeFestUnknownRecordRule,\n \"prefer-type-fest-unknown-set\": preferTypeFestUnknownSetRule,\n \"prefer-type-fest-unwrap-tagged\": preferTypeFestUnwrapTaggedRule,\n \"prefer-type-fest-value-of\": preferTypeFestValueOfRule,\n \"prefer-type-fest-writable\": preferTypeFestWritableRule,\n \"prefer-type-fest-writable-deep\": preferTypeFestWritableDeepRule,\n};\n\n/** Exported typed view consumed by the plugin entrypoint. */\nexport const typefestRules: Readonly<\n Record<TypefestRuleNamePattern, RuleWithDocs>\n> = typefestRuleRegistry;\n\nexport default typefestRules;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;;;;;IAAAA,iBAA6B;AAC7B,IAAAC,qBAOO;;;ACfP;AAAA,EACI,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,SAAW;AAAA,EACX,aAAe;AAAA,EACf,UAAY;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,UAAY;AAAA,EACZ,MAAQ;AAAA,IACJ,KAAO;AAAA,IACP,OAAS;AAAA,EACb;AAAA,EACA,YAAc;AAAA,IACV,MAAQ;AAAA,IACR,KAAO;AAAA,EACX;AAAA,EACA,SAAW;AAAA,EACX,QAAU;AAAA,EACV,cAAgB;AAAA,IACZ;AAAA,MACI,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,KAAO;AAAA,IACX;AAAA,EACJ;AAAA,EACA,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,SAAW;AAAA,IACP,KAAK;AAAA,MACD,QAAU;AAAA,QACN,OAAS;AAAA,QACT,SAAW;AAAA,MACf;AAAA,MACA,SAAW;AAAA,QACP,OAAS;AAAA,QACT,SAAW;AAAA,MACf;AAAA,MACA,SAAW;AAAA,IACf;AAAA,IACA,kBAAkB;AAAA,EACtB;AAAA,EACA,MAAQ;AAAA,EACR,OAAS;AAAA,EACT,OAAS;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,YAAc;AAAA,IACV;AAAA,EACJ;AAAA,EACA,SAAW;AAAA,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ACI,sBAAsB,eAAe;KACxC;EAET;AAEA,SAAO;AACX;AAEA,IAAM,4BAA4B,gCAA+B;AAGjE,IAAM,kBAA2C;AAcjD,IAAM,iBAAyC;EAC3C,SAAS;EACT,MAAM;IACF,MAAM;IACN,WAAW;IACX,SAAS,kBAAkB,gBAAgB;;EAE/C,YAAY,CAAA;EACZ,OAAO;;AAeX,IAAA,iBAAe;",
|
|
6
|
+
"names": ["import_parser", "import_ts_extras", "import_ts_extras", "typefestConfigs", "typefestConfigNames", "import_type_utils", "import_ts_extras", "import_ts_extras", "import_type_utils", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "importFix", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "parser", "import_ts_extras", "argumentText", "import_ts_extras", "import_ts_extras", "import_ts_extras", "isTypefestRuleNamePattern", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "import_ts_extras", "isUndefinedExpression", "import_ts_extras", "isGlobalUndefinedIdentifier", "import_parser", "import_type_utils", "import_ts_extras", "isUnknownRecord", "parser", "isUndefinedStringLiteral", "import_ts_extras", "import_type_utils", "import_ts_extras", "ts", "import_type_utils", "import_ts_extras", "import_typescript", "ts", "isSetLike", "import_type_utils", "import_ts_extras", "import_ts_extras", "isStringLike", "import_ts_extras", "import_ts_extras", "defaultOption", "defaultOptions", "ARRAY_TYPE_NAME", "JSON_VALUE_TYPE_NAME", "isJsonValueType", "import_ts_extras", "import_ts_extras", "import_utils", "import_ts_extras", "defaultOption", "defaultOptions", "defaultOption", "defaultOptions", "defaultOption", "defaultOptions", "defaultOption", "defaultOptions", "READONLY_ARRAY_TYPE_NAME", "hasSingleUnknownTypeArgument", "typeScriptParser", "presetRuleNamesByConfig"]
|
|
7
|
+
}
|