eslint-plugin-etc-misc 1.1.2 → 1.1.4
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/dist/plugin.cjs +133 -1
- package/dist/plugin.cjs.map +3 -3
- package/dist/rules/no-vulnerable.d.ts.map +1 -1
- package/dist/rules/no-vulnerable.js +148 -1
- package/dist/rules/no-vulnerable.js.map +1 -1
- package/docs/AGENTS.md +186 -0
- package/docs/docusaurus/AGENTS.md +27 -0
- package/docs/docusaurus/sidebars.rules.ts +1 -1
- package/docs/rules/no-expression-empty-lines.md +3 -1
- package/docs/rules/no-function-declare-after-return.md +6 -0
- package/docs/rules/no-use-extend-native.md +6 -0
- package/docs/rules/no-vulnerable.md +12 -0
- package/package.json +1 -1
package/dist/plugin.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/plugin.ts", "../src/_internal/plugin-meta.ts", "../src/configs/all-strict.ts", "../src/rules.ts", "../src/_internal/rule-catalog.ts", "../src/rules/array-type.ts", "../src/_internal/create-external-rule.ts", "../src/_internal/rule-deprecation.ts", "../src/rules/class-match-filename.ts", "../src/_internal/rule-creator.ts", "../src/rules/comment-spacing.ts", "../src/rules/consistent-empty-lines.ts", "../src/rules/consistent-enum-members.ts", "../src/rules/consistent-filename.ts", "../src/_internal/casing.ts", "../src/_internal/identifier-blocks.ts", "../src/rules/consistent-import.ts", "../src/rules/consistent-optional-props.ts", "../src/rules/consistent-source-extension.ts", "../src/rules/consistent-symbol-description.ts", "../src/_internal/get-core-rule.ts", "../src/rules/default-case.ts", "../src/_internal/create-import-pattern-rule.ts", "../src/_internal/import-patterns.ts", "../src/rules/disallow-import.ts", "../src/rules/export-matching-filename-only.ts", "../src/rules/match-filename.ts", "../src/rules/max-identifier-blocks.ts", "../src/rules/no-assign-mutated-array.ts", "../src/rules/no-at-sign-import.ts", "../src/rules/no-at-sign-internal-import.ts", "../src/rules/no-chain-coalescence-mixture.ts", "../src/rules/no-commented-out-code.ts", "../src/rules/no-const-enum.ts", "../src/rules/no-deprecated.ts", "../src/_internal/ignore-patterns.ts", "../src/_internal/symbol-usage.ts", "../src/rules/no-enum.ts", "../src/rules/no-expression-empty-lines.ts", "../src/rules/no-foreach.ts", "../src/rules/no-function-declare-after-return.ts", "../src/rules/no-implicit-any-catch.ts", "../src/rules/no-index-import.ts", "../src/rules/no-internal-modules.ts", "../src/rules/no-internal.ts", "../src/rules/no-language-mixing.ts", "../src/rules/no-misused-generics.ts", "../src/rules/no-mixed-enums.ts", "../src/rules/no-negated-conditions.ts", "../src/rules/no-nodejs-modules.ts", "../src/rules/no-param-reassign.ts", "../src/rules/no-relative-parent-import.ts", "../src/rules/no-restricted-syntax.ts", "../src/_internal/syntax-selectors.ts", "../src/rules/no-secret.ts", "../src/rules/no-self-import.ts", "../src/rules/no-shadow.ts", "../src/rules/no-sibling-import.ts", "../src/rules/no-single-line-comment.ts", "../src/rules/no-t.ts", "../src/rules/no-underscore-export.ts", "../src/rules/no-unnecessary-as-const.ts", "../src/rules/no-unnecessary-break.ts", "../src/rules/no-unnecessary-initialization.ts", "../src/rules/no-unnecessary-template-literal.ts", "../src/rules/no-unused-disable.ts", "../src/rules/no-use-extend-native.ts", "../src/rules/no-useless-generics.ts", "../src/rules/no-value-tostring.ts", "../src/rules/no-vulnerable.ts", "../src/rules/no-writeonly.ts", "../src/rules/object-format.ts", "../src/rules/only-export-name.ts", "../src/rules/prefer-arrow-function-property.ts", "../src/rules/prefer-const-require.ts", "../src/rules/prefer-includes.ts", "../src/rules/prefer-interface.ts", "../src/rules/prefer-less-than.ts", "../src/rules/prefer-object-has-own.ts", "../src/rules/prefer-only-export.ts", "../src/rules/require-jsdoc.ts", "../src/rules/require-syntax.ts", "../src/rules/restrict-identifier-characters.ts", "../src/rules/sort-array.ts", "../src/rules/sort-call-signature.ts", "../src/rules/sort-class-members.ts", "../src/rules/sort-construct-signature.ts", "../src/rules/sort-export-specifiers.ts", "../src/rules/sort-keys.ts", "../src/rules/sort-top-comments.ts", "../src/rules/switch-case-spacing.ts", "../src/rules/template-literal-format.ts", "../src/rules/throw-error.ts", "../src/rules/throw-new-error.ts", "../src/rules/typescript-array-callback-return-type.ts", "../src/rules/typescript-class-methods-use-this.ts", "../src/rules/typescript-consistent-array-type-name.ts", "../src/rules/typescript-define-function-in-one-statement.ts", "../src/rules/typescript-exhaustive-switch.ts", "../src/rules/typescript-no-boolean-literal-type.ts", "../src/rules/typescript-no-complex-declarator-type.ts", "../src/rules/typescript-no-complex-return-type.ts", "../src/rules/typescript-no-empty-interfaces.ts", "../src/rules/typescript-no-inferrable-types.ts", "../src/rules/typescript-no-multi-type-tuples.ts", "../src/rules/typescript-no-never.ts", "../src/rules/typescript-no-redundant-undefined-const.ts", "../src/rules/typescript-no-redundant-undefined-default-parameter.ts", "../src/rules/typescript-no-redundant-undefined-let.ts", "../src/rules/typescript-no-redundant-undefined-optional.ts", "../src/rules/typescript-no-redundant-undefined-promise-return-type.ts", "../src/rules/typescript-no-redundant-undefined-readonly-property.ts", "../src/rules/typescript-no-redundant-undefined-return-type.ts", "../src/rules/typescript-no-redundant-undefined-var.ts", "../src/rules/typescript-no-restricted-syntax.ts", "../src/rules/typescript-no-unsafe-object-assign.ts", "../src/rules/typescript-no-unsafe-object-assignment.ts", "../src/rules/typescript-prefer-array-type-alias.ts", "../src/rules/typescript-prefer-class-method.ts", "../src/rules/typescript-prefer-enum.ts", "../src/rules/typescript-prefer-named-tuple-members.ts", "../src/rules/typescript-prefer-readonly-array-parameter.ts", "../src/rules/typescript-prefer-readonly-array.ts", "../src/rules/typescript-prefer-readonly-index-signature.ts", "../src/rules/typescript-prefer-readonly-map.ts", "../src/rules/typescript-prefer-readonly-property.ts", "../src/rules/typescript-prefer-readonly-record.ts", "../src/rules/typescript-prefer-readonly-set.ts", "../src/rules/typescript-require-prop-type-annotation.ts", "../src/rules/typescript-require-readonly-array-property-type.ts", "../src/rules/typescript-require-readonly-array-return-type.ts", "../src/rules/typescript-require-readonly-array-type-alias.ts", "../src/rules/typescript-require-readonly-map-parameter-type.ts", "../src/rules/typescript-require-readonly-map-property-type.ts", "../src/rules/typescript-require-readonly-map-return-type.ts", "../src/rules/typescript-require-readonly-map-type-alias.ts", "../src/rules/typescript-require-readonly-record-parameter-type.ts", "../src/rules/typescript-require-readonly-record-property-type.ts", "../src/rules/typescript-require-readonly-record-return-type.ts", "../src/rules/typescript-require-readonly-record-type-alias.ts", "../src/rules/typescript-require-readonly-set-parameter-type.ts", "../src/rules/typescript-require-readonly-set-property-type.ts", "../src/rules/typescript-require-readonly-set-return-type.ts", "../src/rules/typescript-require-readonly-set-type-alias.ts", "../src/rules/typescript-require-this-void.ts", "../src/rules/underscore-internal.ts", "../src/rules/unused-internal-properties.ts", "../src/rules/uppercase-iife.ts", "../src/rules/words.ts", "../src/configs/all.ts", "../src/configs/minimal.ts", "../src/configs/recommended.ts", "../src/configs/strict-type-checked.ts", "../src/configs/strict.ts", "../src/configs.ts"],
|
|
4
|
-
"sourcesContent": ["import { pluginMeta, type PluginMeta } from \"./_internal/plugin-meta.js\";\nimport { configs } from \"./configs.js\";\nimport { rules } from \"./rules.js\";\n\ntype PluginModule = {\n readonly configs: typeof configs;\n readonly meta: PluginMeta;\n readonly processors: Readonly<Record<string, never>>;\n readonly rules: typeof rules;\n};\n\n/**\n * ESLint plugin module export.\n */\nconst plugin: PluginModule = {\n configs,\n meta: pluginMeta,\n processors: {},\n rules,\n};\n\nexport default plugin;\n", "/**\n * Immutable metadata describing this ESLint plugin package.\n */\nexport const pluginMeta = {\n name: \"eslint-plugin-etc-misc\",\n namespace: \"etc-misc\",\n version: \"1.0.0\",\n} as const;\n\n/**\n * Static type representation of {@link pluginMeta}.\n */\nexport type PluginMeta = typeof pluginMeta;\n", "/* eslint-disable canonical/no-reassign-imports -- Rule entry map intentionally references imported plugin rules metadata. */\n\nimport { objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\n\ntype AllStrictConfig = {\n readonly name: \"etc-misc/all-strict\";\n readonly rules: Readonly<Record<string, RuleSeverity>>;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst allStrictRuleEntries = objectEntries(pluginRules).map(\n ([ruleName, ruleModule]) =>\n [\n `etc-misc/${ruleName}`,\n ruleModule.meta.deprecated === false ? \"error\" : \"warn\",\n ] as const\n);\n\nconst allStrictRules = objectFromEntries(allStrictRuleEntries) as Readonly<\n Record<string, RuleSeverity>\n>;\n\n/**\n * Flat config preset enabling every plugin rule at `error`, except deprecated\n * rules which remain at `warn`.\n */\nexport const allStrict: AllStrictConfig = {\n name: \"etc-misc/all-strict\",\n rules: allStrictRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { objectEntries, objectKeys, safeCastTo, setHas } from \"ts-extras\";\n\nimport type { RuleCatalogEntry } from \"./_internal/rule-catalog.js\";\n\nimport { buildRuleCatalog } from \"./_internal/rule-catalog.js\";\nimport arrayType from \"./rules/array-type.js\";\nimport matchFilenameRule from \"./rules/class-match-filename.js\";\nimport commentSpacing from \"./rules/comment-spacing.js\";\nimport consistentEmptyLines from \"./rules/consistent-empty-lines.js\";\nimport consistentEnumMembers from \"./rules/consistent-enum-members.js\";\nimport consistentFilename from \"./rules/consistent-filename.js\";\nimport consistentImport from \"./rules/consistent-import.js\";\nimport consistentOptionalProps from \"./rules/consistent-optional-props.js\";\nimport consistentSourceExtension from \"./rules/consistent-source-extension.js\";\nimport consistentSymbolDescription from \"./rules/consistent-symbol-description.js\";\nimport defaultCase from \"./rules/default-case.js\";\nimport disallowImport from \"./rules/disallow-import.js\";\nimport exportMatchingFilenameOnly from \"./rules/export-matching-filename-only.js\";\nimport matchFilename from \"./rules/match-filename.js\";\nimport maxIdentifierBlocks from \"./rules/max-identifier-blocks.js\";\nimport noAssignMutatedArray from \"./rules/no-assign-mutated-array.js\";\nimport noAtSignImport from \"./rules/no-at-sign-import.js\";\nimport noAtSignInternalImport from \"./rules/no-at-sign-internal-import.js\";\nimport noChainCoalescenceMixture from \"./rules/no-chain-coalescence-mixture.js\";\nimport noCommentedOutCode from \"./rules/no-commented-out-code.js\";\nimport noConstEnum from \"./rules/no-const-enum.js\";\nimport noDeprecated from \"./rules/no-deprecated.js\";\nimport noEnum from \"./rules/no-enum.js\";\nimport noExpressionEmptyLines from \"./rules/no-expression-empty-lines.js\";\nimport noForeach from \"./rules/no-foreach.js\";\nimport noFunctionDeclareAfterReturn from \"./rules/no-function-declare-after-return.js\";\nimport noImplicitAnyCatch from \"./rules/no-implicit-any-catch.js\";\nimport noIndexImport from \"./rules/no-index-import.js\";\nimport noInternalModules from \"./rules/no-internal-modules.js\";\nimport noInternal from \"./rules/no-internal.js\";\nimport noLanguageMixing from \"./rules/no-language-mixing.js\";\nimport noMisusedGenerics from \"./rules/no-misused-generics.js\";\nimport noMixedEnums from \"./rules/no-mixed-enums.js\";\nimport noNegatedConditions from \"./rules/no-negated-conditions.js\";\nimport noNodejsModules from \"./rules/no-nodejs-modules.js\";\nimport noParamReassign from \"./rules/no-param-reassign.js\";\nimport noRelativeParentImport from \"./rules/no-relative-parent-import.js\";\nimport noRestrictedSyntax from \"./rules/no-restricted-syntax.js\";\nimport noSecret from \"./rules/no-secret.js\";\nimport noSelfImport from \"./rules/no-self-import.js\";\nimport noShadow from \"./rules/no-shadow.js\";\nimport noSiblingImport from \"./rules/no-sibling-import.js\";\nimport noSingleLineComment from \"./rules/no-single-line-comment.js\";\nimport noT from \"./rules/no-t.js\";\nimport noUnderscoreExport from \"./rules/no-underscore-export.js\";\nimport noUnnecessaryAsConst from \"./rules/no-unnecessary-as-const.js\";\nimport noUnnecessaryBreak from \"./rules/no-unnecessary-break.js\";\nimport noUnnecessaryInitialization from \"./rules/no-unnecessary-initialization.js\";\nimport noUnnecessaryTemplateLiteral from \"./rules/no-unnecessary-template-literal.js\";\nimport noUnusedDisable from \"./rules/no-unused-disable.js\";\nimport noUseExtendNative from \"./rules/no-use-extend-native.js\";\nimport noUselessGenerics from \"./rules/no-useless-generics.js\";\nimport noValueToString from \"./rules/no-value-tostring.js\";\nimport noVulnerable from \"./rules/no-vulnerable.js\";\nimport noWriteonly from \"./rules/no-writeonly.js\";\nimport objectFormat from \"./rules/object-format.js\";\nimport onlyExportName from \"./rules/only-export-name.js\";\nimport preferArrowFunctionProperty from \"./rules/prefer-arrow-function-property.js\";\nimport preferConstRequire from \"./rules/prefer-const-require.js\";\nimport preferIncludes from \"./rules/prefer-includes.js\";\nimport preferInterface from \"./rules/prefer-interface.js\";\nimport preferLessThan from \"./rules/prefer-less-than.js\";\nimport preferObjectHasOwn from \"./rules/prefer-object-has-own.js\";\nimport preferOnlyExport from \"./rules/prefer-only-export.js\";\nimport requireJSDoc from \"./rules/require-jsdoc.js\";\nimport requireSyntax from \"./rules/require-syntax.js\";\nimport restrictIdentifierCharacters from \"./rules/restrict-identifier-characters.js\";\nimport sortArray from \"./rules/sort-array.js\";\nimport sortCallSignature from \"./rules/sort-call-signature.js\";\nimport sortClassMembers from \"./rules/sort-class-members.js\";\nimport sortConstructSignature from \"./rules/sort-construct-signature.js\";\nimport sortExportSpecifiers from \"./rules/sort-export-specifiers.js\";\nimport sortKeys from \"./rules/sort-keys.js\";\nimport sortTopComments from \"./rules/sort-top-comments.js\";\nimport switchCaseSpacing from \"./rules/switch-case-spacing.js\";\nimport templateLiteralFormat from \"./rules/template-literal-format.js\";\nimport throwError from \"./rules/throw-error.js\";\nimport throwNewError from \"./rules/throw-new-error.js\";\nimport typescriptArrayCallbackReturnType from \"./rules/typescript-array-callback-return-type.js\";\nimport typescriptClassMethodsUseThis from \"./rules/typescript-class-methods-use-this.js\";\nimport typescriptConsistentArrayTypeName from \"./rules/typescript-consistent-array-type-name.js\";\nimport typescriptDefineFunctionInOneStatement from \"./rules/typescript-define-function-in-one-statement.js\";\nimport typescriptExhaustiveSwitch from \"./rules/typescript-exhaustive-switch.js\";\nimport typescriptNoBooleanLiteralType from \"./rules/typescript-no-boolean-literal-type.js\";\nimport typescriptNoComplexDeclaratorType from \"./rules/typescript-no-complex-declarator-type.js\";\nimport typescriptNoComplexReturnType from \"./rules/typescript-no-complex-return-type.js\";\nimport typescriptNoEmptyInterfaces from \"./rules/typescript-no-empty-interfaces.js\";\nimport typescriptNoInferrableTypes from \"./rules/typescript-no-inferrable-types.js\";\nimport typescriptNoMultiTypeTuples from \"./rules/typescript-no-multi-type-tuples.js\";\nimport typescriptNoNever from \"./rules/typescript-no-never.js\";\nimport typescriptNoRedundantUndefinedConst from \"./rules/typescript-no-redundant-undefined-const.js\";\nimport typescriptNoRedundantUndefinedDefaultParameter from \"./rules/typescript-no-redundant-undefined-default-parameter.js\";\nimport typescriptNoRedundantUndefinedLet from \"./rules/typescript-no-redundant-undefined-let.js\";\nimport typescriptNoRedundantUndefinedOptional from \"./rules/typescript-no-redundant-undefined-optional.js\";\nimport typescriptNoRedundantUndefinedPromiseReturnType from \"./rules/typescript-no-redundant-undefined-promise-return-type.js\";\nimport typescriptNoRedundantUndefinedReadonlyProperty from \"./rules/typescript-no-redundant-undefined-readonly-property.js\";\nimport typescriptNoRedundantUndefinedReturnType from \"./rules/typescript-no-redundant-undefined-return-type.js\";\nimport typescriptNoRedundantUndefinedVar from \"./rules/typescript-no-redundant-undefined-var.js\";\nimport typescriptNoRestrictedSyntax from \"./rules/typescript-no-restricted-syntax.js\";\nimport typescriptNoUnsafeObjectAssign from \"./rules/typescript-no-unsafe-object-assign.js\";\nimport typescriptNoUnsafeObjectAssignment from \"./rules/typescript-no-unsafe-object-assignment.js\";\nimport typescriptPreferArrayTypeAlias from \"./rules/typescript-prefer-array-type-alias.js\";\nimport typescriptPreferClassMethod from \"./rules/typescript-prefer-class-method.js\";\nimport typescriptPreferEnum from \"./rules/typescript-prefer-enum.js\";\nimport typescriptPreferNamedTupleMembers from \"./rules/typescript-prefer-named-tuple-members.js\";\nimport typescriptPreferReadonlyArrayParameter from \"./rules/typescript-prefer-readonly-array-parameter.js\";\nimport typescriptPreferReadonlyArray from \"./rules/typescript-prefer-readonly-array.js\";\nimport typescriptPreferReadonlyIndexSignature from \"./rules/typescript-prefer-readonly-index-signature.js\";\nimport typescriptPreferReadonlyMap from \"./rules/typescript-prefer-readonly-map.js\";\nimport typescriptPreferReadonlyProperty from \"./rules/typescript-prefer-readonly-property.js\";\nimport typescriptPreferReadonlyRecord from \"./rules/typescript-prefer-readonly-record.js\";\nimport typescriptPreferReadonlySet from \"./rules/typescript-prefer-readonly-set.js\";\nimport typescriptRequirePropTypeAnnotation from \"./rules/typescript-require-prop-type-annotation.js\";\nimport typescriptRequireReadonlyArrayPropertyType from \"./rules/typescript-require-readonly-array-property-type.js\";\nimport typescriptRequireReadonlyArrayReturnType from \"./rules/typescript-require-readonly-array-return-type.js\";\nimport typescriptRequireReadonlyArrayTypeAlias from \"./rules/typescript-require-readonly-array-type-alias.js\";\nimport typescriptRequireReadonlyMapParameterType from \"./rules/typescript-require-readonly-map-parameter-type.js\";\nimport typescriptRequireReadonlyMapPropertyType from \"./rules/typescript-require-readonly-map-property-type.js\";\nimport typescriptRequireReadonlyMapReturnType from \"./rules/typescript-require-readonly-map-return-type.js\";\nimport typescriptRequireReadonlyMapTypeAlias from \"./rules/typescript-require-readonly-map-type-alias.js\";\nimport typescriptRequireReadonlyRecordParameterType from \"./rules/typescript-require-readonly-record-parameter-type.js\";\nimport typescriptRequireReadonlyRecordPropertyType from \"./rules/typescript-require-readonly-record-property-type.js\";\nimport typescriptRequireReadonlyRecordReturnType from \"./rules/typescript-require-readonly-record-return-type.js\";\nimport typescriptRequireReadonlyRecordTypeAlias from \"./rules/typescript-require-readonly-record-type-alias.js\";\nimport typescriptRequireReadonlySetParameterType from \"./rules/typescript-require-readonly-set-parameter-type.js\";\nimport typescriptRequireReadonlySetPropertyType from \"./rules/typescript-require-readonly-set-property-type.js\";\nimport typescriptRequireReadonlySetReturnType from \"./rules/typescript-require-readonly-set-return-type.js\";\nimport typescriptRequireReadonlySetTypeAlias from \"./rules/typescript-require-readonly-set-type-alias.js\";\nimport typescriptRequireThisVoid from \"./rules/typescript-require-this-void.js\";\nimport underscoreInternal from \"./rules/underscore-internal.js\";\nimport unusedInternalProperties from \"./rules/unused-internal-properties.js\";\nimport uppercaseIife from \"./rules/uppercase-iife.js\";\nimport words from \"./rules/words.js\";\n\ntype RuleDocsMetadata = {\n readonly catalogId?: string;\n readonly catalogIndex?: number;\n readonly deprecated?: boolean;\n readonly description?: string;\n readonly frozen?: boolean;\n readonly recommended?: boolean;\n readonly requiresTypeChecking?: boolean;\n readonly ruleName?: string;\n readonly suggestion?: boolean;\n readonly url?: string;\n};\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst rulesWithRequiredTypeChecking = new Set<string>([\n \"no-assign-mutated-array\",\n \"no-deprecated\",\n \"no-foreach\",\n \"no-implicit-any-catch\",\n \"no-internal\",\n \"no-misused-generics\",\n \"throw-error\",\n \"typescript/array-callback-return-type\",\n \"typescript/no-never\",\n \"typescript/no-unsafe-object-assign\",\n \"typescript/prefer-enum\",\n]);\n\nconst recommendedRuleNames = new Set<string>([\n \"consistent-optional-props\",\n \"no-assign-mutated-array\",\n \"no-const-enum\",\n \"no-function-declare-after-return\",\n \"no-implicit-any-catch\",\n \"no-internal\",\n \"no-t\",\n \"no-unnecessary-as-const\",\n \"no-unnecessary-break\",\n \"no-unnecessary-initialization\",\n \"no-unnecessary-template-literal\",\n \"no-vulnerable\",\n \"throw-error\",\n \"typescript/no-boolean-literal-type\",\n \"typescript/prefer-readonly-array\",\n \"typescript/prefer-readonly-array-parameter\",\n \"typescript/prefer-readonly-index-signature\",\n \"typescript/prefer-readonly-map\",\n \"typescript/prefer-readonly-property\",\n \"typescript/prefer-readonly-record\",\n \"typescript/prefer-readonly-set\",\n \"typescript/require-readonly-array-return-type\",\n \"typescript/require-this-void\",\n]);\n\n/**\n * Rule implementations keyed by rule name.\n */\nconst baseRules: Readonly<Record<string, RuleModule>> = {\n \"array-type\": arrayType,\n \"class-match-filename\": matchFilenameRule,\n \"comment-spacing\": commentSpacing,\n \"consistent-empty-lines\": consistentEmptyLines,\n \"consistent-enum-members\": consistentEnumMembers,\n \"consistent-filename\": consistentFilename,\n \"consistent-import\": consistentImport,\n \"consistent-optional-props\": consistentOptionalProps,\n \"consistent-source-extension\": consistentSourceExtension,\n \"consistent-symbol-description\": consistentSymbolDescription,\n \"default-case\": defaultCase,\n \"disallow-import\": disallowImport,\n \"export-matching-filename-only\": exportMatchingFilenameOnly,\n \"match-filename\": matchFilename,\n \"max-identifier-blocks\": maxIdentifierBlocks,\n \"no-assign-mutated-array\": noAssignMutatedArray,\n \"no-at-sign-import\": noAtSignImport,\n \"no-at-sign-internal-import\": noAtSignInternalImport,\n \"no-chain-coalescence-mixture\": noChainCoalescenceMixture,\n \"no-commented-out-code\": noCommentedOutCode,\n \"no-const-enum\": noConstEnum,\n \"no-deprecated\": noDeprecated,\n \"no-enum\": noEnum,\n \"no-expression-empty-lines\": noExpressionEmptyLines,\n \"no-foreach\": noForeach,\n \"no-function-declare-after-return\": noFunctionDeclareAfterReturn,\n \"no-implicit-any-catch\": noImplicitAnyCatch,\n \"no-index-import\": noIndexImport,\n \"no-internal\": noInternal,\n \"no-internal-modules\": noInternalModules,\n \"no-language-mixing\": noLanguageMixing,\n \"no-misused-generics\": noMisusedGenerics,\n \"no-mixed-enums\": noMixedEnums,\n \"no-negated-conditions\": noNegatedConditions,\n \"no-nodejs-modules\": noNodejsModules,\n \"no-param-reassign\": noParamReassign,\n \"no-relative-parent-import\": noRelativeParentImport,\n \"no-restricted-syntax\": noRestrictedSyntax,\n \"no-secret\": noSecret,\n \"no-self-import\": noSelfImport,\n \"no-shadow\": noShadow,\n \"no-sibling-import\": noSiblingImport,\n \"no-single-line-comment\": noSingleLineComment,\n \"no-t\": noT,\n \"no-underscore-export\": noUnderscoreExport,\n \"no-unnecessary-as-const\": noUnnecessaryAsConst,\n \"no-unnecessary-break\": noUnnecessaryBreak,\n \"no-unnecessary-initialization\": noUnnecessaryInitialization,\n \"no-unnecessary-template-literal\": noUnnecessaryTemplateLiteral,\n \"no-unused-disable\": noUnusedDisable,\n \"no-use-extend-native\": noUseExtendNative,\n \"no-useless-generics\": noUselessGenerics,\n \"no-value-tostring\": noValueToString,\n \"no-vulnerable\": noVulnerable,\n \"no-writeonly\": noWriteonly,\n \"object-format\": objectFormat,\n \"only-export-name\": onlyExportName,\n \"prefer-arrow-function-property\": preferArrowFunctionProperty,\n \"prefer-const-require\": preferConstRequire,\n \"prefer-includes\": preferIncludes,\n \"prefer-interface\": preferInterface,\n \"prefer-less-than\": preferLessThan,\n \"prefer-object-has-own\": preferObjectHasOwn,\n \"prefer-only-export\": preferOnlyExport,\n \"require-jsdoc\": requireJSDoc,\n \"require-syntax\": requireSyntax,\n \"restrict-identifier-characters\": restrictIdentifierCharacters,\n \"sort-array\": sortArray,\n \"sort-call-signature\": sortCallSignature,\n \"sort-class-members\": sortClassMembers,\n \"sort-construct-signature\": sortConstructSignature,\n \"sort-export-specifiers\": sortExportSpecifiers,\n \"sort-keys\": sortKeys,\n \"sort-top-comments\": sortTopComments,\n \"switch-case-spacing\": switchCaseSpacing,\n \"template-literal-format\": templateLiteralFormat,\n \"throw-error\": throwError,\n \"throw-new-error\": throwNewError,\n \"typescript/array-callback-return-type\": typescriptArrayCallbackReturnType,\n \"typescript/class-methods-use-this\": typescriptClassMethodsUseThis,\n \"typescript/consistent-array-type-name\": typescriptConsistentArrayTypeName,\n \"typescript/define-function-in-one-statement\":\n typescriptDefineFunctionInOneStatement,\n \"typescript/exhaustive-switch\": typescriptExhaustiveSwitch,\n \"typescript/no-boolean-literal-type\": typescriptNoBooleanLiteralType,\n \"typescript/no-complex-declarator-type\": typescriptNoComplexDeclaratorType,\n \"typescript/no-complex-return-type\": typescriptNoComplexReturnType,\n \"typescript/no-empty-interfaces\": typescriptNoEmptyInterfaces,\n \"typescript/no-inferrable-types\": typescriptNoInferrableTypes,\n \"typescript/no-multi-type-tuples\": typescriptNoMultiTypeTuples,\n \"typescript/no-never\": typescriptNoNever,\n \"typescript/no-redundant-undefined-const\":\n typescriptNoRedundantUndefinedConst,\n \"typescript/no-redundant-undefined-default-parameter\":\n typescriptNoRedundantUndefinedDefaultParameter,\n \"typescript/no-redundant-undefined-let\": typescriptNoRedundantUndefinedLet,\n \"typescript/no-redundant-undefined-optional\":\n typescriptNoRedundantUndefinedOptional,\n \"typescript/no-redundant-undefined-promise-return-type\":\n typescriptNoRedundantUndefinedPromiseReturnType,\n \"typescript/no-redundant-undefined-readonly-property\":\n typescriptNoRedundantUndefinedReadonlyProperty,\n \"typescript/no-redundant-undefined-return-type\":\n typescriptNoRedundantUndefinedReturnType,\n \"typescript/no-redundant-undefined-var\": typescriptNoRedundantUndefinedVar,\n \"typescript/no-restricted-syntax\": typescriptNoRestrictedSyntax,\n \"typescript/no-unsafe-object-assign\": typescriptNoUnsafeObjectAssign,\n \"typescript/no-unsafe-object-assignment\":\n typescriptNoUnsafeObjectAssignment,\n \"typescript/prefer-array-type-alias\": typescriptPreferArrayTypeAlias,\n \"typescript/prefer-class-method\": typescriptPreferClassMethod,\n \"typescript/prefer-enum\": typescriptPreferEnum,\n \"typescript/prefer-named-tuple-members\": typescriptPreferNamedTupleMembers,\n \"typescript/prefer-readonly-array\": typescriptPreferReadonlyArray,\n \"typescript/prefer-readonly-array-parameter\":\n typescriptPreferReadonlyArrayParameter,\n \"typescript/prefer-readonly-index-signature\":\n typescriptPreferReadonlyIndexSignature,\n \"typescript/prefer-readonly-map\": typescriptPreferReadonlyMap,\n \"typescript/prefer-readonly-property\": typescriptPreferReadonlyProperty,\n \"typescript/prefer-readonly-record\": typescriptPreferReadonlyRecord,\n \"typescript/prefer-readonly-set\": typescriptPreferReadonlySet,\n \"typescript/require-prop-type-annotation\":\n typescriptRequirePropTypeAnnotation,\n \"typescript/require-readonly-array-property-type\":\n typescriptRequireReadonlyArrayPropertyType,\n \"typescript/require-readonly-array-return-type\":\n typescriptRequireReadonlyArrayReturnType,\n \"typescript/require-readonly-array-type-alias\":\n typescriptRequireReadonlyArrayTypeAlias,\n \"typescript/require-readonly-map-parameter-type\":\n typescriptRequireReadonlyMapParameterType,\n \"typescript/require-readonly-map-property-type\":\n typescriptRequireReadonlyMapPropertyType,\n \"typescript/require-readonly-map-return-type\":\n typescriptRequireReadonlyMapReturnType,\n \"typescript/require-readonly-map-type-alias\":\n typescriptRequireReadonlyMapTypeAlias,\n \"typescript/require-readonly-record-parameter-type\":\n typescriptRequireReadonlyRecordParameterType,\n \"typescript/require-readonly-record-property-type\":\n typescriptRequireReadonlyRecordPropertyType,\n \"typescript/require-readonly-record-return-type\":\n typescriptRequireReadonlyRecordReturnType,\n \"typescript/require-readonly-record-type-alias\":\n typescriptRequireReadonlyRecordTypeAlias,\n \"typescript/require-readonly-set-parameter-type\":\n typescriptRequireReadonlySetParameterType,\n \"typescript/require-readonly-set-property-type\":\n typescriptRequireReadonlySetPropertyType,\n \"typescript/require-readonly-set-return-type\":\n typescriptRequireReadonlySetReturnType,\n \"typescript/require-readonly-set-type-alias\":\n typescriptRequireReadonlySetTypeAlias,\n \"typescript/require-this-void\": typescriptRequireThisVoid,\n \"underscore-internal\": underscoreInternal,\n \"unused-internal-properties\": unusedInternalProperties,\n \"uppercase-iife\": uppercaseIife,\n words: words,\n};\n\nconst ruleCatalog = buildRuleCatalog(objectKeys(baseRules));\n\n/**\n * Globally ordered catalog entries for every rule.\n */\nexport const ruleCatalogEntries: readonly RuleCatalogEntry[] =\n ruleCatalog.ordered;\n\n/**\n * Catalog metadata keyed by rule name.\n */\nexport const ruleCatalogByRuleName: Readonly<Record<string, RuleCatalogEntry>> =\n ruleCatalog.byRuleName;\n\n/**\n * Catalog metadata keyed by documentation id (`/` replaced with `-`).\n */\nexport const ruleCatalogByDocId: Readonly<Record<string, RuleCatalogEntry>> =\n ruleCatalog.byDocId;\n\nconst withCatalogDocsMetadata = (\n ruleName: string,\n ruleModule: Readonly<RuleModule>\n): RuleModule => {\n const catalogEntry = ruleCatalog.byRuleName[ruleName];\n\n if (!catalogEntry) {\n throw new Error(`Missing rule catalog entry for rule \"${ruleName}\".`);\n }\n\n const currentDocsMetadata = safeCastTo<RuleDocsMetadata>(\n ruleModule.meta.docs ?? {}\n );\n const hasRequiredTypeChecking = setHas(\n rulesWithRequiredTypeChecking,\n ruleName\n );\n const deprecatedMetadata = ruleModule.meta.deprecated ?? false;\n const isDeprecatedRule = deprecatedMetadata !== false;\n const docsWithCatalogMetadata = {\n ...currentDocsMetadata,\n catalogId: catalogEntry.catalogId,\n catalogIndex: catalogEntry.catalogIndex,\n deprecated: currentDocsMetadata.deprecated ?? isDeprecatedRule,\n frozen:\n currentDocsMetadata.frozen ??\n currentDocsMetadata.deprecated ??\n isDeprecatedRule,\n recommended: setHas(recommendedRuleNames, ruleName),\n requiresTypeChecking:\n currentDocsMetadata.requiresTypeChecking ?? hasRequiredTypeChecking,\n ruleName,\n } as NonNullable<RuleModule[\"meta\"][\"docs\"]>;\n\n return {\n ...ruleModule,\n meta: {\n ...ruleModule.meta,\n deprecated: deprecatedMetadata,\n docs: docsWithCatalogMetadata,\n },\n };\n};\n\nconst decoratedRuleEntries = objectEntries(baseRules).map(\n ([ruleName, ruleModule]) =>\n [ruleName, withCatalogDocsMetadata(ruleName, ruleModule)] as const\n);\n\nlet decoratedRulesAccumulator: Readonly<Record<string, RuleModule>> = {};\n\nfor (const [ruleName, ruleModule] of decoratedRuleEntries) {\n decoratedRulesAccumulator = {\n ...decoratedRulesAccumulator,\n [ruleName]: ruleModule,\n };\n}\n\nconst decoratedRules: Readonly<Record<string, RuleModule>> =\n decoratedRulesAccumulator;\n\n/**\n * Rule implementations keyed by rule name with normalized docs metadata.\n */\nexport const rules: Readonly<Record<string, RuleModule>> =\n Object.freeze(decoratedRules);\n", "/**\n * Global rule catalog indexed by rule name and documentation id.\n */\ntype RuleCatalog = Readonly<{\n readonly byDocId: Readonly<Record<string, RuleCatalogEntry>>;\n readonly byRuleName: Readonly<Record<string, RuleCatalogEntry>>;\n readonly ordered: readonly RuleCatalogEntry[];\n}>;\n\n/**\n * Single rule entry in the global catalog.\n */\ntype RuleCatalogEntry = Readonly<{\n readonly catalogId: string;\n readonly catalogIndex: number;\n readonly docId: string;\n readonly isTypeScriptRule: boolean;\n readonly ruleName: string;\n}>;\n\nconst toCatalogNumericPart = (catalogIndex: number): string =>\n `${catalogIndex}`.padStart(3, \"0\");\n\n/**\n * Format a catalog index as an ID like `R001`.\n */\nexport const toRuleCatalogId = (catalogIndex: number): string =>\n `R${toCatalogNumericPart(catalogIndex)}`;\n\n/**\n * Convert a rule name to its documentation page id.\n */\nexport const toRuleDocId = (ruleName: string): string =>\n ruleName.replaceAll(\"/\", \"-\");\n\n/**\n * Sort rules so core rules come first, then TypeScript-scoped rules.\n */\nexport const compareRuleNamesForCatalog = (\n leftRuleName: string,\n rightRuleName: string\n): number => {\n const leftIsTypeScriptRule = leftRuleName.startsWith(\"typescript/\");\n const rightIsTypeScriptRule = rightRuleName.startsWith(\"typescript/\");\n\n if (leftIsTypeScriptRule !== rightIsTypeScriptRule) {\n return leftIsTypeScriptRule ? 1 : -1;\n }\n\n return leftRuleName.localeCompare(rightRuleName);\n};\n\n/**\n * Build a globally ordered rule catalog map keyed by both rule name and doc id.\n */\nexport const buildRuleCatalog = (ruleNames: readonly string[]): RuleCatalog => {\n const sortedRuleNames = ruleNames.toSorted(compareRuleNamesForCatalog);\n let ordered: readonly RuleCatalogEntry[] = [];\n let byRuleName: Readonly<Record<string, RuleCatalogEntry>> = {};\n let byDocId: Readonly<Record<string, RuleCatalogEntry>> = {};\n\n for (const [zeroBasedIndex, ruleName] of sortedRuleNames.entries()) {\n const catalogIndex = zeroBasedIndex + 1;\n const docId = toRuleDocId(ruleName);\n const entry: RuleCatalogEntry = {\n catalogId: toRuleCatalogId(catalogIndex),\n catalogIndex,\n docId,\n isTypeScriptRule: ruleName.startsWith(\"typescript/\"),\n ruleName,\n };\n\n ordered = [...ordered, entry];\n byRuleName = { ...byRuleName, [ruleName]: entry };\n byDocId = { ...byDocId, [docId]: entry };\n }\n\n return {\n byDocId,\n byRuleName,\n ordered,\n };\n};\n\nexport type { RuleCatalog, RuleCatalogEntry };\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"array-type\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/array-type\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/array-type.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"array-type\",\n url: \"https://typescript-eslint.io/rules/array-type\",\n },\n }),\n ],\n ruleId: \"array-type\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray, UnknownRecord } from \"type-fest\";\n\nimport { objectHasOwn, safeCastTo } from \"ts-extras\";\n\ntype RuleContext = TSESLint.RuleContext<string, Readonly<UnknownArray>>;\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst isObjectRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null;\n\nconst hasCreateFunction = (\n value: unknown\n): value is Readonly<UnknownRecord> &\n Readonly<{ readonly create: RuleModule[\"create\"] }> =>\n isObjectRecord(value) && typeof value[\"create\"] === \"function\";\n\nconst createLegacyContextCompat = (context: RuleContext): RuleContext =>\n new Proxy(context, {\n get: (target, property, receiver): unknown => {\n if (property === \"getSourceCode\") {\n return (): Readonly<TSESLint.SourceCode> => target.sourceCode;\n }\n\n if (property === \"getFilename\") {\n return (): string => target.filename;\n }\n\n if (property === \"getPhysicalFilename\") {\n return (): string => target.physicalFilename;\n }\n\n if (property === \"getCwd\") {\n return (): string => target.cwd;\n }\n\n return Reflect.get(target, property, receiver);\n },\n });\n\n/**\n * Resolve a rule module from an external ESLint plugin's `rules` map.\n */\nexport const getExternalRuleFromPlugin = (\n plugin: unknown,\n ruleName: string,\n pluginName: string\n): unknown => {\n if (!isObjectRecord(plugin) || !isObjectRecord(plugin[\"rules\"])) {\n throw new TypeError(\n `Plugin \"${pluginName}\" does not expose a valid rules map.`\n );\n }\n\n const rules = plugin[\"rules\"];\n if (!objectHasOwn(rules, ruleName)) {\n throw new Error(\n `Rule \"${ruleName}\" was not found in plugin \"${pluginName}\".`\n );\n }\n\n return rules[ruleName];\n};\n\n/**\n * Adapt an external rule so it points docs to this repository.\n */\nexport const adaptExternalRule = (\n externalRule: unknown,\n docsUrl: string\n): RuleModule => {\n if (!hasCreateFunction(externalRule)) {\n throw new TypeError(\"External rule module does not expose create().\");\n }\n\n const externalRuleRecord = externalRule;\n const externalMeta = isObjectRecord(externalRuleRecord[\"meta\"])\n ? externalRuleRecord[\"meta\"]\n : {};\n const externalDocs = isObjectRecord(externalMeta[\"docs\"])\n ? externalMeta[\"docs\"]\n : {};\n const create: RuleModule[\"create\"] = (context) =>\n externalRule.create(createLegacyContextCompat(context));\n\n return {\n ...(externalRuleRecord as unknown as RuleModule),\n create,\n defaultOptions: Array.isArray(externalRuleRecord[\"defaultOptions\"])\n ? safeCastTo<Readonly<UnknownArray>>(\n externalRuleRecord[\"defaultOptions\"]\n )\n : [],\n meta: {\n ...(externalMeta as unknown as RuleModule[\"meta\"]),\n docs: {\n ...(externalDocs as unknown as NonNullable<\n RuleModule[\"meta\"]\n >[\"docs\"]),\n url: docsUrl,\n },\n } as RuleModule[\"meta\"],\n };\n};\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { isDefined } from \"ts-extras\";\n\ntype DeprecatedInfo = Exclude<\n TSESLint.RuleMetaData<string>[\"deprecated\"],\n boolean | undefined\n>;\ntype ReplacedByInfo = NonNullable<DeprecatedInfo[\"replacedBy\"]>[number];\n\ntype RuleDeprecationOptions = Readonly<{\n readonly message: string;\n readonly replacedBy?: readonly ReplacedByInfo[];\n readonly ruleId: string;\n}>;\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst docsBaseUrl =\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules\";\n\n/**\n * Create a replacement descriptor for deprecation metadata.\n */\nexport const createReplacementRuleInfo = (\n replacement: Readonly<{\n readonly plugin?: Readonly<{\n readonly name: string;\n readonly url?: string;\n }>;\n readonly rule?: Readonly<{\n readonly name: string;\n readonly url?: string;\n }>;\n }>\n): ReplacedByInfo => ({\n ...(isDefined(replacement.plugin) ? { plugin: replacement.plugin } : {}),\n ...(isDefined(replacement.rule) ? { rule: replacement.rule } : {}),\n});\n\n/**\n * Create standardized deprecation metadata for this plugin.\n */\nexport const createDeprecatedRuleInfo = ({\n message,\n replacedBy = [],\n ruleId,\n}: RuleDeprecationOptions): DeprecatedInfo => ({\n availableUntil: \"2.0.0\",\n deprecatedSince: \"1.0.0\",\n message,\n ...(replacedBy.length === 0 ? {} : { replacedBy: [...replacedBy] }),\n url: `${docsBaseUrl}/${ruleId.replaceAll(\"/\", \"-\")}`,\n});\n\n/**\n * Apply deprecated+frozen lifecycle metadata to a rule module.\n */\nexport const withDeprecatedRuleLifecycle = <TRule extends RuleModule>(\n rule: TRule,\n options: RuleDeprecationOptions\n): TRule => ({\n ...rule,\n meta: {\n ...rule.meta,\n deprecated: createDeprecatedRuleInfo(options),\n ...(rule.meta.docs === undefined\n ? {}\n : {\n docs: {\n ...rule.meta.docs,\n deprecated: true,\n frozen: true,\n },\n }),\n },\n});\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { basename, extname } from \"node:path\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"mismatch\";\n\ntype Options = readonly [];\n\nconst getFileStem = (filePath: string): string => {\n const extension = extname(filePath);\n return basename(filePath, extension);\n};\n\n/**\n * Require top-level class declarations to match the current filename.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"Program > ExportDefaultDeclaration > ClassDeclaration > Identifier.id, Program > ExportNamedDeclaration > ClassDeclaration > Identifier.id, Program > ClassDeclaration > Identifier.id\":\n (node: Readonly<es.Identifier>): void => {\n const fileName = context.filename;\n if (fileName === \"<input>\") {\n return;\n }\n\n const fileStem = getFileStem(fileName);\n if (fileStem.length === 0 || fileStem === node.name) {\n return;\n }\n\n context.report({\n data: {\n expected: fileStem,\n got: node.name,\n },\n messageId: \"mismatch\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require class names to match the current filename.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/class-match-filename\",\n },\n hasSuggestions: false,\n messages: {\n mismatch:\n \"Class name '{{got}}' does not match filename '{{expected}}'. Rename the class or the file.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"class-match-filename\",\n});\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\n/**\n * Broad rule-module type used by incrementally migrated rule files.\n */\nexport type AnyRuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\ntype RuleCreatorFactory = ReturnType<\n typeof ESLintUtils.RuleCreator<RuleDocsMetadata>\n>;\n\ntype RuleDocsMetadata = {\n readonly catalogId?: string;\n readonly catalogIndex?: number;\n readonly deprecated?: boolean;\n readonly frozen?: boolean;\n readonly recommended: boolean;\n readonly requiresTypeChecking?: boolean;\n readonly ruleName?: string;\n readonly suggestion?: boolean;\n};\n\n/**\n * Shared rule factory for plugin rules.\n */\n/**\n * Typed factory for defining plugin rules with consistent docs URLs.\n */\nexport const ruleCreator: RuleCreatorFactory =\n ESLintUtils.RuleCreator<RuleDocsMetadata>((name) => {\n const docsPathName = name.replaceAll(\"/\", \"-\");\n\n return `https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/${docsPathName}`;\n });\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"invalidSpacing\";\n\ntype Options = readonly [];\n\nconst isEslintDirectiveComment = (comment: Readonly<es.Comment>): boolean =>\n comment.type === \"Block\" && comment.value.trimStart().startsWith(\"eslint-\");\n\nconst expectedBlankLines = (comment: Readonly<es.Comment>): 0 | 1 => {\n if (comment.type === \"Line\" || isEslintDirectiveComment(comment)) {\n return 0;\n }\n\n return /\\r\\n|\\n/u.test(comment.value) ? 1 : 0;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n comment: Readonly<es.Comment>,\n nextNode: Readonly<es.Node | es.Token>,\n expected: number\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const textBetween = sourceCode.text.slice(\n comment.range[1],\n arrayFirst(nextNode.range)\n );\n const lineEnding = textBetween.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const indentation = \" \".repeat(nextNode.loc.start.column);\n\n return fixer.replaceTextRange(\n [comment.range[1], arrayFirst(nextNode.range)],\n `${lineEnding.repeat(expected + 1)}${indentation}`\n );\n };\n\n/**\n * Enforce consistent blank-line spacing after comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (): void => {\n const comments = context.sourceCode.getAllComments();\n\n for (const comment of comments) {\n const nextNode = context.sourceCode.getTokenAfter(comment, {\n includeComments: false,\n });\n if (nextNode === null) {\n continue;\n }\n\n const blankLines =\n nextNode.loc.start.line - comment.loc.end.line - 1;\n const expected = expectedBlankLines(comment);\n if (blankLines === expected) {\n continue;\n }\n\n context.report({\n fix: buildFix(\n context.sourceCode,\n comment,\n nextNode,\n expected\n ),\n messageId: \"invalidSpacing\",\n node: comment,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent blank-line spacing after comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/comment-spacing\",\n },\n fixable: \"whitespace\",\n hasSuggestions: false,\n messages: {\n invalidSpacing: \"Incorrect blank-line spacing after this comment.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"comment-spacing\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [];\n\nconst splitLines = (sourceText: string): readonly string[] =>\n stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n\nconst collapseEmptyLines = (sourceText: string): string => {\n const lines = splitLines(sourceText);\n let output: readonly string[] = [];\n let emptyRun = 0;\n\n for (const line of lines) {\n const isEmpty = line.trim().length === 0;\n if (!isEmpty) {\n emptyRun = 0;\n output = [...output, line];\n continue;\n }\n\n if (emptyRun < 1) {\n output = [...output, line];\n }\n\n emptyRun += 1;\n }\n\n return arrayJoin(output, \"\\n\");\n};\n\nconst hasTooManyEmptyLines = (sourceText: string): boolean => {\n let emptyRun = 0;\n\n for (const line of splitLines(sourceText)) {\n if (line.trim().length === 0) {\n emptyRun += 1;\n if (emptyRun >= 2) {\n return true;\n }\n } else {\n emptyRun = 0;\n }\n }\n\n return false;\n};\n\n/**\n * Enforce at most one consecutive empty line.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (node: Readonly<es.Program>): void => {\n const sourceText = context.sourceCode.getText();\n if (!hasTooManyEmptyLines(sourceText)) {\n return;\n }\n\n context.report({\n fix: (fixer): TSESLint.RuleFix =>\n fixer.replaceTextRange(\n [0, sourceText.length],\n collapseEmptyLines(sourceText)\n ),\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"enforce at most one consecutive empty line.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-empty-lines\",\n },\n fixable: \"whitespace\",\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Consecutive empty lines should be collapsed to a single blank line.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"consistent-empty-lines\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`TSEnumMember:not([id.name=/^[A-Z][A-Z_\\d]*$/u], [initializer.value=/^[A-Z][A-Z_\\d]*$/u])`;\n\n/**\n * Enforce SCREAMING_SNAKE_CASE enum member names and literal values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce SCREAMING_SNAKE_CASE enum member names and string literal values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-enum-members\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Enum member names and string values must use SCREAMING_SNAKE_CASE.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-enum-members\",\n});\n\nexport default rule;\n", "import { safeCastTo } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n }>,\n];\n\nconst defaultOptions = {\n format: safeCastTo<Casing>(\"kebab-case\"),\n};\n\n/**\n * Enforce filename casing consistency with optional selector-based overrides.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => ({\n Program: (node): void => {\n if (context.filename === \"<input>\") {\n return;\n }\n\n const stem = filenameStem(context.filename);\n const expected = toCasing(\n stem,\n options.format ?? defaultOptions.format\n );\n if (stem === expected) {\n return;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n defaultOptions: [defaultOptions],\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"enforce filename casing consistency.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-filename\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent: \"Filename should use '{{expected}}' casing.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for filename casing consistency enforcement.\",\n properties: {\n format: {\n description:\n \"Expected casing format for filename stems.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"consistent-filename\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/filename-case.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"filename-case\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\",\n },\n }),\n ],\n ruleId: \"consistent-filename\",\n});\n\nexport default deprecatedRule;\n", "import { arrayAt, arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { splitIdentifierBlocks } from \"./identifier-blocks.js\";\n\n/**\n * Supported casing formats for identifier transformations.\n */\nexport type Casing = \"camelCase\" | \"kebab-case\" | \"PascalCase\";\n\nconst splitWords = (value: string): readonly string[] =>\n splitIdentifierBlocks(value).map((word) => word.toLowerCase());\n\nconst toPascal = (value: string): string =>\n arrayJoin(\n splitWords(value).map(\n (word) => `${word[0]?.toUpperCase() ?? \"\"}${word.slice(1)}`\n ),\n \"\"\n );\n\n/**\n * Convert an input string into the requested casing format.\n */\nexport const toCasing = (value: string, format: Casing): string => {\n switch (format) {\n case \"camelCase\": {\n const pascal = toPascal(value);\n return `${pascal[0]?.toLowerCase() ?? \"\"}${pascal.slice(1)}`;\n }\n\n case \"kebab-case\": {\n return arrayJoin(splitWords(value), \"-\");\n }\n\n case \"PascalCase\": {\n return toPascal(value);\n }\n\n default: {\n return value;\n }\n }\n};\n\n/**\n * Extract the final filename segment without extension.\n */\nexport const filenameStem = (filePath: string): string => {\n const normalizedPath = filePath.replaceAll(\"\\\\\", \"/\");\n const pathSegments = stringSplit(normalizedPath, \"/\");\n const lastPathSegment = arrayAt(pathSegments, -1) ?? filePath;\n\n return lastPathSegment.replace(/\\.[^./\\\\]+$/u, \"\");\n};\n", "import { stringSplit } from \"ts-extras\";\n\nconst camelCaseBoundaryPattern = /(?<=[\\da-z])(?=[A-Z])/gu;\nconst nonAlphanumericPattern = /[^0-9A-Za-z]+/gu;\nconst whitespacePattern = /\\s+/gu;\n\n/**\n * Split identifier-like text into non-empty blocks while preserving original\n * block casing.\n */\nexport const splitIdentifierBlocks = (value: string): readonly string[] => {\n const normalized = value\n .replaceAll(camelCaseBoundaryPattern, \" \")\n .replaceAll(nonAlphanumericPattern, \" \")\n .trim();\n\n if (normalized.length === 0) {\n return [];\n }\n\n const normalizedWhitespace = normalized.replaceAll(whitespacePattern, \" \");\n\n return stringSplit(normalizedWhitespace, \" \").filter(\n (segment) => segment.length > 0\n );\n};\n\n/**\n * Count non-empty identifier blocks after casing/punctuation normalization.\n */\nexport const countIdentifierBlocks = (value: string): number =>\n splitIdentifierBlocks(value).length;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype ImportStyle = \"default\" | \"mixed\" | \"named\" | \"namespace\" | \"side-effect\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly style?: ImportStyle;\n }>,\n];\n\nconst styleFromImport = (node: Readonly<es.ImportDeclaration>): ImportStyle => {\n if (node.specifiers.length === 0) {\n return \"side-effect\";\n }\n\n const hasDefault = node.specifiers.some(\n (specifier) => specifier.type === \"ImportDefaultSpecifier\"\n );\n const hasNamed = node.specifiers.some(\n (specifier) => specifier.type === \"ImportSpecifier\"\n );\n const hasNamespace = node.specifiers.some(\n (specifier) => specifier.type === \"ImportNamespaceSpecifier\"\n );\n\n if (hasNamespace) {\n return \"namespace\";\n }\n\n if (hasDefault && hasNamed) {\n return \"mixed\";\n }\n\n if (hasDefault) {\n return \"default\";\n }\n\n return \"named\";\n};\n\n/**\n * Enforce consistent import declaration style per module source.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const seen = new Map<string, ImportStyle>();\n\n return {\n ImportDeclaration: (node: Readonly<es.ImportDeclaration>): void => {\n if (typeof node.source.value !== \"string\") {\n return;\n }\n\n const source = node.source.value;\n const style = styleFromImport(node);\n const expected = options.style ?? seen.get(source) ?? style;\n if (!isDefined(options.style)) {\n seen.set(source, expected);\n }\n\n if (style === expected) {\n return;\n }\n\n context.report({\n data: {\n expected,\n source,\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n };\n },\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent import declaration style per module source.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-import\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Imports from '{{source}}' should use '{{expected}}' style consistently.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for global import declaration style enforcement.\",\n properties: {\n style: {\n description:\n \"When provided, all imports must use this style.\",\n enum: [\n \"default\",\n \"mixed\",\n \"named\",\n \"namespace\",\n \"side-effect\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"consistent-import\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSUnionType\",\n \"PropertyDefinition[optional=true] > TSTypeAnnotation > TSUnionType\",\n ],\n \", \"\n);\n\nconst buildOptionalUnionFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on already-optional properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildOptionalUnionFixText(\n sourceCode,\n node\n );\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix => fixer.replaceText(node, fixedTypeText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` unions on optional property declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-optional-props\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Optional properties should not redundantly include `undefined` in their type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-optional-props\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = \"Literal.source[value=/.(?:js|json|ts)$/u]\";\n\n/**\n * Disallow explicit `.js`, `.json`, and `.ts` source extensions in\n * imports/exports.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require consistent import/export source paths without file extensions.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-source-extension\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Remove the source file extension from this import/export path.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-source-extension\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/extensions.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"extensions\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md\",\n },\n }),\n ],\n ruleId: \"consistent-source-extension\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst disallowedSelector = String.raw`CallExpression[callee.name='Symbol'] > Literal:not([value=/^(?:[\\da-z-]|__)+$/u])`;\n\n/**\n * Require `Symbol` descriptions to use kebab-case style.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require consistent kebab-case symbol descriptions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-symbol-description\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer kebab-case Symbol descriptions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-symbol-description\",\n});\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\n// eslint-disable-next-line import-x/no-deprecated, sonarjs/deprecation -- ESLint currently exposes core rules through this compatibility entrypoint.\nimport { builtinRules } from \"eslint/use-at-your-own-risk\";\nimport { isDefined } from \"ts-extras\";\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\n/**\n * Resolve a core ESLint rule module by rule ID.\n */\nexport const getCoreRule = (ruleId: string): RuleModule => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated, import-x/no-deprecated, sonarjs/deprecation -- ESLint currently exposes core rule modules through this entrypoint.\n const coreRule = builtinRules.get(ruleId);\n if (!isDefined(coreRule)) {\n throw new Error(`Missing core ESLint rule \"${ruleId}\".`);\n }\n\n return coreRule as unknown as RuleModule;\n};\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\n\nconst externalRule = getCoreRule(\"default-case\");\n\n/**\n * Proxy of ESLint core `default-case` with plugin-local docs URL.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/default-case\"\n);\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport {\n getImportSourceFromNode,\n shouldReportImportSource,\n} from \"./import-patterns.js\";\nimport { ruleCreator } from \"./rule-creator.js\";\n\n/**\n * Rule factory options for import source pattern rules.\n */\ninterface CreateImportPatternRuleOptions {\n /**\n * Default disallow patterns applied when options do not override\n * `disallow`.\n */\n readonly defaultDisallowPatterns: readonly string[];\n /**\n * Human-friendly rule description.\n */\n readonly description: string;\n /**\n * Rule identifier used for metadata and exported rule map key.\n */\n readonly name: string;\n}\n\ntype ImportPatternMessageIds = \"disallowedSource\";\n\n/**\n * Rule options tuple for import pattern rules.\n */\ntype ImportPatternRuleOptions = readonly [\n {\n readonly allow?: readonly string[];\n readonly disallow?: readonly string[];\n }?,\n];\n\nconst createImportVisitors = (\n context: Parameters<\n ReturnType<\n typeof ruleCreator<\n ImportPatternRuleOptions,\n ImportPatternMessageIds\n >\n >[\"create\"]\n >[0],\n defaultDisallowPatterns: readonly string[]\n): Readonly<Record<string, (node: Readonly<es.Node>) => void>> => ({\n \"ImportDeclaration, ExportNamedDeclaration[source], ExportAllDeclaration, ImportExpression\":\n (node: Readonly<es.Node>): void => {\n const sourceText = getImportSourceFromNode(node);\n if (!isDefined(sourceText)) {\n return;\n }\n\n const [options = {}] = context.options;\n if (\n !shouldReportImportSource(\n sourceText,\n options,\n defaultDisallowPatterns\n )\n ) {\n return;\n }\n\n context.report({\n data: {\n source: sourceText,\n },\n messageId: \"disallowedSource\",\n node,\n });\n },\n});\n\n/**\n * Creates a rule that disallows import/export sources by glob pattern.\n *\n * @param options - Rule creation options.\n *\n * @returns ESLint rule module.\n */\nexport const createImportPatternRule = ({\n defaultDisallowPatterns,\n description,\n name,\n}: Readonly<CreateImportPatternRuleOptions>): ReturnType<\n typeof ruleCreator<ImportPatternRuleOptions, ImportPatternMessageIds>\n> =>\n ruleCreator<ImportPatternRuleOptions, ImportPatternMessageIds>({\n create: (context) =>\n createImportVisitors(context, defaultDisallowPatterns),\n meta: {\n defaultOptions: [{}],\n docs: {\n description,\n recommended: false,\n url: `https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/${name.replaceAll(\"/\", \"-\")}`,\n },\n hasSuggestions: false,\n messages: {\n disallowedSource:\n \"Import source `{{ source }}` is disallowed by this rule.\",\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n allow: {\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n disallow: {\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name,\n });\n\nexport type { ImportPatternRuleOptions };\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { minimatch } from \"minimatch\";\n\n/**\n * Allow/disallow glob options for import source checks.\n */\ntype ImportPathOptions = Readonly<{\n readonly allow?: readonly string[];\n readonly disallow?: readonly string[];\n}>;\n\nconst matchesAnyPattern = (\n value: string,\n patterns: readonly string[]\n): boolean =>\n patterns.some((pattern) =>\n minimatch(value, pattern, {\n dot: true,\n nocase: false,\n })\n );\n\nconst getImportSourceText = (node: Readonly<es.Node>): string | undefined => {\n if (\n node.type === \"ExportAllDeclaration\" ||\n node.type === \"ImportDeclaration\"\n ) {\n return node.source.value;\n }\n\n if (node.type === \"ExportNamedDeclaration\") {\n return node.source?.value;\n }\n\n if (node.type === \"ImportExpression\") {\n return node.source.type === \"Literal\" &&\n typeof node.source.value === \"string\"\n ? node.source.value\n : undefined;\n }\n\n return undefined;\n};\n\nconst toMergedOptions = (\n options: Readonly<ImportPathOptions> | undefined,\n defaultDisallowPatterns: readonly string[]\n): Required<ImportPathOptions> => ({\n allow: options?.allow ?? [],\n disallow: options?.disallow ?? defaultDisallowPatterns,\n});\n\n/**\n * Determines whether an import source should be reported.\n *\n * @param sourceText - Source text from an import/export node.\n * @param options - Rule options for allow/disallow overrides.\n * @param defaultDisallowPatterns - Rule-specific default disallow patterns.\n *\n * @returns `true` when the source matches a disallow pattern and no allow\n * pattern.\n */\nexport const shouldReportImportSource = (\n sourceText: string,\n options: Readonly<ImportPathOptions> | undefined,\n defaultDisallowPatterns: readonly string[]\n): boolean => {\n const mergedOptions = toMergedOptions(options, defaultDisallowPatterns);\n if (!matchesAnyPattern(sourceText, mergedOptions.disallow)) {\n return false;\n }\n\n return !matchesAnyPattern(sourceText, mergedOptions.allow);\n};\n\n/**\n * Gets import source text from supported import/export AST nodes.\n *\n * @param node - AST node to inspect.\n *\n * @returns Source text when present and string-literal based, otherwise\n * `undefined`.\n */\nexport const getImportSourceFromNode = (\n node: Readonly<es.Node>\n): string | undefined => getImportSourceText(node);\n\nexport type { ImportPathOptions };\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow import and export sources by configured glob patterns.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [],\n description:\n \"disallow import sources using configurable glob patterns.\",\n name: \"disallow-import\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { resolve } from \"node:path\";\nimport { isEmpty } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"onlyExport\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n }>,\n];\n\nconst exportedNamesFromDeclaration = (\n node: Readonly<es.ExportNamedDeclaration>\n): readonly string[] => {\n if (node.specifiers.length > 0) {\n return node.specifiers\n .filter(\n (specifier): specifier is es.ExportSpecifier =>\n specifier.type === \"ExportSpecifier\"\n )\n .flatMap((specifier) =>\n specifier.exported.type === \"Identifier\"\n ? [specifier.exported.name]\n : []\n );\n }\n\n if (\n node.declaration?.type === \"ClassDeclaration\" ||\n node.declaration?.type === \"FunctionDeclaration\"\n ) {\n return node.declaration.id === null ? [] : [node.declaration.id.name];\n }\n\n return [];\n};\n\n/**\n * Enforce that exports matching the filename are the only export in the file.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n let exports: readonly {\n readonly name: string;\n readonly node: es.Node;\n }[] = [];\n\n return {\n ExportDefaultDeclaration: (\n node: Readonly<es.ExportDefaultDeclaration>\n ): void => {\n exports = [\n ...exports,\n {\n name: \"default\",\n node,\n },\n ];\n },\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n for (const name of exportedNamesFromDeclaration(node)) {\n exports = [...exports, { name, node }];\n }\n },\n \"Program:exit\": (): void => {\n if (context.filename === \"<input>\") {\n return;\n }\n\n const stem = filenameStem(resolve(context.filename));\n const expected = toCasing(stem, options.format ?? \"PascalCase\");\n const matching = exports.filter(\n (entry) => entry.name === expected\n );\n if (isEmpty(matching) || exports.length <= 1) {\n return;\n }\n\n for (const entry of exports) {\n if (entry.name === expected) {\n continue;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"onlyExport\",\n node: entry.node,\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ format: \"PascalCase\" }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce filename-matching exports to be the only export.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/export-matching-filename-only\",\n },\n hasSuggestions: false,\n messages: {\n onlyExport:\n \"When exporting '{{expected}}', it must be the only export in this file.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for filename-matching export exclusivity checks.\",\n properties: {\n format: {\n description:\n \"Casing format used to derive expected export name from filename.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"export-matching-filename-only\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { resolve } from \"node:path\";\nimport { isDefined } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"mismatch\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n readonly match?: boolean;\n readonly prefix?: string;\n readonly selector?: readonly string[] | string;\n readonly suffix?: string;\n }>,\n];\n\nconst defaultSelectors = [\n \"ClassDeclaration > Identifier.id\",\n \"FunctionDeclaration > Identifier.id\",\n \"TSInterfaceDeclaration > Identifier.id\",\n \"TSTypeAliasDeclaration > Identifier.id\",\n] as const;\n\nconst normalizeSelector = (\n selector: Options[0][\"selector\"]\n): readonly string[] => {\n if (!isDefined(selector)) {\n return defaultSelectors;\n }\n\n if (typeof selector === \"string\") {\n return [selector];\n }\n\n return selector;\n};\n\n/**\n * Enforce that selected declaration identifiers match the current filename.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const selectorList = normalizeSelector(options.selector);\n let listeners: Readonly<\n Record<string, (node: Readonly<es.Node>) => void>\n > = {};\n\n for (const selector of selectorList) {\n listeners = {\n ...listeners,\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n context.filename === \"<input>\" ||\n node.type !== \"Identifier\"\n ) {\n return;\n }\n\n const stem = filenameStem(resolve(context.filename));\n const expected = `${options.prefix ?? \"\"}${toCasing(\n node.name,\n options.format ?? \"kebab-case\"\n )}${options.suffix ?? \"\"}`;\n const matches = stem === expected;\n\n if ((options.match ?? true) ? matches : !matches) {\n return;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"mismatch\",\n node,\n });\n },\n };\n }\n\n return listeners;\n },\n meta: {\n defaultOptions: [{ format: \"kebab-case\", match: true }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce selected declaration identifiers to match filename casing.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/match-filename\",\n },\n hasSuggestions: false,\n messages: {\n mismatch: \"Identifier should match filename '{{expected}}'.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for declaration-name to filename matching.\",\n properties: {\n format: {\n description:\n \"Casing format applied to declaration identifiers.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n match: {\n description:\n \"Whether declaration names must match (true) or must differ from (false) filename.\",\n type: \"boolean\",\n },\n prefix: {\n description:\n \"Prefix expected before transformed identifier.\",\n type: \"string\",\n },\n selector: {\n description:\n \"Selector(s) used to pick declaration identifiers to compare.\",\n oneOf: [\n {\n description: \"Single selector string.\",\n type: \"string\",\n },\n {\n description: \"Multiple selector strings.\",\n items: {\n description: \"Selector string.\",\n type: \"string\",\n },\n type: \"array\",\n },\n ],\n },\n suffix: {\n description:\n \"Suffix expected after transformed identifier.\",\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"match-filename\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { countIdentifierBlocks } from \"../_internal/identifier-blocks.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst maxIdentifierBlocks = 4;\n\nconst disallowedSelector = arrayJoin(\n [\"Identifier.id\", \":not(Property[shorthand=true]) > Identifier.key\"],\n \", \"\n);\n\n/**\n * Disallow identifiers containing more than four casing blocks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Identifier>): void => {\n if (countIdentifierBlocks(node.name) <= maxIdentifierBlocks) {\n return;\n }\n\n context.report({\n data: {\n max: maxIdentifierBlocks,\n },\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow identifiers with more than four casing blocks.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/max-identifier-blocks\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Identifier should not contain more than {{max}} blocks.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"max-identifier-blocks\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\nconst readonlyArrayTypeNames = new Set([\"ReadonlyArray\"]);\n\nconst isArrayLikeType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n const apparentType = typeChecker.getApparentType(type);\n\n return (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker) ||\n containsAllTypesByName(type, false, readonlyArrayTypeNames, true)\n );\n};\n\nconst creatorMethodNames = new Set([\n \"concat\",\n \"entries\",\n \"filter\",\n \"keys\",\n \"map\",\n \"slice\",\n \"splice\",\n \"values\",\n]);\n\nconst isArrayFactoryCallee = (callee: Readonly<es.Expression>): boolean => {\n if (callee.type === \"Identifier\") {\n return callee.name === \"Array\";\n }\n\n if (\n callee.type === \"MemberExpression\" &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"Array\" &&\n callee.property.type === \"Identifier\"\n ) {\n return callee.property.name === \"from\" || callee.property.name === \"of\";\n }\n\n return false;\n};\n\nconst isNewArray = (node: Readonly<es.Expression>): boolean => {\n if (node.type === \"ArrayExpression\") {\n return true;\n }\n\n if (node.type === \"CallExpression\") {\n return isArrayFactoryCallee(node.callee);\n }\n\n return false;\n};\n\nconst mutatesReferencedArray = (\n callExpression: Readonly<es.CallExpression>\n): boolean => {\n if (callExpression.callee.type !== \"MemberExpression\") {\n return true;\n }\n\n const { object, property } = callExpression.callee;\n\n if (\n property.type === \"Identifier\" &&\n setHas(creatorMethodNames, property.name)\n ) {\n return false;\n }\n\n if (isNewArray(object)) {\n return false;\n }\n\n if (object.type === \"CallExpression\") {\n return mutatesReferencedArray(object);\n }\n\n return true;\n};\n\n/**\n * Disallow assigning arrays returned by mutating methods like `fill`,\n * `reverse`, and `sort`.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name=/^(?:fill|reverse|sort)$/]\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\") {\n return;\n }\n\n const { property } = callee;\n if (property.type !== \"Identifier\") {\n return;\n }\n\n if (\n callExpression.parent?.type ===\n \"ExpressionStatement\"\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (!isArrayLikeType(typeChecker, objectType)) {\n return;\n }\n\n if (!mutatesReferencedArray(callExpression)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: property,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow assigning values returned from mutating array methods.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-assign-mutated-array\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Assignment of mutated arrays is forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-assign-mutated-array\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing exactly from `@`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"@\"],\n description: \"disallow imports from @.\",\n name: \"no-at-sign-import\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing internal module paths under `@/`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"@/**\"],\n description: \"disallow internal imports under @/.\",\n name: \"no-at-sign-internal-import\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"LogicalExpression[operator='??'][left.type='ChainExpression']\";\n\n/**\n * Disallow mixing optional chaining expressions directly with nullish\n * coalescing.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow mixing chain and coalescence operators in a single expression.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-chain-coalescence-mixture\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not mix optional chaining and nullish coalescing in the same expression.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-chain-coalescence-mixture\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport parser from \"@typescript-eslint/parser\";\nimport { arrayFirst, arrayJoin, isDefined, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype CommentBlock = Readonly<{\n readonly content: string;\n readonly loc: es.SourceLocation;\n}>;\n\ntype MessageIds = \"forbidden\";\n\nconst parserOptions: Readonly<{\n readonly ecmaVersion: \"latest\";\n readonly sourceType: \"module\";\n}> = {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n};\n\nconst parseCommentProgram = (\n cache: ReadonlyMap<string, es.Program | null>,\n content: string\n): readonly [\n ReadonlyMap<string, es.Program | null>,\n (\n es.Program | undefined\n ),\n] => {\n const cached = cache.get(content);\n if (cached !== undefined) {\n return [cache, cached ?? undefined];\n }\n\n try {\n const parsed = parser.parse(content, parserOptions);\n const nextCache = new Map(cache);\n nextCache.set(content, parsed);\n return [nextCache, parsed];\n } catch {\n const nextCache = new Map(cache);\n nextCache.set(content, null);\n return [nextCache, undefined];\n }\n};\n\nconst isRegionComment = (content: string): boolean => {\n const normalized = content.trimStart().toLowerCase();\n return (\n normalized.startsWith(\"#endregion\") || normalized.startsWith(\"#region\")\n );\n};\n\nconst stripLeadingAsterisk = (line: string): string => {\n const trimmedLine = line.trimStart();\n if (!trimmedLine.startsWith(\"*\")) {\n return line;\n }\n\n return trimmedLine.slice(1);\n};\n\nconst normalizeBlockCommentContent = (content: string): string =>\n arrayJoin(\n stringSplit(content, \"\\n\").map((line) => stripLeadingAsterisk(line)),\n \"\\n\"\n );\n\nconst toLocCopy = (loc: Readonly<es.SourceLocation>): es.SourceLocation => ({\n end: loc.end,\n start: loc.start,\n});\n\nconst toCommentBlocks = (\n comments: readonly Readonly<es.Comment>[]\n): readonly CommentBlock[] => {\n let blocks: readonly CommentBlock[] = [];\n let previousLineComment: es.LineComment | null = null;\n\n for (const comment of comments) {\n if (comment.type === \"Block\") {\n blocks = [\n ...blocks,\n {\n content: normalizeBlockCommentContent(comment.value),\n loc: toLocCopy(comment.loc),\n },\n ];\n previousLineComment = null;\n continue;\n }\n\n const previousBlockIndex =\n previousLineComment?.loc.start.line === comment.loc.start.line - 1\n ? blocks.length - 1\n : -1;\n const previousBlock =\n previousBlockIndex >= 0 ? blocks[previousBlockIndex] : undefined;\n\n blocks = isDefined(previousBlock)\n ? [\n ...blocks.slice(0, previousBlockIndex),\n {\n content: `${previousBlock.content}\\n${comment.value}`,\n loc: {\n end: comment.loc.end,\n start: previousBlock.loc.start,\n },\n },\n ...blocks.slice(previousBlockIndex + 1),\n ]\n : [\n ...blocks,\n {\n content: comment.value,\n loc: toLocCopy(comment.loc),\n },\n ];\n\n previousLineComment = comment;\n }\n\n return blocks;\n};\n\nconst isExpressionOrIdentifierOrLiteral = (\n node: Readonly<es.Node>\n): boolean => {\n if (node.type === \"Identifier\" || node.type === \"Literal\") {\n return true;\n }\n\n if (node.type !== \"BinaryExpression\") {\n return false;\n }\n\n return (\n isExpressionOrIdentifierOrLiteral(node.left) &&\n isExpressionOrIdentifierOrLiteral(node.right)\n );\n};\n\nconst isTrivialProgram = (program: Readonly<es.Program>): boolean => {\n if (program.body.length === 0) {\n return true;\n }\n\n if (\n program.body.length === 1 &&\n arrayFirst(program.body)?.type === \"LabeledStatement\"\n ) {\n return true;\n }\n\n return program.body.every(\n (statement) =>\n statement.type === \"ExpressionStatement\" &&\n isExpressionOrIdentifierOrLiteral(statement.expression)\n );\n};\n\nconst getWrappedContent = (\n content: string,\n node: null | Readonly<es.Node>\n): string | undefined => {\n if (node === null) {\n return undefined;\n }\n\n if (node.type === \"ArrayExpression\") {\n return `const wrapper = [${content}]`;\n }\n\n if (node.type === \"ClassBody\") {\n return `class Wrapper { ${content} }`;\n }\n\n if (node.type === \"FunctionDeclaration\") {\n return `function wrapper(${content}) {}`;\n }\n\n if (node.type === \"ImportDeclaration\") {\n return `import { ${content} } from \"wrapper\"`;\n }\n\n if (node.type === \"ObjectExpression\") {\n return `const wrapper = { ${content} }`;\n }\n\n if (node.type === \"SwitchStatement\") {\n return `switch (wrapper) { ${content} }`;\n }\n\n if (node.type === \"TSInterfaceBody\") {\n return `interface Wrapper { ${content} }`;\n }\n\n if (node.type === \"TSTypeLiteral\") {\n return `type Wrapper = { ${content} }`;\n }\n\n return undefined;\n};\n\n/**\n * Disallow comment blocks that appear to contain executable or declaration\n * code.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n let parseCache: ReadonlyMap<string, es.Program | null> = new Map<\n string,\n es.Program | null\n >();\n\n return {\n Program: () => {\n const { sourceCode } = context;\n\n for (const block of toCommentBlocks(\n sourceCode.getAllComments()\n )) {\n if (isRegionComment(block.content)) {\n continue;\n }\n\n const [nextCacheAfterParse, parsedComment] =\n parseCommentProgram(parseCache, block.content);\n parseCache = nextCacheAfterParse;\n if (parsedComment !== undefined) {\n if (!isTrivialProgram(parsedComment)) {\n context.report({\n loc: block.loc,\n messageId: \"forbidden\",\n });\n }\n\n continue;\n }\n\n const index = sourceCode.getIndexFromLoc(\n block.loc.start\n );\n const node = sourceCode.getNodeByRangeIndex(index);\n const wrappedContent = getWrappedContent(\n block.content,\n node\n );\n if (!isDefined(wrappedContent)) {\n continue;\n }\n\n const [\n nextCacheAfterWrappedParse,\n parsedWrappedComment,\n ] = parseCommentProgram(parseCache, wrappedContent);\n parseCache = nextCacheAfterWrappedParse;\n\n if (parsedWrappedComment !== undefined) {\n context.report({\n loc: block.loc,\n messageId: \"forbidden\",\n });\n }\n }\n },\n };\n },\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow commented-out code blocks.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-commented-out-code\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Commented-out code is forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-commented-out-code\",\n });\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of eslint-plugin-no-commented-code/no-commented-code.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"no-commented-code\",\n url: \"https://www.npmjs.com/package/eslint-plugin-no-commented-code\",\n },\n rule: {\n name: \"no-commented-code\",\n url: \"https://www.npmjs.com/package/eslint-plugin-no-commented-code\",\n },\n }),\n ],\n ruleId: \"no-commented-out-code\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveConst\";\n\ntype Options = readonly [\n {\n readonly allowLocal?: boolean;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\nconst isExportedEnumDeclaration = (\n node: Readonly<es.TSEnumDeclaration>\n): boolean => node.parent?.type === \"ExportNamedDeclaration\";\n\nconst getConstToken = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.TSEnumDeclaration>\n) =>\n sourceCode.getFirstToken(node, {\n filter: (token): boolean => token.value === \"const\",\n }) ?? undefined;\n\n/**\n * Disallow `const enum` declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSEnumDeclaration: (node: Readonly<es.TSEnumDeclaration>) => {\n if (!node.const) {\n return;\n }\n\n const [{ allowLocal = false } = {}] = context.options;\n if (allowLocal && !isExportedEnumDeclaration(node)) {\n return;\n }\n\n const constToken = getConstToken(sourceCode, node);\n const fix: TSESLint.ReportFixFunction | undefined =\n constToken === undefined\n ? undefined\n : (fixer) => {\n let removeEnd = constToken.range[1];\n while (\n removeEnd < sourceCode.text.length &&\n (sourceCode.text.at(removeEnd) === \" \" ||\n sourceCode.text.at(removeEnd) === \"\\t\")\n ) {\n removeEnd += 1;\n }\n\n return fixer.removeRange([\n arrayFirst(constToken.range),\n removeEnd,\n ]);\n };\n\n context.report({\n messageId: \"forbidden\",\n node: node.id,\n ...(fix === undefined\n ? {}\n : {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveConst\",\n },\n ],\n }),\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow const enum declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-const-enum\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"`const enum` declarations are forbidden.\",\n suggestRemoveConst:\n \"Remove the const modifier from this enum declaration.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for allowing non-exported const enum declarations.\",\n properties: {\n allowLocal: {\n description:\n \"Allow const enum declarations when they are not exported.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-const-enum\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined, isEmpty } from \"ts-extras\";\n\nimport {\n compileIgnorePatterns,\n type IgnoreMode,\n type IgnorePatternBuckets,\n} from \"../_internal/ignore-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport {\n getIdentifierSymbol,\n getJsDocTagComments,\n isDeclarationIdentifier,\n isImportOrExportSpecifier,\n matchesAnyPattern,\n} from \"../_internal/symbol-usage.js\";\n\ntype MessageIds = \"forbidden\" | \"forbiddenWithComment\" | \"invalidIgnorePattern\";\n\ntype Options = readonly [\n {\n readonly ignored?: Readonly<Record<string, IgnoreMode>>;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\n/**\n * Disallow usages of symbols tagged with `@deprecated`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ ignored = {} } = {}] = context.options;\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n const compiledIgnorePatterns = compileIgnorePatterns(ignored);\n const ignorePatterns: IgnorePatternBuckets =\n compiledIgnorePatterns.patterns;\n\n return {\n Identifier: (node: Readonly<es.Identifier>) => {\n if (isImportOrExportSpecifier(node.parent)) {\n return;\n }\n\n if (isDeclarationIdentifier(node)) {\n return;\n }\n\n const symbol = getIdentifierSymbol(parserServices, node);\n if (!isDefined(symbol)) {\n return;\n }\n\n const symbolName = symbol.getName();\n if (matchesAnyPattern(symbolName, ignorePatterns.name)) {\n return;\n }\n\n const fullyQualifiedName =\n typeChecker.getFullyQualifiedName(symbol);\n if (\n matchesAnyPattern(fullyQualifiedName, ignorePatterns.path)\n ) {\n return;\n }\n\n const deprecatedComments = getJsDocTagComments(\n symbol,\n typeChecker,\n \"deprecated\"\n );\n if (isEmpty(deprecatedComments)) {\n return;\n }\n\n for (const comment of deprecatedComments) {\n if (!isDefined(comment)) {\n context.report({\n data: { name: symbolName },\n messageId: \"forbidden\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n comment,\n name: symbolName,\n },\n messageId: \"forbiddenWithComment\",\n node,\n });\n }\n },\n Program: (node: Readonly<es.Program>) => {\n for (const invalidPattern of compiledIgnorePatterns.invalidPatterns) {\n context.report({\n data: {\n pattern: invalidPattern,\n },\n messageId: \"invalidIgnorePattern\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow usage of APIs tagged with @deprecated.\",\n frozen: true,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-deprecated\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: '\"{{name}}\" is deprecated.',\n forbiddenWithComment: '\"{{name}}\" is deprecated: {{comment}}',\n invalidIgnorePattern:\n \"Invalid ignored regex pattern '{{pattern}}'. Update this rule option to a valid regular expression.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for ignoring deprecated symbols by name or declaration path pattern.\",\n properties: {\n ignored: {\n additionalProperties: {\n description:\n 'Match behavior for the pattern key. Use \"name\" to match symbol names or \"path\" to match fully-qualified declaration paths.',\n enum: [\"name\", \"path\"],\n type: \"string\",\n },\n description: \"Map of regex patterns to ignore mode.\",\n type: \"object\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-deprecated\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-deprecated.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-deprecated\",\n url: \"https://typescript-eslint.io/rules/no-deprecated\",\n },\n }),\n ],\n ruleId: \"no-deprecated\",\n});\n\nexport default deprecatedRule;\n", "import { objectEntries } from \"ts-extras\";\n\n/**\n * Compiled ignore-pattern result grouped by mode with invalid entries tracked.\n */\nexport type CompiledIgnorePatterns = Readonly<{\n readonly invalidPatterns: readonly string[];\n readonly patterns: IgnorePatternBuckets;\n}>;\n\n/**\n * Supported matching modes for symbol-ignore configuration.\n */\nexport type IgnoreMode = \"name\" | \"path\";\n\n/**\n * Compiled regex buckets for name- and path-based ignores.\n */\nexport type IgnorePatternBuckets = Readonly<{\n readonly name: readonly RegExp[];\n readonly path: readonly RegExp[];\n}>;\n\n/* eslint-disable security/detect-non-literal-regexp -- Rule options intentionally accept user-provided regex strings. */\n/**\n * Compile ignore-option regex patterns into mode buckets.\n *\n * Invalid regex patterns are returned for caller-side reporting so rule\n * configuration issues are never swallowed silently.\n */\nexport const compileIgnorePatterns = (\n ignored: Readonly<Record<string, IgnoreMode>>\n): CompiledIgnorePatterns => {\n let namePatterns: readonly RegExp[] = [];\n let pathPatterns: readonly RegExp[] = [];\n let invalidPatterns: readonly string[] = [];\n\n for (const [pattern, mode] of objectEntries(ignored)) {\n try {\n const regularExpression = new RegExp(pattern, \"u\");\n if (mode === \"name\") {\n namePatterns = [...namePatterns, regularExpression];\n } else {\n pathPatterns = [...pathPatterns, regularExpression];\n }\n } catch {\n invalidPatterns = [...invalidPatterns, pattern];\n }\n }\n\n return {\n invalidPatterns,\n patterns: {\n name: namePatterns,\n path: pathPatterns,\n },\n };\n};\n/* eslint-enable security/detect-non-literal-regexp -- Re-enable dynamic-regex checks outside option pattern compilation. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\nimport type { UnknownRecord } from \"type-fest\";\n\nimport { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { arrayJoin, isDefined, keyIn } from \"ts-extras\";\n\ntype JsDocTagInfo = Readonly<{\n readonly name: string;\n readonly text?: readonly JsDocTagTextPart[] | string;\n}>;\n\ntype JsDocTagTextPart = Readonly<{ readonly text: string }>;\n\ntype ParserServices = Readonly<\n Parameters<typeof getConstrainedTypeAtLocation>[0]\n>;\n\ntype SymbolWithJsDocTags = Readonly<{\n readonly getJsDocTags: (checker?: unknown) => readonly JsDocTagInfo[];\n}>;\n\n/**\n * Whether an identifier belongs to an import/export specifier position.\n */\nexport const isImportOrExportSpecifier = (\n parent: Readonly<es.Node> | undefined\n): boolean =>\n parent?.type === \"ExportSpecifier\" ||\n parent?.type === \"ImportDefaultSpecifier\" ||\n parent?.type === \"ImportNamespaceSpecifier\" ||\n parent?.type === \"ImportSpecifier\";\n\n/**\n * Whether an identifier is the declaration identifier for supported node types.\n */\nexport const isDeclarationIdentifier = (\n node: Readonly<es.Identifier>\n): boolean => {\n const { parent } = node;\n if (parent === undefined) {\n return false;\n }\n\n if (\n parent.type === \"TSInterfaceDeclaration\" ||\n parent.type === \"TSTypeAliasDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ClassDeclaration\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"TSDeclareFunction\" ||\n parent.type === \"TSEnumDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id === node;\n }\n\n return false;\n};\n\nconst normalizeTagComment = (\n text: readonly JsDocTagTextPart[] | string | undefined\n): string | undefined => {\n if (!isDefined(text)) {\n return undefined;\n }\n\n if (typeof text === \"string\") {\n const normalized = text.trim().replaceAll(/\\s+/gu, \" \");\n return normalized.length > 0 ? normalized : undefined;\n }\n\n const normalized = arrayJoin(\n text.map((part) => part.text),\n \"\"\n )\n .replaceAll(/\\s+/gu, \" \")\n .trim();\n\n return normalized.length > 0 ? normalized : undefined;\n};\n\nconst isUnknownRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null;\n\nconst isSymbolWithJsDocTags = (\n symbol: unknown\n): symbol is SymbolWithJsDocTags => {\n if (!isUnknownRecord(symbol)) {\n return false;\n }\n\n if (!keyIn(symbol, \"getJsDocTags\")) {\n return false;\n }\n\n return typeof symbol[\"getJsDocTags\"] === \"function\";\n};\n\n/**\n * Collect normalized comment payloads for a specific JSDoc tag name.\n */\nexport const getJsDocTagComments = (\n symbol: unknown,\n checker: unknown,\n tagName: string\n): readonly (string | undefined)[] => {\n if (!isSymbolWithJsDocTags(symbol)) {\n return [];\n }\n\n const tags = symbol.getJsDocTags();\n const resolvedTags = tags.length > 0 ? tags : symbol.getJsDocTags(checker);\n\n return resolvedTags\n .filter((tag) => tag.name === tagName)\n .map((tag) => normalizeTagComment(tag.text));\n};\n\n/**\n * Return true when text matches any compiled regex pattern.\n */\nexport const matchesAnyPattern = (\n text: string,\n patterns: readonly Readonly<RegExp>[]\n): boolean => patterns.some((pattern) => pattern.test(text));\n\n/**\n * Resolve the symbol at identifier location, falling back to constrained type.\n */\nexport const getIdentifierSymbol = (\n parserServices: ParserServices,\n node: Readonly<es.Identifier>\n): ReturnType<ParserServices[\"getSymbolAtLocation\"]> | undefined => {\n const symbolFromLocation = parserServices.getSymbolAtLocation(node);\n if (isDefined(symbolFromLocation)) {\n return symbolFromLocation;\n }\n\n return getConstrainedTypeAtLocation(parserServices, node).getSymbol();\n};\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\n/**\n * Disallow TypeScript enum declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => ({\n TSEnumDeclaration: (node: Readonly<es.TSEnumDeclaration>) => {\n context.report({\n messageId: \"forbidden\",\n node: node.id,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow TypeScript enum declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-enum\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"`enum` declarations are forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-enum\",\n });\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst splitLines = (sourceText: string): readonly string[] =>\n stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n\nconst hasBlankLine = (text: string): boolean =>\n splitLines(text).some((line) => line.trim().length === 0);\n\nconst normalizeExpressionSource = (sourceText: string): string => {\n const lines = splitLines(sourceText).map((line) => line.trimEnd());\n\n return arrayJoin(\n lines.filter((line) => line.trim().length > 0),\n \"\\n\"\n );\n};\n\nconst createFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.ExpressionStatement>\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const sourceText = sourceCode.getText(node.expression);\n const replacement = `${normalizeExpressionSource(sourceText)};`;\n\n return fixer.replaceText(node, replacement);\n };\n\n/**\n * Disallow blank lines inside expression statements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ExpressionStatement: (node: Readonly<es.ExpressionStatement>): void => {\n const sourceText = context.sourceCode.getText(node.expression);\n if (!hasBlankLine(sourceText)) {\n return;\n }\n\n context.report({\n fix: createFix(context.sourceCode, node),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow blank lines inside expression statements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-expression-empty-lines\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Expression statement contains unnecessary blank lines.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-expression-empty-lines\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [\n {\n readonly types?: readonly string[];\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\nconst defaultTypes: readonly string[] = [\n \"Array\",\n \"Map\",\n \"NodeList\",\n \"Set\",\n];\n\nconst getConfiguredTypeNames = (\n configuredTypes: readonly string[]\n): ReadonlySet<string> => {\n const typeNames = new Set<string>();\n\n for (const configuredType of configuredTypes) {\n typeNames.add(configuredType);\n if (configuredType === \"Array\") {\n typeNames.add(\"ReadonlyArray\");\n }\n }\n\n return typeNames;\n};\n\nconst matchesConfiguredCollectionType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>,\n configuredTypeNames: ReadonlySet<string>\n): boolean => {\n if (setHas(configuredTypeNames, \"Array\")) {\n const apparentType = typeChecker.getApparentType(type);\n\n if (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker)\n ) {\n return true;\n }\n }\n\n return containsAllTypesByName(\n type,\n false,\n new Set(configuredTypeNames),\n true\n );\n};\n\n/**\n * Disallow calling `forEach` on configured collection types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n const [{ types = defaultTypes } = {}] = context.options;\n const configuredTypeNames = getConfiguredTypeNames(types);\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='forEach']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\") {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (\n !matchesConfiguredCollectionType(\n typeChecker,\n objectType,\n configuredTypeNames\n )\n ) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: callee.property,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow calling forEach on configured collection types.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-foreach\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Calling `forEach` is forbidden for this type.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for collection type names that are not allowed to use forEach.\",\n properties: {\n types: {\n description:\n \"Type names to disallow forEach on (for example Array, Map, NodeList, Set).\",\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-foreach\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Returns true if the given node is a `BlockStatement` or a `Program` \u2014 i.e., a\n * node that has a `body` array of `Statement` nodes.\n */\nconst isStatementList = (\n node: Readonly<es.Node>\n): node is es.BlockStatement | es.Program =>\n node.type === \"BlockStatement\" || node.type === \"Program\";\n\nconst getLineStartIndex = (sourceText: string, index: number): number =>\n sourceText.lastIndexOf(\"\\n\", index - 1) + 1;\n\nconst getSafeFixRangeStart = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.FunctionDeclaration>\n): number => {\n const declarationStart = arrayFirst(node.range) ?? 0;\n const tokenBeforeDeclaration = sourceCode.getTokenBefore(node);\n const tokenBeforeEnd =\n tokenBeforeDeclaration === null\n ? 0\n : (arrayLast(tokenBeforeDeclaration.range) ?? 0);\n\n const commentsBeforeDeclaration = sourceCode\n .getCommentsBefore(node)\n .filter(\n (comment) =>\n (arrayFirst(comment.range) ?? 0) >= tokenBeforeEnd &&\n (arrayLast(comment.range) ?? 0) <= declarationStart\n );\n\n const firstLeadingComment = arrayFirst(commentsBeforeDeclaration);\n const firstMovableNodeStart =\n firstLeadingComment === undefined\n ? declarationStart\n : (arrayFirst(firstLeadingComment.range) ?? declarationStart);\n\n return getLineStartIndex(sourceCode.text, firstMovableNodeStart);\n};\n\nconst getSafeFixRangeEnd = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.FunctionDeclaration>\n): number => {\n const declarationEnd = arrayLast(node.range) ?? 0;\n const tokenAfterDeclaration = sourceCode.getTokenAfter(node);\n\n if (tokenAfterDeclaration === null) {\n return declarationEnd;\n }\n\n return getLineStartIndex(\n sourceCode.text,\n arrayFirst(tokenAfterDeclaration.range) ?? declarationEnd\n );\n};\n\n/**\n * Disallow function declarations that appear after a `return` statement in the\n * same block scope.\n *\n * JavaScript hoists function declarations to the top of their enclosing scope,\n * so placing a function declaration after a `return` works at runtime. However,\n * it hurts readability and confuses readers who are not aware of hoisting.\n *\n * Only `FunctionDeclaration` nodes are targeted. Arrow-function expressions,\n * function expressions assigned to variables, and any code that is genuinely\n * unreachable are not in scope for this rule \u2014 `no-unreachable` already covers\n * that case.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ReturnStatement(node: Readonly<es.ReturnStatement>): void {\n const parent = node.parent;\n\n // Only check return statements that live directly inside a block\n // (`BlockStatement`) or at the top level of a script/module\n // (`Program`). Return statements inside a `SwitchCase` consequent\n // do not have a traditional `body` array, so skip them.\n if (!isStatementList(parent)) {\n return;\n }\n\n const siblings = parent.body;\n const returnIndex = siblings.indexOf(node);\n\n // Scan every statement that follows this return in the same block.\n for (let i = returnIndex + 1; i < siblings.length; i++) {\n const sibling = siblings[i];\n\n if (sibling?.type !== \"FunctionDeclaration\") {\n continue;\n }\n\n // Capture in closure for the fix function.\n const functionDeclaration = sibling;\n const returnStatement = node;\n\n context.report({\n data: {\n name: functionDeclaration.id?.name ?? \"(anonymous)\",\n },\n fix(fixer) {\n const sourceCode = context.sourceCode;\n\n // Text of the function declaration to move.\n const declarationEnd =\n arrayLast(functionDeclaration.range) ?? 0;\n const fixRangeStart = getSafeFixRangeStart(\n sourceCode,\n functionDeclaration\n );\n const fixRangeEnd = getSafeFixRangeEnd(\n sourceCode,\n functionDeclaration\n );\n const functionAndLeadingCommentsText =\n sourceCode.text.slice(\n fixRangeStart,\n declarationEnd\n );\n\n if (\n functionAndLeadingCommentsText.trim().length === 0\n ) {\n return null;\n }\n\n // We want to insert before the return statement.\n // Determine the correct indentation by looking at the\n // token that starts the return statement.\n const returnToken =\n sourceCode.getFirstToken(returnStatement);\n const indentationEnd =\n arrayFirst(returnToken?.range ?? [0]) ?? 0;\n const returnLineStart = getLineStartIndex(\n sourceCode.text,\n indentationEnd\n );\n\n return [\n fixer.insertTextBeforeRange(\n [returnLineStart, returnLineStart],\n `${functionAndLeadingCommentsText}\\n`\n ),\n fixer.removeRange([fixRangeStart, fixRangeEnd]),\n ];\n },\n messageId: \"forbidden\",\n node: functionDeclaration,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow function declarations after a return statement.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-function-declare-after-return\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Function declaration '{{name}}' should be moved before the return statement for readability.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-function-declare-after-return\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isPromiseLike,\n} from \"@typescript-eslint/type-utils\";\nimport {\n type TSESTree as es,\n ESLintUtils,\n type TSESLint,\n} from \"@typescript-eslint/utils\";\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds =\n | \"explicitAny\"\n | \"implicitAny\"\n | \"narrowed\"\n | \"suggestExplicitUnknown\";\n\ntype Options = readonly [RuleOptions?];\n\ntype RuleOptions = Readonly<{\n readonly allowExplicitAny?: boolean;\n}>;\n\ntype TypedProgram = NonNullable<\n ReturnType<typeof ESLintUtils.getParserServices>[\"program\"]\n>;\n\nconst defaultOptions: Options = [{}];\n\nconst isPromiseRejectionCall = (\n callExpression: Readonly<es.CallExpression>,\n parserServices: Readonly<\n Parameters<typeof getConstrainedTypeAtLocation>[0]\n >,\n program: TypedProgram\n): boolean => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\" || callee.object.type === \"Super\") {\n return false;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n\n return isPromiseLike(program, objectType);\n};\n\nconst isParenthesized = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const tokenBefore = sourceCode.getTokenBefore(node);\n const tokenAfter = sourceCode.getTokenAfter(node);\n if (tokenBefore === null || tokenAfter === null) {\n return false;\n }\n\n return (\n tokenBefore.value === \"(\" &&\n tokenBefore.range[1] <= arrayFirst(node.range) &&\n tokenAfter.value === \")\" &&\n arrayFirst(tokenAfter.range) >= node.range[1]\n );\n};\n\nconst replaceWithUnknownFix = (\n fixer: TSESLint.RuleFixer,\n typeAnnotation: Readonly<es.TSTypeAnnotation>\n): TSESLint.RuleFix => fixer.replaceText(typeAnnotation, \": unknown\");\n\nconst annotateImplicitParamFixes = (\n fixer: TSESLint.RuleFixer,\n sourceCode: Readonly<TSESLint.SourceCode>,\n parameter: Readonly<es.Identifier>\n): readonly TSESLint.RuleFix[] => {\n if (isParenthesized(sourceCode, parameter)) {\n return [fixer.insertTextAfter(parameter, \": unknown\")];\n }\n\n return [\n fixer.insertTextBefore(parameter, \"(\"),\n fixer.insertTextAfter(parameter, \": unknown)\"),\n ];\n};\n\n/**\n * Require explicit `unknown` (or optionally `any`) for Promise rejection\n * callbacks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const sourceCode = context.sourceCode;\n const [{ allowExplicitAny = false } = {}] = context.options;\n\n const checkRejectionCallback = (\n callExpression: Readonly<es.CallExpression>,\n callback: Readonly<es.CallExpressionArgument>\n ): void => {\n if (\n callback.type !== \"ArrowFunctionExpression\" &&\n callback.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const [parameter] = callback.params;\n if (parameter?.type !== \"Identifier\") {\n return;\n }\n\n if (\n !isPromiseRejectionCall(\n callExpression,\n parserServices,\n parserServices.program\n )\n ) {\n return;\n }\n\n if (parameter.typeAnnotation === undefined) {\n context.report({\n fix: (fixer) =>\n annotateImplicitParamFixes(\n fixer,\n sourceCode,\n parameter\n ),\n messageId: \"implicitAny\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n annotateImplicitParamFixes(\n fixer,\n sourceCode,\n parameter\n ),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n return;\n }\n\n const { typeAnnotation } = parameter;\n const annotationType = typeAnnotation.typeAnnotation.type;\n if (annotationType === \"TSUnknownKeyword\") {\n return;\n }\n\n if (annotationType === \"TSAnyKeyword\") {\n if (allowExplicitAny) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"explicitAny\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n return;\n }\n\n context.report({\n messageId: \"narrowed\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n };\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='catch']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const [callback] = callExpression.arguments;\n if (callback !== undefined) {\n checkRejectionCallback(callExpression, callback);\n }\n },\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='then']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const callback = callExpression.arguments[1];\n if (callback !== undefined) {\n checkRejectionCallback(callExpression, callback);\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit unknown for Promise rejection callback parameters.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n suggestion: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-implicit-any-catch\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n explicitAny: \"Explicit `any` in Promise rejection callback.\",\n implicitAny: \"Implicit `any` in Promise rejection callback.\",\n narrowed:\n \"Error type in Promise rejection callback must be `unknown` or `any`.\",\n suggestExplicitUnknown:\n \"Use `unknown` to force safe, explicit narrowing before access.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for Promise rejection callback annotation enforcement.\",\n properties: {\n allowExplicitAny: {\n description:\n \"Whether an explicit `any` annotation is allowed for rejection callback parameters.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"no-implicit-any-catch\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing from \".\".\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\".\"],\n description: \"disallow imports from the current directory root (.).\",\n name: \"no-index-import\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing nested internal module paths.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\n \"./*/**\",\n \"[^@]*/**\",\n \"@?*/*/**\",\n ],\n description: \"disallow importing internal modules.\",\n name: \"no-internal-modules\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined, isEmpty } from \"ts-extras\";\n\nimport {\n compileIgnorePatterns,\n type IgnoreMode,\n type IgnorePatternBuckets,\n} from \"../_internal/ignore-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n getIdentifierSymbol,\n getJsDocTagComments,\n isDeclarationIdentifier,\n isImportOrExportSpecifier,\n matchesAnyPattern,\n} from \"../_internal/symbol-usage.js\";\n\ntype MessageIds = \"forbidden\" | \"forbiddenWithComment\" | \"invalidIgnorePattern\";\n\ntype Options = readonly [\n {\n readonly ignored?: Readonly<Record<string, IgnoreMode>>;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\n/**\n * Disallow usages of symbols tagged with `@internal`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ ignored = {} } = {}] = context.options;\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n const compiledIgnorePatterns = compileIgnorePatterns(ignored);\n const ignorePatterns: IgnorePatternBuckets =\n compiledIgnorePatterns.patterns;\n\n return {\n Identifier: (node: Readonly<es.Identifier>) => {\n if (isImportOrExportSpecifier(node.parent)) {\n return;\n }\n\n if (isDeclarationIdentifier(node)) {\n return;\n }\n\n const symbol = getIdentifierSymbol(parserServices, node);\n if (!isDefined(symbol)) {\n return;\n }\n\n const symbolName = symbol.getName();\n if (matchesAnyPattern(symbolName, ignorePatterns.name)) {\n return;\n }\n\n const fullyQualifiedName =\n typeChecker.getFullyQualifiedName(symbol);\n if (\n matchesAnyPattern(fullyQualifiedName, ignorePatterns.path)\n ) {\n return;\n }\n\n const internalComments = getJsDocTagComments(\n symbol,\n typeChecker,\n \"internal\"\n );\n if (isEmpty(internalComments)) {\n return;\n }\n\n for (const comment of internalComments) {\n if (!isDefined(comment)) {\n context.report({\n data: { name: symbolName },\n messageId: \"forbidden\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n comment,\n name: symbolName,\n },\n messageId: \"forbiddenWithComment\",\n node,\n });\n }\n },\n Program: (node: Readonly<es.Program>) => {\n for (const invalidPattern of compiledIgnorePatterns.invalidPatterns) {\n context.report({\n data: {\n pattern: invalidPattern,\n },\n messageId: \"invalidIgnorePattern\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow usage of APIs tagged with @internal.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-internal\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: '\"{{name}}\" is internal.',\n forbiddenWithComment: '\"{{name}}\" is internal: {{comment}}',\n invalidIgnorePattern:\n \"Invalid ignored regex pattern '{{pattern}}'. Update this rule option to a valid regular expression.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for ignoring some internal symbols by name or declaration path pattern.\",\n properties: {\n ignored: {\n additionalProperties: {\n description:\n 'Match behavior for the pattern key. Use \"name\" to match symbol names or \"path\" to match fully-qualified declaration paths.',\n enum: [\"name\", \"path\"],\n type: \"string\",\n },\n description: \"Map of regex patterns to ignore mode.\",\n type: \"object\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-internal\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst languageMixPattern = String.raw`/\\w[\\d_]*[^\\u0000-\\xff]|[^\\u0000-\\xff][\\d_]*\\w/u`;\nconst disallowedSelector = arrayJoin(\n [\n `Literal[value=${languageMixPattern}]`,\n `TemplateElement[value.raw=${languageMixPattern}]`,\n ],\n \", \"\n);\n\n/**\n * Disallow mixing latin and non-latin letters within the same token.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow mixed-language tokens combining latin and non-latin letters.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-language-mixing\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Do not mix languages in a single token.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-language-mixing\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\nimport type * as ts from \"typescript\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"cannotInfer\" | \"canReplace\";\n\ntype Options = readonly [];\n\ntype TypeParameterUsageAnalysis = {\n readonly appearsInMultipleParameters: boolean;\n readonly usedInParameters: boolean;\n readonly usedInReturnOrExtends: boolean;\n};\n\ntype VariableInfo = NonNullable<ReturnType<VariableUsageMap[\"get\"]>>;\n\ntype VariableUsageMap = ReturnType<typeof tsutils.collectVariableUsage>;\n\ntype VariableUse = VariableInfo[\"uses\"][number];\n\nconst getVariableUses = (\n usageMap: Readonly<VariableUsageMap>,\n identifier: Readonly<ts.Identifier>\n): readonly VariableUse[] => usageMap.get(identifier)?.uses ?? [];\n\nconst toReportLocation = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n sourceFile: Readonly<ts.SourceFile>,\n node: Readonly<ts.Node>\n): es.SourceLocation => {\n const start = sourceCode.getLocFromIndex(node.getStart(sourceFile));\n const end = sourceCode.getLocFromIndex(node.getEnd());\n\n return {\n end: {\n column: end.column,\n line: end.line,\n },\n start: {\n column: start.column,\n line: start.line,\n },\n } satisfies es.SourceLocation;\n};\n\nconst isTypeUseInsideConstraint = (\n useLocation: Readonly<ts.Identifier>,\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[]\n): boolean =>\n typeParameters.some((typeParameter) => {\n const { constraint } = typeParameter;\n if (!isDefined(constraint)) {\n return false;\n }\n\n return (\n useLocation.pos >= constraint.pos &&\n useLocation.pos < constraint.end\n );\n });\n\nconst isConstrainedByAnotherTypeParameter = (\n currentTypeParameter: Readonly<ts.TypeParameterDeclaration>,\n allTypeParameters: readonly Readonly<ts.TypeParameterDeclaration>[],\n usageMap: Readonly<VariableUsageMap>\n): boolean => {\n const { constraint } = currentTypeParameter;\n if (!isDefined(constraint)) {\n return false;\n }\n\n return allTypeParameters.some((otherTypeParameter) => {\n if (otherTypeParameter === currentTypeParameter) {\n return false;\n }\n\n const uses = getVariableUses(usageMap, otherTypeParameter.name);\n\n return uses.some(\n (use) =>\n use.location.pos >= constraint.pos &&\n use.location.pos < constraint.end\n );\n });\n};\n\nconst isUseWithinParameterRange = (\n usePosition: number,\n signature: Readonly<ts.SignatureDeclaration>\n): boolean =>\n usePosition > signature.parameters.pos &&\n usePosition < signature.parameters.end;\n\nconst getTypeParameterReplacement = (\n sourceFile: Readonly<ts.SourceFile>,\n typeParameter: Readonly<ts.TypeParameterDeclaration>\n): string => {\n const { constraint } = typeParameter;\n if (!isDefined(constraint)) {\n return \"unknown\";\n }\n\n return constraint.getText(sourceFile);\n};\n\nconst analyzeTypeParameterUses = (\n uses: readonly Readonly<VariableUse>[],\n signature: Readonly<ts.SignatureDeclaration>,\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[]\n): TypeParameterUsageAnalysis => {\n let appearsInMultipleParameters = false;\n let usedInParameters = false;\n let usedInReturnOrExtends = tsutils.isFunctionWithBody(signature);\n\n for (const use of uses) {\n if (isUseWithinParameterRange(use.location.pos, signature)) {\n if (usedInParameters) {\n appearsInMultipleParameters = true;\n break;\n }\n\n usedInParameters = true;\n continue;\n }\n\n if (usedInReturnOrExtends) {\n continue;\n }\n\n usedInReturnOrExtends =\n use.location.pos > signature.parameters.end ||\n isTypeUseInsideConstraint(use.location, typeParameters);\n }\n\n return {\n appearsInMultipleParameters,\n usedInParameters,\n usedInReturnOrExtends,\n };\n};\n\n/**\n * Disallow type parameters that cannot be inferred or do not enforce\n * constraints.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n let usageMap: null | VariableUsageMap = null;\n\n const checkTypeParameters = (\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[],\n signature: Readonly<ts.SignatureDeclaration>\n ): void => {\n usageMap ??= tsutils.collectVariableUsage(\n signature.getSourceFile()\n );\n\n const sourceFile = signature.getSourceFile();\n\n for (const typeParameter of typeParameters) {\n const uses = getVariableUses(usageMap, typeParameter.name);\n const usageAnalysis = analyzeTypeParameterUses(\n uses,\n signature,\n typeParameters\n );\n\n if (usageAnalysis.appearsInMultipleParameters) {\n continue;\n }\n\n if (!usageAnalysis.usedInParameters) {\n context.report({\n data: {\n name: typeParameter.name.text,\n },\n loc: toReportLocation(\n context.sourceCode,\n sourceFile,\n typeParameter\n ),\n messageId: \"cannotInfer\",\n });\n continue;\n }\n\n if (\n !usageAnalysis.usedInReturnOrExtends &&\n usageMap !== null &&\n !isConstrainedByAnotherTypeParameter(\n typeParameter,\n typeParameters,\n usageMap\n )\n ) {\n context.report({\n data: {\n name: typeParameter.name.text,\n replacement: getTypeParameterReplacement(\n sourceFile,\n typeParameter\n ),\n },\n loc: toReportLocation(\n context.sourceCode,\n sourceFile,\n typeParameter\n ),\n messageId: \"canReplace\",\n });\n }\n }\n };\n\n const checkSignature = (node: Readonly<es.Node>): void => {\n const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);\n if (\n !tsutils.isSignatureDeclaration(tsNode) ||\n !isDefined(tsNode.typeParameters)\n ) {\n return;\n }\n\n checkTypeParameters(tsNode.typeParameters, tsNode);\n };\n\n return {\n ArrowFunctionExpression: checkSignature,\n FunctionDeclaration: checkSignature,\n FunctionExpression: checkSignature,\n MethodDefinition: checkSignature,\n \"Program:exit\": () => {\n usageMap = null;\n },\n TSCallSignatureDeclaration: checkSignature,\n TSConstructorType: checkSignature,\n TSConstructSignatureDeclaration: checkSignature,\n TSDeclareFunction: checkSignature,\n TSFunctionType: checkSignature,\n TSIndexSignature: checkSignature,\n TSMethodSignature: checkSignature,\n TSPropertySignature: checkSignature,\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow type parameters that cannot be inferred or do not enforce constraints.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-misused-generics\",\n },\n hasSuggestions: false,\n messages: {\n cannotInfer:\n \"Type parameter '{{name}}' cannot be inferred from any parameter.\",\n canReplace:\n \"Type parameter '{{name}}' does not enforce a relation between types and can be replaced with '{{replacement}}'.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-misused-generics\",\n});\n\nexport default rule;\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-mixed-enums\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-mixed-enums\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-mixed-enums.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-mixed-enums\",\n url: \"https://typescript-eslint.io/rules/no-mixed-enums\",\n },\n }),\n ],\n ruleId: \"no-mixed-enums\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelectors: readonly string[] = [\n 'IfStatement > BinaryExpression[operator=\"!==\"]',\n 'IfStatement > UnaryExpression[operator=\"!\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"&&\"] > BinaryExpression.left[operator=\"!==\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"&&\"] > UnaryExpression.left[operator=\"!\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"||\"] > BinaryExpression[operator=\"!==\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"||\"] > UnaryExpression[operator=\"!\"]',\n];\n\n/**\n * Disallow negated conditions in `if` and top-level logical expressions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [arrayJoin(disallowedSelectors, \", \")]: (\n node: Readonly<es.Node>\n ): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow negated conditions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-negated-conditions\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Negated conditions are forbidden.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-negated-conditions\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing Node.js built-in modules via the `node:` protocol.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"node:*\"],\n description: \"disallow imports from node: built-in module specifiers.\",\n name: \"no-nodejs-modules\",\n });\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\ntype Scope = TSESLint.Scope.Scope;\n\ntype SourceCode = TSESLint.SourceCode;\n\ntype Variable = TSESLint.Scope.Variable;\n\nconst getAssignmentTargetIdentifier = (\n node: Readonly<es.AssignmentExpression>\n): Readonly<es.Identifier> | undefined => {\n if (node.left.type === \"Identifier\") {\n return node.left;\n }\n\n return undefined;\n};\n\nconst getScopeVariable = (\n sourceCode: Readonly<SourceCode>,\n identifier: Readonly<es.Identifier>\n): Readonly<Variable> | undefined => {\n let scope: null | Scope = sourceCode.getScope(identifier);\n\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) {\n return variable;\n }\n\n scope = scope.upper;\n }\n\n return undefined;\n};\n\nconst isParameterVariable = (\n variable: Readonly<Variable> | undefined\n): boolean =>\n variable?.defs.some((definition) => definition.type === \"Parameter\") ??\n false;\n\nconst isInFirstFunctionExpressionStatement = (\n sourceCode: Readonly<SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const ancestors = sourceCode.getAncestors(node);\n let enclosingFunction:\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression\n | null = null;\n\n for (let index = ancestors.length - 1; index >= 0; index -= 1) {\n const ancestor = ancestors[index];\n if (ancestor === undefined) {\n continue;\n }\n\n if (\n ancestor.type === \"ArrowFunctionExpression\" ||\n ancestor.type === \"FunctionDeclaration\" ||\n ancestor.type === \"FunctionExpression\"\n ) {\n enclosingFunction = ancestor;\n break;\n }\n }\n\n if (enclosingFunction?.body.type !== \"BlockStatement\") {\n return false;\n }\n\n const [firstStatement] = enclosingFunction.body.body;\n if (firstStatement?.type !== \"ExpressionStatement\") {\n return false;\n }\n\n return (\n arrayFirst(node.range) >= arrayFirst(firstStatement.range) &&\n node.range[1] <= firstStatement.range[1]\n );\n};\n\n/**\n * Disallow parameter reassignment, except in the first expression statement of\n * a function body.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const { sourceCode } = context;\n\n const reportIfParameterReassignment = (\n identifier: Readonly<es.Identifier>\n ): void => {\n if (isInFirstFunctionExpressionStatement(sourceCode, identifier)) {\n return;\n }\n\n const variable = getScopeVariable(sourceCode, identifier);\n if (!isParameterVariable(variable)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: identifier,\n });\n };\n\n return {\n AssignmentExpression: (\n node: Readonly<es.AssignmentExpression>\n ): void => {\n const identifier = getAssignmentTargetIdentifier(node);\n if (identifier === undefined) {\n return;\n }\n\n reportIfParameterReassignment(identifier);\n },\n UpdateExpression: (node: Readonly<es.UpdateExpression>): void => {\n if (node.argument.type !== \"Identifier\") {\n return;\n }\n\n reportIfParameterReassignment(node.argument);\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow parameter reassignment except in the first expression statement of a function body.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-param-reassign\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not reassign function parameters outside the first expression statement in the function body.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-param-reassign\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Disallow relative parent imports like `..` and `../foo`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\n \"..\",\n \"../**\",\n \"../..\",\n \"../../**\",\n \"../../..\",\n \"../../../**\",\n \"../../../..\",\n \"../../../../**\",\n \"../../../../..\",\n \"../../../../../**\",\n ],\n description: \"disallow relative parent imports.\",\n name: \"no-relative-parent-import\",\n });\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/no-relative-parent-imports.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"no-relative-parent-imports\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md\",\n },\n }),\n ],\n ruleId: \"no-relative-parent-import\",\n});\n\nexport default deprecatedRule;\n", "import { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport {\n buildRestrictedSyntaxListeners,\n normalizeSyntaxSelector,\n type SyntaxSelectorOption,\n} from \"../_internal/syntax-selectors.js\";\n\ntype MessageIds = \"customMessage\" | \"forbidden\";\n\ntype Options = readonly [\n Readonly<{\n readonly selectors?: readonly SyntaxSelectorOption[];\n }>,\n];\n\n/**\n * Disallow syntax nodes matched by configured selectors.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const selectors = options.selectors ?? [];\n const entries = selectors.map((selector) =>\n normalizeSyntaxSelector(selector)\n );\n\n return buildRestrictedSyntaxListeners(entries, (node, entry) => {\n if (isDefined(entry.message)) {\n context.report({\n data: {\n message: entry.message,\n },\n messageId: \"customMessage\",\n node,\n });\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n });\n },\n meta: {\n defaultOptions: [{ selectors: [] }],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow syntax nodes selected by configured AST selectors.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-restricted-syntax\",\n },\n hasSuggestions: false,\n messages: {\n customMessage: \"{{message}}\",\n forbidden: \"Disallowed syntax.\",\n },\n schema: [\n {\n additionalProperties: false,\n description: \"Configuration for syntax selectors to disallow.\",\n properties: {\n selectors: {\n description:\n \"Selector list. Each entry can be a selector string or a selector/message object.\",\n items: {\n oneOf: [\n {\n minLength: 1,\n type: \"string\",\n },\n {\n additionalProperties: false,\n properties: {\n message: {\n minLength: 1,\n type: \"string\",\n },\n selector: {\n minLength: 1,\n type: \"string\",\n },\n },\n required: [\"selector\"],\n type: \"object\",\n },\n ],\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-restricted-syntax\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of ESLint core no-restricted-syntax.\",\n replacedBy: [\n createReplacementRuleInfo({\n rule: {\n name: \"no-restricted-syntax\",\n url: \"https://eslint.org/docs/latest/rules/no-restricted-syntax\",\n },\n }),\n ],\n ruleId: \"no-restricted-syntax\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined, keyIn } from \"ts-extras\";\n\n/**\n * Normalized selector entry used by syntax-based rules.\n */\nexport type SyntaxSelectorEntry = Readonly<{\n readonly message?: string;\n readonly selector: string;\n}>;\n\n/**\n * Supported selector option syntax accepted by rule options.\n */\nexport type SyntaxSelectorOption =\n | Readonly<{\n readonly message?: string;\n readonly selector: string;\n }>\n | string;\n\nconst isSelectorObject = (\n value: SyntaxSelectorOption\n): value is Readonly<{\n readonly message?: string;\n readonly selector: string;\n}> => typeof value === \"object\" && value !== null && keyIn(value, \"selector\");\n\n/**\n * Normalize a selector option into a selector entry object.\n */\nexport const normalizeSyntaxSelector = (\n selector: SyntaxSelectorOption\n): SyntaxSelectorEntry => {\n if (isSelectorObject(selector)) {\n if (!isDefined(selector.message)) {\n return {\n selector: selector.selector,\n };\n }\n\n return {\n message: selector.message,\n selector: selector.selector,\n };\n }\n\n return {\n selector,\n };\n};\n\n/**\n * Build ESLint selector listeners from selector entries.\n */\nexport const buildRestrictedSyntaxListeners = (\n entries: readonly SyntaxSelectorEntry[],\n report: (node: Readonly<es.Node>, entry: SyntaxSelectorEntry) => void\n): Readonly<Record<string, (node: Readonly<es.Node>) => void>> => {\n const listeners: Record<string, (node: Readonly<es.Node>) => void> = {};\n\n for (const entry of entries) {\n listeners[entry.selector] = (node: Readonly<es.Node>): void => {\n report(node, entry);\n };\n }\n\n return listeners;\n};\n", "import noSecretsPlugin from \"eslint-plugin-no-secrets\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n noSecretsPlugin,\n \"no-secrets\",\n \"eslint-plugin-no-secrets\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-secret\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of dedicated secret scanning tools such as Secretlint and detect-secrets.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"secretlint\",\n url: \"https://github.com/secretlint/secretlint\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"detect-secrets\",\n url: \"https://github.com/Yelp/detect-secrets\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"no-secrets\",\n url: \"https://github.com/nickdeis/eslint-plugin-no-secrets\",\n },\n rule: {\n name: \"no-secrets/no-secrets\",\n url: \"https://github.com/nickdeis/eslint-plugin-no-secrets\",\n },\n }),\n ],\n ruleId: \"no-secret\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { dirname, resolve } from \"node:path\";\nimport { arrayIncludes } from \"ts-extras\";\n\nimport { getImportSourceFromNode } from \"../_internal/import-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst importFileSuffixes = [\n \"\",\n \".ts\",\n \".tsx\",\n \".js\",\n \".mjs\",\n \".cjs\",\n \".d.ts\",\n \"/index.ts\",\n \"/index.tsx\",\n \"/index.js\",\n \"/index.mjs\",\n \"/index.cjs\",\n] as const;\n\nconst toResolvedCandidates = (\n baseDirectory: string,\n importSource: string\n): readonly string[] =>\n importFileSuffixes.map((suffix) =>\n resolve(baseDirectory, `${importSource}${suffix}`)\n );\n\n/**\n * Disallow importing the current file from itself.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const currentFilePath = context.filename;\n if (currentFilePath === \"<input>\") {\n return {};\n }\n\n const normalizedCurrentFilePath = resolve(currentFilePath);\n const currentFileDirectory = dirname(normalizedCurrentFilePath);\n\n return {\n \"ImportDeclaration, ExportNamedDeclaration[source], ExportAllDeclaration, ImportExpression\":\n (node: Readonly<es.Node>): void => {\n const sourceText = getImportSourceFromNode(node);\n if (sourceText?.startsWith(\".\") !== true) {\n return;\n }\n\n const candidatePaths = toResolvedCandidates(\n currentFileDirectory,\n sourceText\n );\n\n if (\n arrayIncludes(candidatePaths, normalizedCurrentFilePath)\n ) {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n }\n },\n };\n },\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow importing the current file from itself.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-self-import\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Do not import the current file from itself.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-self-import\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/no-self-import.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"no-self-import\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md\",\n },\n }),\n ],\n ruleId: \"no-self-import\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\ntype Scope = TSESLint.Scope.Scope;\n\ntype Variable = TSESLint.Scope.Variable;\n\nconst shouldIgnoreVariable = (variable: Readonly<Variable>): boolean =>\n variable.defs.some(\n (definition) =>\n definition.node.type === \"TSEnumDeclaration\" ||\n definition.type.includes(\"Enum\")\n );\n\nconst findShadowedVariable = (\n scope: Readonly<Scope>,\n variableName: string\n): Readonly<Variable> | undefined => {\n let upperScope = scope.upper;\n\n while (upperScope !== null) {\n const upperVariable = upperScope.set.get(variableName);\n if (upperVariable !== undefined) {\n return upperVariable;\n }\n\n upperScope = upperScope.upper;\n }\n\n return undefined;\n};\n\nconst collectScopes = (scope: Readonly<Scope>): readonly Readonly<Scope>[] => [\n scope,\n ...scope.childScopes.flatMap((childScope) => collectScopes(childScope)),\n];\n\n/**\n * Disallow variable declarations that shadow identifiers from parent scopes,\n * excluding enum declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"Program:exit\": (node: Readonly<es.Program>): void => {\n const programScope = context.sourceCode.getScope(node);\n\n for (const scope of collectScopes(programScope)) {\n for (const variable of scope.variables) {\n if (shouldIgnoreVariable(variable)) {\n continue;\n }\n\n const [identifier] = variable.identifiers;\n if (identifier === undefined) {\n continue;\n }\n\n const shadowed = findShadowedVariable(scope, variable.name);\n if (\n shadowed === undefined ||\n shouldIgnoreVariable(shadowed)\n ) {\n continue;\n }\n\n context.report({\n data: {\n name: variable.name,\n },\n messageId: \"forbidden\",\n node: identifier,\n });\n }\n }\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow shadowed variables while ignoring enum declarations.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-shadow\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"'{{name}}' is already declared in an outer scope and should not be shadowed.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-shadow\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-shadow.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-shadow\",\n url: \"https://typescript-eslint.io/rules/no-shadow\",\n },\n }),\n ],\n ruleId: \"no-shadow\",\n});\n\nexport default deprecatedRule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow sibling-file imports from the current directory.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"./*\"],\n description: \"disallow sibling imports from the current directory.\",\n name: \"no-sibling-import\",\n });\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestConvertToBlock\";\n\ntype Options = readonly [\n Readonly<{\n readonly allowDirectiveComments?: boolean;\n }>?,\n];\n\nconst directiveCommentPattern =\n /^(?:eslint(?:-|$)|global\\s|exported\\s|ts-(?:check|expect-error|ignore|nocheck))/u;\n\nconst isDirectiveComment = (commentText: string): boolean =>\n directiveCommentPattern.test(commentText.trimStart());\n\nconst createConvertToBlockSuggestionFix = (\n commentValue: string,\n commentRange: readonly [number, number]\n): TSESLint.ReportFixFunction | undefined => {\n if (commentValue.includes(\"*/\")) {\n return undefined;\n }\n\n return (fixer) =>\n fixer.replaceTextRange(commentRange, `/*${commentValue} */`);\n};\n\n/**\n * Disallow single-line comments except optionally allowed directive comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ allowDirectiveComments = true } = {}] = context.options;\n\n return {\n Program: () => {\n for (const comment of context.sourceCode.getAllComments()) {\n if (comment.type !== \"Line\") {\n continue;\n }\n\n if (\n allowDirectiveComments &&\n isDirectiveComment(comment.value)\n ) {\n continue;\n }\n\n const isDirective = isDirectiveComment(comment.value);\n const suggestionFix = isDirective\n ? undefined\n : createConvertToBlockSuggestionFix(\n comment.value,\n comment.range\n );\n\n context.report({\n ...(suggestionFix === undefined\n ? {}\n : {\n fix: suggestionFix,\n }),\n loc: comment.loc,\n messageId: \"forbidden\",\n ...(suggestionFix === undefined\n ? {}\n : {\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestConvertToBlock\",\n },\n ],\n }),\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ allowDirectiveComments: true }],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow single-line comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-single-line-comment\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Single-line comments are not allowed; use block comments instead.\",\n suggestConvertToBlock:\n \"Convert this single-line comment to a block comment.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for allowing directive line comments.\",\n properties: {\n allowDirectiveComments: {\n description:\n \"Whether to allow line comments used as lint/compiler directives.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"no-single-line-comment\",\n});\n\nexport default rule;\n", "/**\n * @license Use of this source code is governed by an MIT-style license that can\n * be found in the LICENSE file at\n * https://github.com/cartant/eslint-plugin-etc\n */\n\nimport type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\nconst defaultOptions: readonly {\n readonly prefix?: string;\n}[] = [{}];\n\ntype MessageIds = \"forbidden\" | \"prefix\";\n\n/**\n * Disallow non-descriptive single-character generic type parameter names.\n */\nconst rule: ReturnType<typeof ruleCreator<typeof defaultOptions, MessageIds>> =\n ruleCreator<typeof defaultOptions, MessageIds>({\n create: (context) => {\n const [{ prefix = \"\" } = {}] = context.options;\n return {\n \"TSTypeParameter > Identifier[name=/^.$/]\": (\n node: Readonly<es.Identifier>\n ) => {\n context.report({\n data: { name: node.name },\n messageId: \"forbidden\",\n node,\n });\n },\n \"TSTypeParameter > Identifier[name=/^.{2,}$/]\": (\n node: Readonly<es.Identifier>\n ) => {\n const { name } = node;\n if (prefix && !name.startsWith(prefix)) {\n context.report({\n data: { name, prefix },\n messageId: \"prefix\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow single-character type parameters.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-t\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Single-character type parameters are forbidden. Choose a more descriptive name for \"{{name}}\"',\n prefix: 'Type parameter \"{{name}}\" does not have prefix \"{{prefix}}\"',\n },\n schema: [\n {\n description:\n \"Configuration for enforced generic type parameter prefix.\",\n properties: {\n prefix: {\n description:\n \"Required prefix for type parameter names longer than one character.\",\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-t\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = arrayJoin(\n [\n \"ExportNamedDeclaration > FunctionDeclaration > Identifier.id[name=/^_/u]\",\n \"ExportNamedDeclaration > TSDeclareFunction > Identifier.id[name=/^_/u]\",\n \"ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > Identifier.id[name=/^_/u]\",\n ],\n \", \"\n);\n\n/**\n * Disallow named exports whose identifier starts with an underscore.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow underscore-prefixed named exports.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-underscore-export\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"No underscore exports.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-underscore-export\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"VariableDeclarator > TSAsExpression[expression.properties.length=0] > TSTypeReference > Identifier[name='const'], VariableDeclarator[id.typeAnnotation] > TSAsExpression > TSTypeReference > Identifier[name='const']\";\n\nconst getAsConstExpression = (\n node: Readonly<es.Node>\n): Readonly<es.TSAsExpression> | undefined => {\n if (\n node.type !== \"Identifier\" ||\n node.parent?.type !== \"TSTypeReference\" ||\n node.parent.parent?.type !== \"TSAsExpression\"\n ) {\n return undefined;\n }\n\n return node.parent.parent;\n};\n\n/**\n * Disallow unnecessary `as const` assertions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n const asConstExpression = getAsConstExpression(node);\n if (asConstExpression === undefined) {\n return;\n }\n\n const replacementText = sourceCode.getText(\n asConstExpression.expression\n );\n\n context.report({\n fix: (fixer) =>\n fixer.replaceText(asConstExpression, replacementText),\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary as const assertions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-as-const\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Unnecessary as const assertion.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-as-const\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemove\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = \"SwitchCase:last-child > BreakStatement.consequent\";\n\nconst createTrailingBreakRemovalFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.BreakStatement>\n): TSESLint.ReportFixFunction => {\n const previousToken = sourceCode.getTokenBefore(node);\n const previousTokenLine = previousToken?.loc.end.line;\n const breakLine = node.loc.start.line;\n const shouldRemoveLeadingWhitespace =\n isDefined(previousTokenLine) && previousTokenLine === breakLine;\n\n if (previousToken === null || !shouldRemoveLeadingWhitespace) {\n return (fixer) => fixer.remove(node);\n }\n\n const leadingText = sourceCode.text.slice(\n previousToken.range[1],\n arrayFirst(node.range)\n );\n const leadingWhitespaceLength =\n /^[\\t ]*/u.exec(leadingText)?.[0].length ?? 0;\n\n return (fixer) =>\n fixer.removeRange([\n arrayFirst(node.range) - leadingWhitespaceLength,\n node.range[1],\n ]);\n};\n\n/**\n * Disallow unnecessary trailing break statements in switch blocks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"BreakStatement\" || node.label !== null) {\n return;\n }\n\n const fix = createTrailingBreakRemovalFix(sourceCode, node);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestRemove\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary trailing break statements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-break\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Unnecessary break statement at end of switch case list.\",\n suggestRemove:\n \"Remove the trailing break statement because it is unreachable.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-break\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"PropertyDefinition > Identifier.value[name='undefined'], VariableDeclarator > Identifier.init[name='undefined']\";\n\nconst getUndefinedInitializationRemovalRange = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): readonly [number, number] | undefined => {\n const equalsToken = sourceCode.getTokenBefore(node, {\n filter: (token): boolean => token.value === \"=\",\n });\n\n if (equalsToken === null) {\n return undefined;\n }\n\n let fixStartIndex = arrayFirst(equalsToken.range);\n const sourceText = sourceCode.text;\n\n while (fixStartIndex > 0) {\n const previousCharacter = sourceText.at(fixStartIndex - 1);\n if (previousCharacter !== \" \" && previousCharacter !== \"\\t\") {\n break;\n }\n\n fixStartIndex -= 1;\n }\n\n return [fixStartIndex, node.range[1]];\n};\n\n/**\n * Disallow explicit initialization to `undefined`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n const removalRange = getUndefinedInitializationRemovalRange(\n sourceCode,\n node\n );\n\n if (!isDefined(removalRange)) {\n return;\n }\n\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.removeRange(removalRange);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary initialization to undefined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-initialization\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Unnecessary initialization to undefined.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-initialization\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TemplateLiteral[expressions.length=0] > TemplateElement\";\n\nconst toSafeStringLiteralText = (\n templateLiteral: Readonly<es.TemplateLiteral>\n): string =>\n JSON.stringify(\n arrayFirst(templateLiteral.quasis)?.value.cooked ??\n arrayFirst(templateLiteral.quasis)?.value.raw ??\n \"\"\n );\n\n/**\n * Disallow template literals with no expressions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n const templateLiteral =\n node.type === \"TemplateElement\" &&\n node.parent?.type === \"TemplateLiteral\"\n ? node.parent\n : undefined;\n\n if (templateLiteral === undefined) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n fixer.replaceText(\n templateLiteral,\n toSafeStringLiteralText(templateLiteral)\n ),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow template literals that have no interpolated expressions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-template-literal\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use a string literal instead of an expression-free template literal.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-template-literal\",\n});\n\nexport default rule;\n", "import eslintCommentsPlugin from \"@eslint-community/eslint-plugin-eslint-comments\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `@eslint-community/eslint-comments/no-unused-disable`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n eslintCommentsPlugin,\n \"no-unused-disable\",\n \"@eslint-community/eslint-plugin-eslint-comments\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unused-disable\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @eslint-community/eslint-comments/no-unused-disable.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@eslint-community/eslint-comments\",\n url: \"https://eslint-community.github.io/eslint-plugin-eslint-comments/\",\n },\n rule: {\n name: \"no-unused-disable\",\n url: \"https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html\",\n },\n }),\n ],\n ruleId: \"no-unused-disable\",\n});\n\nexport default deprecatedRule;\n", "/* eslint-disable @typescript-eslint/no-use-before-define, perfectionist/sort-modules -- helper declarations are grouped by concern; forward references are functionally harmless and keep inference code readable. */\n\nimport type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MemberKind = \"accessor\" | \"data\" | \"method\";\n\ntype MessageIds = \"forbidden\";\n\ntype NativeTypeInfo = Readonly<{\n readonly propertyKinds: ReadonlyMap<string, MemberKind>;\n}>;\n\ntype NativeTypeDefinition = Readonly<{\n readonly constructorRef?: object;\n readonly dataProperties?: readonly string[];\n readonly name: NativeTypeName;\n readonly prototypeRef?: object;\n}>;\n\ntype NativeTypeName =\n | \"Array\"\n | \"BigInt\"\n | \"Boolean\"\n | \"Date\"\n | \"Error\"\n | \"Function\"\n | \"Map\"\n | \"Number\"\n | \"Object\"\n | \"Promise\"\n | \"RegExp\"\n | \"Set\"\n | \"String\"\n | \"Symbol\"\n | \"WeakMap\"\n | \"WeakSet\";\n\ntype Options = readonly [];\n\nconst nativeTypeDefinitions: readonly NativeTypeDefinition[] = [\n {\n constructorRef: Array,\n dataProperties: [\"length\"],\n name: \"Array\",\n prototypeRef: Array.prototype,\n },\n {\n constructorRef: BigInt,\n name: \"BigInt\",\n prototypeRef: BigInt.prototype,\n },\n {\n constructorRef: Boolean,\n name: \"Boolean\",\n prototypeRef: Boolean.prototype,\n },\n {\n constructorRef: Date,\n name: \"Date\",\n prototypeRef: Date.prototype,\n },\n {\n constructorRef: Error,\n name: \"Error\",\n prototypeRef: Error.prototype,\n },\n {\n constructorRef: Function,\n name: \"Function\",\n prototypeRef: Function.prototype,\n },\n {\n constructorRef: Map,\n name: \"Map\",\n prototypeRef: Map.prototype,\n },\n {\n constructorRef: Number,\n name: \"Number\",\n prototypeRef: Number.prototype,\n },\n {\n constructorRef: Object,\n name: \"Object\",\n prototypeRef: Object.prototype,\n },\n {\n constructorRef: Promise,\n name: \"Promise\",\n prototypeRef: Promise.prototype,\n },\n {\n constructorRef: RegExp,\n dataProperties: [\"lastIndex\"],\n name: \"RegExp\",\n prototypeRef: RegExp.prototype,\n },\n {\n constructorRef: Set,\n name: \"Set\",\n prototypeRef: Set.prototype,\n },\n {\n constructorRef: String,\n dataProperties: [\"length\"],\n name: \"String\",\n prototypeRef: String.prototype,\n },\n {\n constructorRef: Symbol,\n name: \"Symbol\",\n prototypeRef: Symbol.prototype,\n },\n {\n constructorRef: WeakMap,\n name: \"WeakMap\",\n prototypeRef: WeakMap.prototype,\n },\n {\n constructorRef: WeakSet,\n name: \"WeakSet\",\n prototypeRef: WeakSet.prototype,\n },\n];\n\nconst nativeTypeNameSet = new Set<NativeTypeName>(\n nativeTypeDefinitions.map((definition) => definition.name)\n);\n\nfunction buildNativeTypeInfoByName(\n definitions: readonly NativeTypeDefinition[]\n): ReadonlyMap<NativeTypeName, NativeTypeInfo> {\n return new Map(\n definitions.map((definition) => [\n definition.name,\n {\n propertyKinds: collectPropertyKinds(definition),\n },\n ])\n );\n}\n\nfunction collectPropertyKinds(\n definition: Readonly<NativeTypeDefinition>\n): ReadonlyMap<string, MemberKind> {\n const propertyKinds = new Map<string, MemberKind>();\n const descriptorSources = [\n definition.prototypeRef,\n definition.constructorRef,\n ] as const;\n\n for (const descriptorSource of descriptorSources) {\n if (!isDefined(descriptorSource)) {\n continue;\n }\n\n const ownPropertyNames = Object.getOwnPropertyNames(descriptorSource);\n\n for (const propertyName of ownPropertyNames) {\n if (propertyKinds.has(propertyName)) {\n continue;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(\n descriptorSource,\n propertyName\n );\n\n if (!isDefined(descriptor)) {\n continue;\n }\n\n propertyKinds.set(propertyName, getMemberKind(descriptor));\n }\n }\n\n for (const dataPropertyName of definition.dataProperties ?? []) {\n if (!propertyKinds.has(dataPropertyName)) {\n propertyKinds.set(dataPropertyName, \"data\");\n }\n }\n\n return propertyKinds;\n}\n\nfunction unwrapExpression(\n node: Readonly<es.Expression>\n): Readonly<es.Expression> {\n if (node.type === \"TSAsExpression\" || node.type === \"TSTypeAssertion\") {\n return unwrapExpression(node.expression);\n }\n\n if (node.type === \"ChainExpression\") {\n return unwrapExpression(node.expression);\n }\n\n return node;\n}\n\nconst inferNativeType = (\n rawExpression: Readonly<es.Expression>\n): NativeTypeName | null => {\n const expression = unwrapExpression(rawExpression);\n\n if (expression.type === \"ArrayExpression\") {\n return \"Array\";\n }\n\n if (expression.type === \"ObjectExpression\") {\n return \"Object\";\n }\n\n if (expression.type === \"TemplateLiteral\") {\n return \"String\";\n }\n\n if (expression.type === \"Literal\") {\n return inferNativeTypeFromLiteral(expression);\n }\n\n if (expression.type === \"Identifier\" && isNativeTypeName(expression.name)) {\n return expression.name;\n }\n\n if (expression.type === \"BinaryExpression\") {\n return inferNativeTypeFromBinaryExpression(expression);\n }\n\n if (expression.type === \"MemberExpression\") {\n return inferNativeTypeFromMemberExpression(expression);\n }\n\n if (expression.type === \"NewExpression\") {\n return inferNativeTypeFromNewExpression(expression);\n }\n\n return null;\n};\n\nfunction inferNativeTypeFromBinaryExpression(\n expression: Readonly<es.BinaryExpression>\n): NativeTypeName | null {\n if (expression.operator !== \"+\") {\n return null;\n }\n\n const leftType = inferNativeType(expression.left);\n const rightType = inferNativeType(expression.right);\n\n if (leftType === \"String\" || rightType === \"String\") {\n return \"String\";\n }\n\n if (leftType === \"RegExp\" && rightType === \"RegExp\") {\n return \"String\";\n }\n\n return null;\n}\n\nfunction inferNativeTypeFromLiteral(\n expression: Readonly<es.Literal>\n): NativeTypeName | null {\n if (typeof expression.value === \"string\") {\n return \"String\";\n }\n\n if (typeof expression.value === \"number\") {\n return \"Number\";\n }\n\n if (typeof expression.value === \"boolean\") {\n return \"Boolean\";\n }\n\n if (typeof expression.value === \"bigint\") {\n return \"BigInt\";\n }\n\n if (expression.value instanceof RegExp) {\n return \"RegExp\";\n }\n\n return null;\n}\n\nfunction inferNativeTypeFromMemberExpression(\n expression: Readonly<es.MemberExpression>\n): NativeTypeName | null {\n if (\n expression.computed ||\n expression.property.type !== \"Identifier\" ||\n expression.property.name !== \"prototype\" ||\n expression.object.type !== \"Identifier\" ||\n !isNativeTypeName(expression.object.name)\n ) {\n return null;\n }\n\n return expression.object.name;\n}\n\nfunction inferNativeTypeFromNewExpression(\n expression: Readonly<es.NewExpression>\n): NativeTypeName | null {\n if (\n expression.callee.type !== \"Identifier\" ||\n !isNativeTypeName(expression.callee.name)\n ) {\n return null;\n }\n\n return expression.callee.name;\n}\n\nfunction getMemberKind(descriptor: Readonly<PropertyDescriptor>): MemberKind {\n if (typeof descriptor.value === \"function\") {\n return \"method\";\n }\n\n if (isDefined(descriptor.get) || isDefined(descriptor.set)) {\n return \"accessor\";\n }\n\n return \"data\";\n}\n\nconst getStaticMemberPropertyName = (\n node: Readonly<es.MemberExpression>\n): null | string => {\n if (node.computed || node.property.type !== \"Identifier\") {\n return null;\n }\n\n return node.property.name;\n};\n\nconst isCallUsage = (node: Readonly<es.MemberExpression>): boolean => {\n const parent = node.parent;\n\n return parent.type === \"CallExpression\" && parent.callee === node;\n};\n\nconst nativeTypeInfoByName: ReadonlyMap<NativeTypeName, NativeTypeInfo> =\n buildNativeTypeInfoByName(nativeTypeDefinitions);\n\nconst isNativeTypeName = (value: string): value is NativeTypeName =>\n setHas(nativeTypeNameSet, value as NativeTypeName);\n\n/**\n * Disallow using non-native members on built-in JavaScript types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n MemberExpression: (node: Readonly<es.MemberExpression>): void => {\n const propertyName = getStaticMemberPropertyName(node);\n\n if (propertyName === null || propertyName === \"prototype\") {\n return;\n }\n\n const nativeTypeName = inferNativeType(node.object);\n\n if (nativeTypeName === null) {\n return;\n }\n\n const nativeTypeInfo = nativeTypeInfoByName.get(nativeTypeName);\n\n if (!isDefined(nativeTypeInfo)) {\n return;\n }\n\n const memberKind = nativeTypeInfo.propertyKinds.get(propertyName);\n\n if (!isDefined(memberKind)) {\n context.report({\n data: {\n nativeTypeName,\n propertyName,\n },\n messageId: \"forbidden\",\n node,\n });\n\n return;\n }\n\n if (isCallUsage(node) && memberKind !== \"method\") {\n context.report({\n data: {\n nativeTypeName,\n propertyName,\n },\n messageId: \"forbidden\",\n node,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow usage of non-native members on built-in JavaScript objects.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-use-extend-native\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Avoid using '{{nativeTypeName}}.{{propertyName}}' when it is not part of the native JavaScript API.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-use-extend-native\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/no-use-before-define, perfectionist/sort-modules -- Re-enable after this file-scoped exception block. */\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-unnecessary-type-parameters\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-useless-generics\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/no-unnecessary-type-parameters.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-unnecessary-type-parameters\",\n url: \"https://typescript-eslint.io/rules/no-unnecessary-type-parameters\",\n },\n }),\n ],\n ruleId: \"no-useless-generics\",\n});\n\nexport default deprecatedRule;\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-base-to-string\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-value-tostring\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-base-to-string.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-base-to-string\",\n url: \"https://typescript-eslint.io/rules/no-base-to-string\",\n },\n }),\n ],\n ruleId: \"no-value-tostring\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\nimport type { Parameters as RecheckParameters } from \"recheck\";\n\nimport { checkSync } from \"recheck\";\nimport { arrayFirst, isDefined, keyIn, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype ComplexityType = \"exponential\" | \"polynomial\";\n\ntype MessageIds = \"checkerError\" | \"vulnerable\";\n\ntype Options = readonly [RuleOption?];\n\ntype RuleOption = Readonly<\n RecheckParameters & {\n readonly ignoreErrors?: boolean;\n readonly permittableComplexities?: readonly ComplexityType[];\n }\n>;\n\nconst getStaticStringValue = (node: Readonly<es.Expression>): null | string => {\n if (node.type === \"Literal\" && typeof node.value === \"string\") {\n return node.value;\n }\n\n if (\n node.type === \"TemplateLiteral\" &&\n node.expressions.length === 0 &&\n node.quasis.length === 1\n ) {\n return arrayFirst(node.quasis)?.value.cooked ?? null;\n }\n\n return null;\n};\n\nconst isNonSpreadArgument = (\n argument: Readonly<es.CallExpressionArgument>\n): argument is Readonly<es.Expression> => argument.type !== \"SpreadElement\";\n\nconst isRegExpConstructorCall = (\n node: Readonly<es.CallExpression | es.NewExpression>\n): boolean => {\n if (node.callee.type !== \"Identifier\" || node.callee.name !== \"RegExp\") {\n return false;\n }\n\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n return false;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (!isDefined(sourceArgument) || !isNonSpreadArgument(sourceArgument)) {\n return false;\n }\n\n const sourceValue = getStaticStringValue(sourceArgument);\n\n if (sourceValue === null) {\n return false;\n }\n\n const flagsArgument = node.arguments[1];\n\n if (flagsArgument === undefined) {\n return true;\n }\n\n if (flagsArgument.type === \"SpreadElement\") {\n return false;\n }\n\n return isDefined(getStaticStringValue(flagsArgument));\n};\n\nconst getStaticFlagsValue = (\n argument: Readonly<es.CallExpressionArgument> | undefined\n): null | string => {\n if (!isDefined(argument)) {\n return \"\";\n }\n\n if (!isNonSpreadArgument(argument)) {\n return null;\n }\n\n return getStaticStringValue(argument);\n};\n\nconst getDiagnosticsErrorMessage = (\n error: Readonly<{\n readonly kind: string;\n readonly message?: string;\n }>\n): string => {\n if (keyIn(error, \"message\") && typeof error.message === \"string\") {\n return error.message;\n }\n\n return \"No additional details provided.\";\n};\n\n/**\n * Detect ReDoS-vulnerable regular expressions using `recheck`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [rawOptions]) => {\n const options = rawOptions ?? {};\n const {\n ignoreErrors = true,\n permittableComplexities = [],\n ...recheckParameters\n } = options;\n const allowedComplexities = new Set(permittableComplexities);\n\n const reportDiagnostics = (\n node: Readonly<es.Node>,\n source: string,\n flags: string\n ): void => {\n const diagnostics = checkSync(source, flags, recheckParameters);\n\n if (diagnostics.status === \"safe\") {\n return;\n }\n\n if (diagnostics.status === \"vulnerable\") {\n if (setHas(allowedComplexities, diagnostics.complexity.type)) {\n return;\n }\n\n context.report({\n data: {\n summary: diagnostics.complexity.summary,\n },\n messageId: \"vulnerable\",\n node,\n });\n\n return;\n }\n\n if (ignoreErrors) {\n return;\n }\n\n context.report({\n data: {\n kind: diagnostics.error.kind,\n message: getDiagnosticsErrorMessage(diagnostics.error),\n },\n messageId: \"checkerError\",\n node,\n });\n };\n\n return {\n CallExpression: (node: Readonly<es.CallExpression>): void => {\n if (!isRegExpConstructorCall(node)) {\n return;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (\n !isDefined(sourceArgument) ||\n !isNonSpreadArgument(sourceArgument)\n ) {\n return;\n }\n\n const source = getStaticStringValue(sourceArgument);\n const secondArgument = node.arguments[1];\n const flags = getStaticFlagsValue(secondArgument);\n\n if (source === null || flags === null) {\n return;\n }\n\n reportDiagnostics(node, source, flags);\n },\n Literal: (node: Readonly<es.Literal>): void => {\n if (!(node.value instanceof RegExp)) {\n return;\n }\n\n reportDiagnostics(node, node.value.source, node.value.flags);\n },\n NewExpression: (node: Readonly<es.NewExpression>): void => {\n if (!isRegExpConstructorCall(node)) {\n return;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (\n !isDefined(sourceArgument) ||\n !isNonSpreadArgument(sourceArgument)\n ) {\n return;\n }\n\n const source = getStaticStringValue(sourceArgument);\n const secondArgument = node.arguments[1];\n const flags = getStaticFlagsValue(secondArgument);\n\n if (source === null || flags === null) {\n return;\n }\n\n reportDiagnostics(node, source, flags);\n },\n };\n },\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow ReDoS-vulnerable regular expressions.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-vulnerable\",\n },\n hasSuggestions: false,\n messages: {\n checkerError:\n \"ReDoS analysis failed ({{kind}}): {{message}}. Consider setting ignoreErrors to true for this pattern.\",\n vulnerable:\n \"Potential ReDoS-vulnerable regular expression detected ({{summary}}).\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for ReDoS analysis, including recheck parameters and local rule behavior flags.\",\n properties: {\n ignoreErrors: {\n description:\n \"Whether to suppress errors returned by the ReDoS analyzer.\",\n type: \"boolean\",\n },\n permittableComplexities: {\n description:\n \"List of vulnerable complexity categories to permit without reporting.\",\n items: {\n enum: [\"polynomial\", \"exponential\"],\n type: \"string\",\n },\n type: \"array\",\n uniqueItems: true,\n },\n timeout: {\n description:\n \"Maximum analysis time budget in milliseconds passed through to recheck.\",\n type: [\"number\", \"null\"],\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-vulnerable\",\n});\n\nexport default rule;\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\n\nconst externalRule = getCoreRule(\"accessor-pairs\");\n\n/**\n * Proxy of ESLint core `accessor-pairs` with plugin-local docs URL.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-writeonly\"\n);\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly maxProperties?: number;\n }>,\n];\n\nconst isSingleLine = (node: Readonly<es.ObjectExpression>): boolean =>\n node.loc.start.line === node.loc.end.line;\n\n/**\n * Enforce object literal line format based on configured property count.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => ({\n ObjectExpression: (node: Readonly<es.ObjectExpression>): void => {\n const maxProperties = options.maxProperties ?? 1;\n if (node.properties.length <= 1) {\n return;\n }\n\n const shouldBeSingleLine = node.properties.length <= maxProperties;\n const singleLine = isSingleLine(node);\n if (singleLine === shouldBeSingleLine) {\n return;\n }\n\n context.report({\n data: {\n expected: shouldBeSingleLine ? \"single-line\" : \"multi-line\",\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n defaultOptions: [{ maxProperties: 1 }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce object literal line format based on property count.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/object-format\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Object literal should use {{expected}} formatting for this size.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for object literal line formatting thresholds.\",\n properties: {\n maxProperties: {\n description:\n \"Maximum number of properties allowed on one line.\",\n minimum: 0,\n type: \"number\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"layout\",\n },\n name: \"object-format\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [\n Readonly<{\n readonly names?: readonly string[];\n }>,\n];\n\nconst getExportedNames = (\n node: Readonly<es.ExportNamedDeclaration>\n): readonly string[] => {\n if (node.specifiers.length > 0) {\n return node.specifiers\n .filter(\n (specifier): specifier is es.ExportSpecifier =>\n specifier.type === \"ExportSpecifier\"\n )\n .flatMap((specifier) => {\n if (specifier.exported.type === \"Identifier\") {\n return [specifier.exported.name];\n }\n\n return [];\n });\n }\n\n const declaration = node.declaration;\n if (declaration === null) {\n return [];\n }\n\n if (\n declaration.type === \"FunctionDeclaration\" ||\n declaration.type === \"ClassDeclaration\"\n ) {\n return declaration.id === null ? [] : [declaration.id.name];\n }\n\n if (declaration.type === \"VariableDeclaration\") {\n let names: readonly string[] = [];\n\n for (const declarator of declaration.declarations) {\n if (declarator.id.type === \"Identifier\") {\n names = [...names, declarator.id.name];\n }\n }\n\n return names;\n }\n\n return [];\n};\n\n/**\n * Restrict exported names to a configured allow-list.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const allowedNames = new Set(options.names ?? [\"default\"]);\n\n return {\n ExportDefaultDeclaration: (\n node: Readonly<es.ExportDefaultDeclaration>\n ): void => {\n if (setHas(allowedNames, \"default\")) {\n return;\n }\n\n context.report({\n data: {\n name: \"default\",\n },\n messageId: \"forbidden\",\n node,\n });\n },\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n const exportedNames = getExportedNames(node);\n for (const name of exportedNames) {\n if (setHas(allowedNames, name)) {\n continue;\n }\n\n context.report({\n data: {\n name,\n },\n messageId: \"forbidden\",\n node,\n });\n\n return;\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ names: [\"default\"] }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow exported names that are not in a configured allow-list.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/only-export-name\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Export '{{name}}' is not allowed by only-export-name.\",\n },\n schema: [\n {\n additionalProperties: false,\n description: \"Configuration for the export name allow-list.\",\n properties: {\n names: {\n description:\n \"Allowed export names. Default is ['default'].\",\n items: {\n minLength: 1,\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"only-export-name\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"Property > FunctionExpression.value:not([params.0.name='this'])\";\n\n/**\n * Prefer arrow-function object properties over function-expression properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require arrow-function properties when `this` is not required.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-arrow-function-property\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer arrow function properties.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-arrow-function-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \":not(VariableDeclarator) > CallExpression > Identifier.callee[name='require']\";\n\n/**\n * Require `require(...)` calls to be assigned to a const variable.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require require() calls to be assigned to const.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-const-require\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Assign require() results to a const variable.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-const-require\",\n});\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"prefer-includes\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-includes\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/prefer-includes.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"prefer-includes\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md\",\n },\n }),\n ],\n ruleId: \"prefer-includes\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, arrayJoin, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\" | \"suggest\";\n\ntype Options = readonly [RuleOptions?];\n\ntype RuleOptions = Readonly<{\n readonly allowIntersection?: boolean;\n readonly allowLocal?: boolean;\n}>;\n\nconst defaultOptions: Options = [{}];\n\nconst isExportedTypeAlias = (\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>\n): boolean =>\n typeAliasDeclaration.parent?.type === \"ExportNamedDeclaration\" &&\n typeAliasDeclaration.parent.declaration === typeAliasDeclaration;\n\nconst getTypeAliasDeclarationParent = (\n node: Readonly<es.Node> | undefined\n): Readonly<es.TSTypeAliasDeclaration> | undefined =>\n node?.type === \"TSTypeAliasDeclaration\" ? node : undefined;\n\nconst formatTypeParameters = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeParameters:\n | Readonly<es.TSTypeParameterDeclaration>\n | Readonly<es.TSTypeParameterInstantiation>\n | undefined\n): string =>\n typeParameters === undefined ? \"\" : sourceCode.getText(typeParameters);\n\nconst createTypeLiteralFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n typeLiteralNode: Readonly<es.TSTypeLiteral>\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const literalText = sourceCode.getText(typeLiteralNode);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters} ${literalText}`;\n};\n\nconst createFunctionTypeFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n functionTypeNode: Readonly<es.TSFunctionType>\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const functionTypeParameters = formatTypeParameters(\n sourceCode,\n functionTypeNode.typeParameters\n );\n const parametersText = arrayJoin(\n functionTypeNode.params.map((parameter) =>\n sourceCode.getText(parameter)\n ),\n \", \"\n );\n const returnTypeText =\n functionTypeNode.returnType === undefined\n ? \"void\"\n : sourceCode.getText(functionTypeNode.returnType.typeAnnotation);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters} { ${functionTypeParameters}(${parametersText}): ${returnTypeText}; }`;\n};\n\nconst createIntersectionFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n literalNode: Readonly<es.TSTypeLiteral> | undefined,\n referenceNodes: readonly Readonly<es.TSTypeReference>[]\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const baseTypesText = arrayJoin(\n referenceNodes.map((referenceNode) =>\n sourceCode.getText(referenceNode)\n ),\n \", \"\n );\n const extendsClause =\n baseTypesText.length > 0 ? ` extends ${baseTypesText}` : \"\";\n const bodyText =\n literalNode === undefined ? \"{}\" : sourceCode.getText(literalNode);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters}${extendsClause} ${bodyText}`;\n};\n\nconst canSafelyConvertIntersection = (\n intersectionTypeNode: Readonly<es.TSIntersectionType>,\n parserServices: Readonly<Parameters<typeof getConstrainedTypeAtLocation>[0]>\n):\n | undefined\n | {\n readonly literals: readonly Readonly<es.TSTypeLiteral>[];\n readonly references: readonly Readonly<es.TSTypeReference>[];\n } => {\n let literals: readonly es.TSTypeLiteral[] = [];\n let references: readonly es.TSTypeReference[] = [];\n\n for (const intersectionMember of intersectionTypeNode.types) {\n if (intersectionMember.type === \"TSTypeLiteral\") {\n literals = [...literals, intersectionMember];\n continue;\n }\n\n if (intersectionMember.type === \"TSTypeReference\") {\n references = [...references, intersectionMember];\n continue;\n }\n\n return undefined;\n }\n\n if (literals.length > 1) {\n return undefined;\n }\n\n for (const reference of references) {\n const referenceType = getConstrainedTypeAtLocation(\n parserServices,\n reference\n );\n if (tsutils.unionTypeParts(referenceType).length > 1) {\n return undefined;\n }\n }\n\n return {\n literals,\n references,\n };\n};\n\nconst hasFullTypeInformation = (\n parserServices: Readonly<ReturnType<typeof ESLintUtils.getParserServices>>\n): parserServices is Parameters<typeof getConstrainedTypeAtLocation>[0] =>\n parserServices.program !== null;\n\nconst reportTypeAlias = (\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n replacementText: string\n): void => {\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(typeAliasDeclaration, replacementText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAliasDeclaration.id,\n suggest: [\n {\n fix,\n messageId: \"suggest\",\n },\n ],\n });\n};\n\n/**\n * Prefer interface declarations when a type alias can be represented safely.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ allowIntersection = true, allowLocal = false } = {}] =\n context.options;\n const sourceCode = context.sourceCode;\n const parserServices = ESLintUtils.getParserServices(context, true);\n const typedParserServices = hasFullTypeInformation(parserServices)\n ? parserServices\n : undefined;\n\n const shouldSkipForAllowLocal = (\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>\n ): boolean => allowLocal && !isExportedTypeAlias(typeAliasDeclaration);\n\n return {\n \"TSTypeAliasDeclaration > TSFunctionType\": (\n functionTypeNode: Readonly<es.TSFunctionType>\n ) => {\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n functionTypeNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createFunctionTypeFixText(\n sourceCode,\n typeAliasDeclaration,\n functionTypeNode\n )\n );\n },\n \"TSTypeAliasDeclaration > TSIntersectionType\": (\n intersectionTypeNode: Readonly<es.TSIntersectionType>\n ) => {\n if (allowIntersection || typedParserServices === undefined) {\n return;\n }\n\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n intersectionTypeNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n const conversion = canSafelyConvertIntersection(\n intersectionTypeNode,\n typedParserServices\n );\n if (!isDefined(conversion)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createIntersectionFixText(\n sourceCode,\n typeAliasDeclaration,\n arrayFirst(conversion.literals),\n conversion.references\n )\n );\n },\n \"TSTypeAliasDeclaration > TSTypeLiteral\": (\n typeLiteralNode: Readonly<es.TSTypeLiteral>\n ) => {\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n typeLiteralNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createTypeLiteralFixText(\n sourceCode,\n typeAliasDeclaration,\n typeLiteralNode\n )\n );\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow equivalent type aliases when an interface declaration can be used.\",\n frozen: true,\n recommended: false,\n suggestion: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-interface\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Type alias can be declared using an interface.\",\n suggest: \"Use an interface instead of a type alias.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for allowing local aliases and intersection aliases.\",\n properties: {\n allowIntersection: {\n description:\n \"Whether type aliases that use intersections are allowed.\",\n type: \"boolean\",\n },\n allowLocal: {\n description:\n \"Whether non-exported type aliases are allowed.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-interface\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/consistent-type-definitions.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"consistent-type-definitions\",\n url: \"https://typescript-eslint.io/rules/consistent-type-definitions\",\n },\n }),\n ],\n ruleId: \"prefer-interface\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbiddenGT\" | \"forbiddenGTE\" | \"suggestLT\" | \"suggestLTE\";\n\nconst createFixes = (\n fixer: Readonly<TSESLint.RuleFixer>,\n context: Readonly<TSESLint.RuleContext<MessageIds, readonly []>>,\n expression: Readonly<es.BinaryExpression>,\n operatorText: \"<\" | \"<=\"\n): readonly TSESLint.RuleFix[] => {\n const { left, right } = expression;\n const operatorToken = context.sourceCode.getTokenAfter(left);\n if (operatorToken === null) {\n return [];\n }\n\n return [\n fixer.replaceText(left, context.sourceCode.getText(right)),\n fixer.replaceTextRange(operatorToken.range, operatorText),\n fixer.replaceText(right, context.sourceCode.getText(left)),\n ];\n};\n\n/**\n * Disallow greater-than comparisons in favor of less-than comparisons.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => ({\n \"BinaryExpression[operator='>'], BinaryExpression[operator='>=']\": (\n expression: Readonly<es.BinaryExpression>\n ) => {\n const useLessThanOrEqual = expression.operator === \">=\";\n const fixOperator = useLessThanOrEqual ? \"<=\" : \"<\";\n const messageId = useLessThanOrEqual\n ? \"forbiddenGTE\"\n : \"forbiddenGT\";\n const suggestionMessageId = useLessThanOrEqual\n ? \"suggestLTE\"\n : \"suggestLT\";\n\n context.report({\n fix: (fixer) =>\n createFixes(fixer, context, expression, fixOperator),\n messageId,\n node: expression,\n suggest: [\n {\n fix: (fixer) =>\n createFixes(\n fixer,\n context,\n expression,\n fixOperator\n ),\n messageId: suggestionMessageId,\n },\n ],\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow greater-than comparisons.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-less-than\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbiddenGT: \"Greater-than comparisons are forbidden.\",\n forbiddenGTE:\n \"Greater-than-or-equal comparisons are forbidden.\",\n suggestLT: \"Use a less-than comparison instead.\",\n suggestLTE: \"Use a less-than-or-equal comparison instead.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-less-than\",\n });\n\nexport default rule;\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst externalRule = getCoreRule(\"prefer-object-has-own\");\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-object-has-own\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of ESLint core prefer-object-has-own.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"eslint\",\n url: \"https://eslint.org/docs/latest/rules/\",\n },\n rule: {\n name: \"prefer-object-has-own\",\n url: \"https://eslint.org/docs/latest/rules/prefer-object-has-own\",\n },\n }),\n ],\n ruleId: \"prefer-object-has-own\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"Program[body.length>1]:has(ExportDefaultDeclaration)\";\n\n/**\n * Disallow additional exports when a default export exists.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow additional exports alongside a default export.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-only-export\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Export default should be only export.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-only-export\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayLast, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype JSDocKind = \"arrow-function\" | \"class\" | \"function\" | \"method\" | \"type\";\n\ntype MessageIds = \"missing\";\n\ntype Options = readonly [\n Readonly<{\n readonly kinds?: readonly JSDocKind[];\n }>,\n];\n\nconst defaultKinds: readonly JSDocKind[] = [\n \"arrow-function\",\n \"class\",\n \"function\",\n \"method\",\n \"type\",\n];\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\ntype SourceCode = TSESLint.SourceCode;\n\nconst hasJSDocComment = (\n sourceCode: Readonly<SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const comments = sourceCode.getCommentsBefore(node);\n\n const comment = arrayLast(comments);\n\n return comment?.type === \"Block\" && comment.value.startsWith(\"*\");\n};\n\nconst reportMissingJSDoc = (\n context: Readonly<RuleContext>,\n node: Readonly<es.Node>\n): void => {\n if (hasJSDocComment(context.sourceCode, node)) {\n return;\n }\n\n context.report({\n messageId: \"missing\",\n node,\n });\n};\n\n/**\n * Require JSDoc comments for configured declaration kinds.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const kinds = new Set(options.kinds ?? defaultKinds);\n\n return {\n ClassDeclaration: (node: Readonly<es.ClassDeclaration>): void => {\n if (!setHas(kinds, \"class\") || node.id === null) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n FunctionDeclaration: (\n node: Readonly<es.FunctionDeclaration>\n ): void => {\n if (!setHas(kinds, \"function\") || node.id === null) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n MethodDefinition: (node: Readonly<es.MethodDefinition>): void => {\n if (\n !setHas(kinds, \"method\") ||\n node.kind === \"constructor\" ||\n node.key.type !== \"Identifier\"\n ) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n \"TSTypeAliasDeclaration, TSInterfaceDeclaration\": (\n node: Readonly<es.Node>\n ): void => {\n if (!setHas(kinds, \"type\")) {\n return;\n }\n\n if (\n node.type === \"TSInterfaceDeclaration\" ||\n node.type === \"TSTypeAliasDeclaration\"\n ) {\n reportMissingJSDoc(context, node);\n }\n },\n VariableDeclarator: (\n node: Readonly<es.VariableDeclarator>\n ): void => {\n if (\n !setHas(kinds, \"arrow-function\") ||\n node.id.type !== \"Identifier\" ||\n node.init?.type !== \"ArrowFunctionExpression\" ||\n node.parent.type !== \"VariableDeclaration\" ||\n node.parent.kind !== \"const\"\n ) {\n return;\n }\n\n reportMissingJSDoc(context, node.parent);\n },\n };\n },\n meta: {\n defaultOptions: [{ kinds: defaultKinds }],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require JSDoc comments for configured declaration kinds.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/require-jsdoc\",\n },\n hasSuggestions: false,\n messages: {\n missing: \"Missing JSDoc comment.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for declaration kinds that require JSDoc.\",\n properties: {\n kinds: {\n description:\n \"Declaration kinds that must have a leading JSDoc comment.\",\n items: {\n enum: [...defaultKinds],\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"require-jsdoc\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of jsdoc/require-jsdoc.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"jsdoc\",\n url: \"https://github.com/gajus/eslint-plugin-jsdoc\",\n },\n rule: {\n name: \"require-jsdoc\",\n url: \"https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md\",\n },\n }),\n ],\n ruleId: \"require-jsdoc\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n normalizeSyntaxSelector,\n type SyntaxSelectorOption,\n} from \"../_internal/syntax-selectors.js\";\n\ntype MessageIds = \"customMessage\" | \"missing\";\n\ntype Options = readonly [\n Readonly<{\n readonly selectors?: readonly SyntaxSelectorOption[];\n }>,\n];\n\n/**\n * Require at least one occurrence of each configured syntax selector.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const entries = (options.selectors ?? []).map((selector) =>\n normalizeSyntaxSelector(selector)\n );\n const counters = entries.map(() => 0);\n\n let selectorListeners: Readonly<\n Record<string, (node: Readonly<es.Node>) => void>\n > = {};\n\n for (const [index, entry] of entries.entries()) {\n selectorListeners = {\n ...selectorListeners,\n [entry.selector]: (): void => {\n const count = counters[index] ?? 0;\n counters[index] = count + 1;\n },\n };\n }\n\n return {\n ...selectorListeners,\n \"Program:exit\": (node: Readonly<es.Program>): void => {\n for (const [index, entry] of entries.entries()) {\n const count = counters[index] ?? 0;\n if (count > 0) {\n continue;\n }\n\n if (isDefined(entry.message)) {\n context.report({\n data: {\n message: entry.message,\n },\n messageId: \"customMessage\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n selector: entry.selector,\n },\n messageId: \"missing\",\n node,\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ selectors: [] }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require at least one match for each configured AST selector.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/require-syntax\",\n },\n hasSuggestions: false,\n messages: {\n customMessage: \"{{message}}\",\n missing: \"Required syntax '{{selector}}' was not found.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for syntax selectors that must appear at least once.\",\n properties: {\n selectors: {\n description:\n \"Selector list. Each entry can be a selector string or a selector/message object.\",\n items: {\n oneOf: [\n {\n minLength: 1,\n type: \"string\",\n },\n {\n additionalProperties: false,\n properties: {\n message: {\n minLength: 1,\n type: \"string\",\n },\n selector: {\n minLength: 1,\n type: \"string\",\n },\n },\n required: [\"selector\"],\n type: \"object\",\n },\n ],\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"require-syntax\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst disallowedSelector = String.raw`Identifier[name=/[^$\\w]/u]`;\n\n/**\n * Restrict identifiers to latin letters, digits, underscores, and dollar signs.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require identifiers to contain only english characters, digits, underscore, or dollar sign.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/restrict-identifier-characters\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Identifier must consist of english characters and dollar sign.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"restrict-identifier-characters\",\n});\n\nexport default rule;\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport {\n arrayAt,\n arrayFirst,\n arrayJoin,\n isDefined,\n isPresent,\n} from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst getSortableValue = (\n element: Readonly<es.Expression | es.SpreadElement>\n): string | undefined => {\n if (element.type === \"Literal\") {\n return String(element.value);\n }\n\n return undefined;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.ArrayExpression>,\n sorted: readonly (es.Expression | es.SpreadElement)[]\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const [first, last] = [\n arrayFirst(node.elements),\n arrayAt(node.elements, -1),\n ];\n if (!isPresent(first) || !isPresent(last)) {\n return fixer.replaceText(node, sourceCode.getText(node));\n }\n\n return fixer.replaceTextRange(\n [arrayFirst(first.range), last.range[1]],\n arrayJoin(\n sorted.map((element) => sourceCode.getText(element)),\n \", \"\n )\n );\n };\n\n/**\n * Enforce alphabetical sorting for literal array elements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ArrayExpression: (node: Readonly<es.ArrayExpression>): void => {\n let elements: readonly (es.Expression | es.SpreadElement)[] = [];\n for (const element of node.elements) {\n if (element !== null) {\n elements = [...elements, element];\n }\n }\n if (elements.length < 2) {\n return;\n }\n\n const sortKeys = elements.map((element) =>\n getSortableValue(element)\n );\n if (sortKeys.some((sortKey) => !isDefined(sortKey))) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...elements].sort((a, b) =>\n (getSortableValue(a) ?? \"\").localeCompare(\n getSortableValue(b) ?? \"\"\n )\n );\n const unchanged = elements.every(\n (element, index) => element === sorted[index]\n );\n if (unchanged) {\n return;\n }\n\n context.report({\n fix: buildFix(context.sourceCode, node, sorted),\n messageId: \"incorrectSorting\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical sorting for literal array elements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-array\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Array literal elements should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-array\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"TSInterfaceBody > TSCallSignatureDeclaration:not(:first-child)\";\n\n/**\n * Require interface call signatures to appear before all other members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require call signatures to be the first member in interfaces.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-call-signature\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Call signature should be first.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-call-signature\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"incorrectSortingOrder\";\n\ntype Options = readonly [];\n\nconst memberName = (\n member: Readonly<es.MethodDefinition | es.PropertyDefinition>\n): string | undefined => {\n if (member.key.type === \"Identifier\") {\n return member.key.name;\n }\n\n if (member.key.type === \"Literal\" && typeof member.key.value === \"string\") {\n return member.key.value;\n }\n\n return undefined;\n};\n\n/**\n * Enforce alphabetical sorting of class members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ClassBody: (node: Readonly<es.ClassBody>): void => {\n let members: readonly (\n | es.MethodDefinition\n | es.PropertyDefinition\n )[] = [];\n for (const member of node.body) {\n if (\n member.type === \"PropertyDefinition\" ||\n member.type === \"MethodDefinition\"\n ) {\n members = [...members, member];\n }\n }\n\n let previousName = \"\";\n let hasPreviousName = false;\n for (const member of members) {\n const currentName = memberName(member);\n if (!isDefined(currentName)) {\n continue;\n }\n\n if (\n hasPreviousName &&\n currentName.localeCompare(previousName) < 0\n ) {\n context.report({\n messageId: \"incorrectSortingOrder\",\n node: member,\n });\n return;\n }\n\n previousName = currentName;\n hasPreviousName = true;\n }\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"enforce alphabetical sorting of class members.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-class-members\",\n },\n hasSuggestions: false,\n messages: {\n incorrectSortingOrder:\n \"Class members should appear in alphabetical order.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-class-members\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of sort-class-members/sort-class-members or perfectionist sorting rules.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"sort-class-members\",\n url: \"https://www.npmjs.com/package/eslint-plugin-sort-class-members\",\n },\n rule: {\n name: \"sort-class-members\",\n url: \"https://www.npmjs.com/package/eslint-plugin-sort-class-members\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"perfectionist\",\n url: \"https://perfectionist.dev/\",\n },\n }),\n ],\n ruleId: \"sort-class-members\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"TSInterfaceBody > TSConstructSignatureDeclaration:not(:first-child)\";\n\n/**\n * Require interface construct signatures to appear before all other members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require construct signatures to be the first member in interfaces.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-construct-signature\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Construct signature should be first.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-construct-signature\",\n});\n\nexport default rule;\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSortingOrder\";\n\ntype Options = readonly [];\n\nconst toName = (specifier: Readonly<es.ExportSpecifier>): string =>\n specifier.exported.type === \"Identifier\"\n ? specifier.exported.name\n : specifier.exported.value;\n\nconst buildFix = (\n fixer: TSESLint.RuleFixer,\n node: Readonly<es.ExportNamedDeclaration>,\n sourceCode: Readonly<TSESLint.SourceCode>,\n sorted: readonly es.ExportSpecifier[]\n): TSESLint.RuleFix => {\n const startRange = arrayFirst(node.specifiers)?.range ?? node.range;\n const endRange = arrayLast(node.specifiers)?.range ?? node.range;\n\n return fixer.replaceTextRange(\n [arrayFirst(startRange), arrayLast(endRange)],\n arrayJoin(\n sorted.map((specifier) => sourceCode.getText(specifier)),\n \", \"\n )\n );\n};\n\n/**\n * Enforce alphabetical sorting of named export specifiers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n let exportSpecifiers: readonly es.ExportSpecifier[] = [];\n for (const specifier of node.specifiers) {\n if (specifier.type === \"ExportSpecifier\") {\n exportSpecifiers = [...exportSpecifiers, specifier];\n }\n }\n if (exportSpecifiers.length < 2) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...exportSpecifiers].sort((a, b) =>\n toName(a).localeCompare(toName(b))\n );\n const unchanged = exportSpecifiers.every(\n (specifier, index) => specifier === sorted[index]\n );\n if (unchanged) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n buildFix(fixer, node, context.sourceCode, sorted),\n messageId: \"incorrectSortingOrder\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical sorting of named export specifiers.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-export-specifiers\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSortingOrder:\n \"Named export specifiers should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-export-specifiers\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst keyName = (property: Readonly<es.Property>): string | undefined => {\n if (property.key.type === \"Identifier\") {\n return property.key.name;\n }\n\n if (\n property.key.type === \"Literal\" &&\n typeof property.key.value === \"string\"\n ) {\n return property.key.value;\n }\n\n return undefined;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n properties: readonly es.Property[]\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const first = arrayFirst(properties);\n\n const last = arrayLast(properties);\n if (first === undefined || last === undefined) {\n return fixer.insertTextAfterRange([0, 0], \"\");\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...properties].sort((a, b) =>\n (keyName(a) ?? \"\").localeCompare(keyName(b) ?? \"\")\n );\n\n return fixer.replaceTextRange(\n [arrayFirst(first.range), last.range[1]],\n arrayJoin(\n sorted.map((property) => sourceCode.getText(property)),\n \", \"\n )\n );\n };\n\n/**\n * Enforce alphabetical sorting of object literal keys.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ObjectExpression: (node: Readonly<es.ObjectExpression>): void => {\n let properties: readonly es.Property[] = [];\n for (const property of node.properties) {\n if (\n property.type === \"Property\" &&\n property.kind === \"init\" &&\n !property.computed\n ) {\n properties = [...properties, property];\n }\n }\n if (properties.length < 2) {\n return;\n }\n\n let previousName = \"\";\n let hasPreviousName = false;\n for (const property of properties) {\n const currentName = keyName(property);\n if (!isDefined(currentName)) {\n return;\n }\n\n if (\n hasPreviousName &&\n currentName.localeCompare(previousName) < 0\n ) {\n context.report({\n fix: buildFix(context.sourceCode, properties),\n messageId: \"incorrectSorting\",\n node: property,\n });\n return;\n }\n\n previousName = currentName;\n hasPreviousName = true;\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"enforce alphabetical sorting of object literal keys.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-keys\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Object keys should appear in alphabetical order.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-keys\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst commentText = (comment: Readonly<es.Comment>): string =>\n comment.value.trim();\n\nconst buildReplacement = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n comments: readonly es.Comment[]\n): string =>\n arrayJoin(\n comments\n .map((comment) => sourceCode.getText(comment))\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n .sort((a, b) => a.localeCompare(b)),\n \"\\n\"\n );\n\n/**\n * Enforce alphabetical ordering of top-of-file comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (node: Readonly<es.Program>): void => {\n const firstNode = arrayFirst(node.body);\n if (firstNode === undefined) {\n return;\n }\n\n const comments = context.sourceCode\n .getCommentsBefore(firstNode)\n .filter(\n (comment) => comment.loc.end.line < firstNode.loc.start.line\n );\n if (comments.length < 2) {\n return;\n }\n\n const firstComment = arrayFirst(comments);\n if (firstComment === undefined) {\n return;\n }\n\n const lastComment = arrayLast(comments) ?? firstComment;\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...comments].sort((a, b) =>\n commentText(a).localeCompare(commentText(b))\n );\n const isSorted = comments.every(\n (comment, index) => comment === sorted[index]\n );\n if (isSorted) {\n return;\n }\n\n context.report({\n fix: (fixer): TSESLint.RuleFix =>\n fixer.replaceTextRange(\n [arrayFirst(firstComment.range), lastComment.range[1]],\n buildReplacement(context.sourceCode, comments)\n ),\n messageId: \"incorrectSorting\",\n node: firstComment,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical ordering of top-of-file comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-top-comments\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Top-level comments should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-top-comments\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isValidCaseBody = (node: Readonly<es.SwitchCase>): boolean => {\n if (node.consequent.length === 0) {\n return true;\n }\n\n const [firstStatement] = node.consequent;\n const lastStatement = arrayLast(node.consequent);\n if (firstStatement === undefined || lastStatement === undefined) {\n return true;\n }\n\n const startsOnFollowingLine =\n firstStatement.loc.start.line > node.loc.start.line;\n const startsWithBlock = firstStatement.type === \"BlockStatement\";\n const endsWithBreak =\n lastStatement.type === \"BreakStatement\" || startsWithBlock;\n\n return (startsOnFollowingLine || startsWithBlock) && endsWithBreak;\n};\n\n/**\n * Enforce consistent spacing and break placement inside switch cases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n SwitchCase: (node: Readonly<es.SwitchCase>): void => {\n if (isValidCaseBody(node)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"enforce consistent spacing and break placement in switch cases.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/switch-case-spacing\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Case body should start on a new line and end with break.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"switch-case-spacing\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @stylistic/switch-colon-spacing.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@stylistic\",\n url: \"https://eslint.style/\",\n },\n rule: {\n name: \"switch-colon-spacing\",\n url: \"https://eslint.style/rules/switch-colon-spacing\",\n },\n }),\n ],\n ruleId: \"switch-case-spacing\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport {\n arrayFirst,\n arrayJoin,\n arrayLast,\n isEmpty,\n stringSplit,\n} from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"invalidFormat\";\n\ntype Options = readonly [];\n\nconst isMultilineTemplate = (node: Readonly<es.TemplateLiteral>): boolean =>\n node.loc.start.line !== node.loc.end.line;\n\nconst hasExpectedBoundaryNewlines = (\n node: Readonly<es.TemplateLiteral>\n): boolean => {\n const first = arrayFirst(node.quasis)?.value.raw ?? \"\";\n const last = arrayLast(node.quasis)?.value.raw ?? \"\";\n\n return first.startsWith(\"\\n\") && last.endsWith(\"\\n\");\n};\n\nconst normalizeTemplate = (sourceText: string): string => {\n const lines = stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n const contentLines = lines.slice(1, -1);\n const indents = contentLines\n .filter((line) => line.trim().length > 0)\n .map((line) => /^\\s*/u.exec(line)?.[0].length ?? 0);\n const minIndent = isEmpty(indents) ? 0 : Math.min(...indents);\n\n const normalizedContent = arrayJoin(\n contentLines\n .map((line) =>\n line.length >= minIndent ? line.slice(minIndent) : line\n )\n .map((line) => ` ${line}`),\n \"\\n\"\n );\n\n const lastLine = arrayLast(lines) ?? \"\";\n\n return arrayJoin(\n [\n arrayFirst(lines),\n normalizedContent,\n lastLine,\n ],\n \"\\n\"\n );\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.TemplateLiteral>\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const text = sourceCode.getText(node);\n return fixer.replaceText(node, normalizeTemplate(text));\n };\n\n/**\n * Enforce newline boundary formatting for multiline template literals.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TemplateLiteral: (node: Readonly<es.TemplateLiteral>): void => {\n if (\n !isMultilineTemplate(node) ||\n hasExpectedBoundaryNewlines(node)\n ) {\n return;\n }\n\n context.report({\n fix: buildFix(context.sourceCode, node),\n messageId: \"invalidFormat\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce newline boundary formatting for multiline template literals.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/template-literal-format\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n invalidFormat:\n \"Multiline template literals must start and end on their own lines.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"template-literal-format\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n getConstrainedTypeAtLocation,\n isBuiltinSymbolLike,\n isErrorLike,\n isTypeAnyType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport {\n type TSESTree as es,\n ESLintUtils,\n type TSESLint,\n} from \"@typescript-eslint/utils\";\nimport { arrayFirst, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestWrapInError\";\n\ntype Options = readonly [];\n\nconst isAllowedThrowableVariant = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n isTypeAnyType(type) ||\n isTypeUnknownType(type) ||\n isErrorLike(program, type);\n\nconst couldBeAllowedThrowableType = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n tsutils\n .unionTypeParts(type)\n .every((typeVariant) =>\n isAllowedThrowableVariant(typeVariant, program)\n );\n\nconst couldBePromiseConstructorType = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n tsutils\n .unionTypeParts(type)\n .some((typeVariant) =>\n isBuiltinSymbolLike(program, typeVariant, \"PromiseConstructor\")\n );\n\nconst isPromiseIdentifier = (node: Readonly<es.Expression>): boolean =>\n node.type === \"Identifier\" && node.name === \"Promise\";\n\nconst createWrapLiteralInErrorSuggestionFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): TSESLint.ReportFixFunction | undefined => {\n if (node.type !== \"Literal\") {\n return undefined;\n }\n\n return (fixer) =>\n fixer.replaceText(node, `new Error(${sourceCode.getText(node)})`);\n};\n\n/**\n * Disallow throwing or rejecting values that are not Error-like.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const sourceCode = context.sourceCode;\n const { program } = parserServices;\n\n const reportIfNonErrorLike = (\n node: Readonly<es.Node>,\n usage: \"Rejecting with\" | \"Throwing\"\n ): void => {\n const type = getConstrainedTypeAtLocation(parserServices, node);\n\n if (couldBeAllowedThrowableType(type, program)) {\n return;\n }\n\n const suggestionFix = createWrapLiteralInErrorSuggestionFix(\n sourceCode,\n node\n );\n\n context.report({\n data: { usage },\n messageId: \"forbidden\",\n node,\n ...(suggestionFix === undefined\n ? {}\n : {\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestWrapInError\",\n },\n ],\n }),\n });\n };\n\n const checkRejectionCall = (\n callExpression: Readonly<es.CallExpression>\n ): void => {\n const rejectionValue = arrayFirst(callExpression.arguments);\n if (rejectionValue === undefined) {\n return;\n }\n\n reportIfNonErrorLike(rejectionValue, \"Rejecting with\");\n };\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='reject']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type === \"Super\"\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (\n !couldBePromiseConstructorType(objectType, program) &&\n !isPromiseIdentifier(callee.object)\n ) {\n return;\n }\n\n checkRejectionCall(callExpression);\n },\n \"NewExpression[callee.type='Identifier'][callee.name='Promise'] > ArrowFunctionExpression, NewExpression[callee.type='Identifier'][callee.name='Promise'] > FunctionExpression\":\n (\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n ) => {\n const rejectParameter = callback.params[1];\n if (rejectParameter?.type !== \"Identifier\") {\n return;\n }\n\n const rejectVariable = arrayFirst(\n context.sourceCode\n .getDeclaredVariables(callback)\n .filter(\n (declaredVariable) =>\n declaredVariable.name ===\n rejectParameter.name\n )\n );\n\n if (!isDefined(rejectVariable)) {\n return;\n }\n\n for (const reference of rejectVariable.references) {\n const { identifier } = reference;\n const parent = identifier.parent;\n if (\n parent?.type === \"CallExpression\" &&\n parent.callee === identifier\n ) {\n checkRejectionCall(parent);\n }\n }\n },\n ThrowStatement: (throwStatement: Readonly<es.ThrowStatement>) => {\n const { argument } = throwStatement;\n if (argument === null) {\n return;\n }\n\n reportIfNonErrorLike(argument, \"Throwing\");\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow throwing or rejecting values that are not Error-like.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/throw-error\",\n },\n hasSuggestions: true,\n messages: {\n forbidden: \"{{usage}} non-`Error` values is forbidden.\",\n suggestWrapInError:\n \"Wrap this value in an Error constructor before throwing or rejecting.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"throw-error\",\n});\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"throw-new-error\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/throw-new-error\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/throw-new-error.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"throw-new-error\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md\",\n },\n }),\n ],\n ruleId: \"throw-new-error\",\n});\n\nexport default deprecatedRule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst arrayCallbackMethodNames = new Set<string>([\n \"every\",\n \"find\",\n \"findIndex\",\n \"findLast\",\n \"findLastIndex\",\n \"flatMap\",\n \"forEach\",\n \"map\",\n \"some\",\n]);\n\nconst readonlyArrayTypeNames = new Set([\"ReadonlyArray\"]);\n\nconst callbackSelector =\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'] > :matches(FunctionExpression, ArrowFunctionExpression):not([returnType])\";\n\nconst isArrayLikeType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n const apparentType = typeChecker.getApparentType(type);\n\n return (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker) ||\n containsAllTypesByName(type, false, readonlyArrayTypeNames, true)\n );\n};\n\nconst isFirstCallbackArgument = (\n callExpression: Readonly<es.CallExpression>,\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n): boolean => arrayFirst(callExpression.arguments) === callback;\n\n/**\n * Require explicit return types for array callback functions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n return {\n [callbackSelector]: (\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n ) => {\n const parentNode = callback.parent;\n if (parentNode?.type !== \"CallExpression\") {\n return;\n }\n\n if (!isFirstCallbackArgument(parentNode, callback)) {\n return;\n }\n\n const { callee } = parentNode;\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type === \"Super\" ||\n callee.property.type !== \"Identifier\" ||\n !setHas(arrayCallbackMethodNames, callee.property.name)\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (!isArrayLikeType(typeChecker, objectType)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: callback,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit return types for array callback functions.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-array-callback-return-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Specify the callback return type explicitly.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/array-callback-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, objectEntries, objectHasOwn } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isNode = (value: unknown): value is Readonly<es.Node> =>\n typeof value === \"object\" && value !== null && objectHasOwn(value, \"type\");\n\nconst collectNodeChildren = (\n node: Readonly<es.Node>\n): readonly Readonly<es.Node>[] => {\n let children: readonly Readonly<es.Node>[] = [];\n\n const addNode = (value: unknown): void => {\n if (isNode(value)) {\n children = [...children, value];\n }\n };\n\n for (const [key, child] of objectEntries(node)) {\n if (key === \"loc\" || key === \"parent\" || key === \"range\") {\n continue;\n }\n\n if (Array.isArray(child)) {\n for (const item of child) {\n addNode(item);\n }\n continue;\n }\n\n addNode(child);\n }\n\n return children;\n};\n\nconst containsThisExpression = (root: Readonly<es.Node>): boolean => {\n let stack: readonly es.Node[] = [root];\n\n while (stack.length > 0) {\n const node = arrayAt(stack, -1);\n stack = stack.slice(0, -1);\n if (node === undefined) {\n continue;\n }\n\n if (node.type === \"ThisExpression\") {\n return true;\n }\n\n stack = [...stack, ...collectNodeChildren(node)];\n }\n\n return false;\n};\n\nconst hasThisParameter = (node: Readonly<es.MethodDefinition>): boolean => {\n const [firstParameter] = node.value.params;\n\n return (\n firstParameter?.type === \"Identifier\" && firstParameter.name === \"this\"\n );\n};\n\nconst usesThisExpression = (node: Readonly<es.MethodDefinition>): boolean =>\n node.value.body === null ? false : containsThisExpression(node.value.body);\n\nconst shouldSkipMethod = (node: Readonly<es.MethodDefinition>): boolean =>\n node.kind !== \"method\" ||\n node.static ||\n node.value.body === null ||\n hasThisParameter(node) ||\n usesThisExpression(node);\n\n/**\n * Require non-static class methods to reference `this`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n MethodDefinition: (node: Readonly<es.MethodDefinition>): void => {\n if (shouldSkipMethod(node)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require non-static class methods to reference `this`.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-class-methods-use-this\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Class method should use `this` or declare a `this` parameter.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/class-methods-use-this\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/class-methods-use-this.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"class-methods-use-this\",\n url: \"https://typescript-eslint.io/rules/class-methods-use-this\",\n },\n }),\n ],\n ruleId: \"typescript/class-methods-use-this\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`:matches(TSTypeAliasDeclaration[typeAnnotation.type='TSArrayType'], TSTypeAliasDeclaration[typeAnnotation.type='TSTupleType'], TSTypeAliasDeclaration[typeAnnotation.type='TSTypeReference']:has(TSTypeReference > Identifier[name='Array'])) > Identifier.id:not([name=/^(?:[A-Z][a-z\\d]*)+(?:Array|s)$/u])`;\n\n/**\n * Require array-like type aliases to end with `Array` or `s`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent naming for array-like type aliases.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-consistent-array-type-name\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Use a name ending with \"Array\" or \"s\" for array-like type aliases.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/consistent-array-type-name\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"AssignmentExpression > MemberExpression.left > Identifier.object\";\n\n/**\n * Require defining function properties in a single statement.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require defining function properties in a single statement.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-define-function-in-one-statement\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use `Object.assign` to define function properties in one statement.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/define-function-in-one-statement\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"SwitchStatement[cases.length>1]:not(:has(SwitchCase[test=null]))\";\n\n/**\n * Require a default case in non-trivial switch statements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require a default case in switch statements with multiple branches.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-exhaustive-switch\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Add a default case to make this switch exhaustive.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/exhaustive-switch\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/switch-exhaustiveness-check.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"switch-exhaustiveness-check\",\n url: \"https://typescript-eslint.io/rules/switch-exhaustiveness-check\",\n },\n }),\n ],\n ruleId: \"typescript/exhaustive-switch\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=true]\",\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=false]\",\n ],\n \", \"\n);\n\n/**\n * Disallow optional boolean literal property types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Literal\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"boolean\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow optional boolean literal types in property signatures.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-boolean-literal-type\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: 'Use \"boolean\" type instead.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-boolean-literal-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"VariableDeclarator:not([id.typeAnnotation], [init.expression.properties.length=0]) > Identifier.id\";\n\n/**\n * Disallow complex inferred declarator types without annotation.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow complex inferred declarator types without explicit annotation.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-complex-declarator-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Add a type annotation (or `as const`) for this complex declarator.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-complex-declarator-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"ArrowFunctionExpression[returnType=undefined] > :matches(TSAsExpression, TSTypeAssertion) > :matches(FunctionExpression, ArrowFunctionExpression, ObjectExpression, ClassExpression)\";\n\n/**\n * Disallow inferred complex return types for arrow functions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow complex inferred arrow-function return types without explicit annotation.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-complex-return-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Add an explicit return type annotation for complex return expressions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-complex-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Disallow empty interfaces without extends clauses.\n */\nconst selector =\n \"TSInterfaceDeclaration[body.body.length=0][extends.length=0] > Identifier.id\";\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow empty interfaces without extends clauses.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-empty-interfaces\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Empty interface is not allowed.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-empty-interfaces\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-empty-object-type.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-empty-object-type\",\n url: \"https://typescript-eslint.io/rules/no-empty-object-type\",\n },\n }),\n ],\n ruleId: \"typescript/no-empty-interfaces\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"PropertyDefinition[value.type='Literal'] > TSTypeAnnotation\",\n \"VariableDeclarator[init.type='Literal'] > Identifier.id > TSTypeAnnotation\",\n ],\n \", \"\n);\n\n/**\n * Disallow explicit primitive type annotations when they are inferrable.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow explicit primitive type annotations when they are inferrable from literals.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-inferrable-types\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Type annotation can be inferred from the assigned literal value.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-inferrable-types\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-inferrable-types.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-inferrable-types\",\n url: \"https://typescript-eslint.io/rules/no-inferrable-types\",\n },\n }),\n ],\n ruleId: \"typescript/no-inferrable-types\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTupleType > TSUnionType:not([types.length=1])\";\n\n/**\n * Disallow union element types directly inside tuple elements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow union element types directly inside tuple element positions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-multi-type-tuples\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Avoid multi-type tuple elements; extract a named alias instead.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-multi-type-tuples\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isTypeNeverType,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isTypeAliasNeverIdentifier = (node: Readonly<es.Identifier>): boolean =>\n node.parent.type === \"TSTypeAliasDeclaration\" &&\n node.parent.id === node &&\n node.parent.typeAnnotation.type === \"TSNeverKeyword\";\n\n/**\n * Disallow inferred `never` types on identifiers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n\n return {\n Identifier: (node: Readonly<es.Identifier>): void => {\n if (isTypeAliasNeverIdentifier(node)) {\n return;\n }\n\n const type = getConstrainedTypeAtLocation(parserServices, node);\n\n if (!isTypeNeverType(type)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow inferred identifiers with `never` type.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-never\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Unexpected `never` type on this identifier.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-never\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst getTypeAnnotationFromDeclarator = (\n declarator: Readonly<es.VariableDeclarator>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n declarator.id.type === \"Identifier\" ||\n declarator.id.type === \"ArrayPattern\" ||\n declarator.id.type === \"ObjectPattern\"\n ) {\n return declarator.id.typeAnnotation;\n }\n\n return undefined;\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\n/**\n * Disallow redundant `undefined` unions on const declarations with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n 'VariableDeclaration[kind=\"const\"] > VariableDeclarator': (\n node: Readonly<es.Node>\n ): void => {\n if (node.type !== \"VariableDeclarator\") {\n return;\n }\n\n if (node.init === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(node.init)) {\n return;\n }\n\n const typeAnnotation = getTypeAnnotationFromDeclarator(node);\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in const declaration union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-const\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Const declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this const declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-const\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getAssignmentPatternFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.AssignmentPattern> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return pattern;\n }\n\n if (pattern.type === \"RestElement\") {\n return undefined;\n }\n\n return undefined;\n};\n\nconst getAssignmentPatternFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.AssignmentPattern> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getAssignmentPatternFromPattern(parameter.parameter);\n }\n\n return getAssignmentPatternFromPattern(parameter);\n};\n\nconst getTypeAnnotationFromAssignmentPattern = (\n assignmentPattern: Readonly<es.AssignmentPattern>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n assignmentPattern.left.type !== \"ArrayPattern\" &&\n assignmentPattern.left.type !== \"Identifier\" &&\n assignmentPattern.left.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return assignmentPattern.left.typeAnnotation;\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on default parameters with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const assignmentPattern =\n getAssignmentPatternFromParameter(parameter);\n\n if (assignmentPattern === undefined) {\n continue;\n }\n\n if (\n !isDefinitelyDefinedExpression(assignmentPattern.right)\n ) {\n continue;\n }\n\n const typeAnnotation =\n getTypeAnnotationFromAssignmentPattern(\n assignmentPattern\n );\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n continue;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n continue;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in default parameter union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-default-parameter\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Default parameters with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this default parameter type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-default-parameter\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst isNeverReassigned = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n declarator: Readonly<es.VariableDeclarator>\n): boolean => {\n const [declaredVariable] = sourceCode.getDeclaredVariables(declarator);\n\n if (declaredVariable === undefined) {\n return false;\n }\n\n return !declaredVariable.references.some(\n (reference) => reference.isWrite() && reference.init !== true\n );\n};\n\n/**\n * Disallow redundant `undefined` unions on `let` declarations that are never\n * reassigned and initialized with definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"VariableDeclaration[kind='let'] > VariableDeclarator[id.type='Identifier']\":\n (node: Readonly<es.VariableDeclarator>): void => {\n const initializer = node.init;\n\n if (initializer === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(initializer)) {\n return;\n }\n\n if (!isNeverReassigned(sourceCode, node)) {\n return;\n }\n\n const id = node.id;\n\n if (id.type !== \"Identifier\") {\n return;\n }\n\n const typeAnnotation = id.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in `let` type unions when declarations are never reassigned and initialized with definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-let\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Never-reassigned `let` declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this `let` declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-let\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"Identifier[optional=true] > TSTypeAnnotation > TSUnionType\",\n \"TSNamedTupleMember[optional=true] > TSUnionType\",\n \"TSOptionalType > TSUnionType\",\n ],\n \", \"\n);\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on optional parameters and tuple\n * members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(sourceCode, node);\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix => fixer.replaceText(node, fixedTypeText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in optional parameter and tuple member union types.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-optional\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Optional parameters and tuple members should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this optional union type.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-optional\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, arrayFirst, arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\ntype ReturnableFunctionNode =\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression;\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ConditionalExpression\") {\n return (\n isDefinitelyDefinedExpression(unwrappedExpression.consequent) &&\n isDefinitelyDefinedExpression(unwrappedExpression.alternate)\n );\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (\n unwrappedExpression.type === \"LogicalExpression\" &&\n unwrappedExpression.operator === \"??\"\n ) {\n return isDefinitelyDefinedExpression(unwrappedExpression.right);\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"SequenceExpression\") {\n const lastExpression = arrayAt(unwrappedExpression.expressions, -1);\n\n return (\n lastExpression !== undefined &&\n isDefinitelyDefinedExpression(lastExpression)\n );\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst hasDefinitelyDefinedReturnValue = (\n node: Readonly<ReturnableFunctionNode>\n): boolean => {\n const body = node.body;\n\n if (body.type !== \"BlockStatement\") {\n return isDefinitelyDefinedExpression(body);\n }\n\n if (body.body.length !== 1) {\n return false;\n }\n\n const statement = arrayFirst(body.body);\n\n if (statement === undefined) {\n return false;\n }\n\n if (statement.type !== \"ReturnStatement\") {\n return false;\n }\n\n if (statement.argument === null) {\n return false;\n }\n\n return isDefinitelyDefinedExpression(statement.argument);\n};\n\nconst getPromiseValueUnionType = (\n returnType: Readonly<es.TSTypeAnnotation>\n): Readonly<es.TSUnionType> | undefined => {\n const annotation = returnType.typeAnnotation;\n\n if (annotation.type !== \"TSTypeReference\") {\n return undefined;\n }\n\n if (annotation.typeName.type !== \"Identifier\") {\n return undefined;\n }\n\n if (annotation.typeName.name !== \"Promise\") {\n return undefined;\n }\n\n const typeArguments = annotation.typeArguments;\n\n if (typeArguments?.params.length !== 1) {\n return undefined;\n }\n\n const [promiseValueType] = typeArguments.params;\n\n if (promiseValueType === undefined) {\n return undefined;\n }\n\n if (promiseValueType.type !== \"TSUnionType\") {\n return undefined;\n }\n\n return promiseValueType;\n};\n\n/**\n * Disallow redundant `undefined` inside Promise return type unions for async\n * functions that deterministically return definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)[async=true]\":\n (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"ArrowFunctionExpression\" &&\n node.type !== \"FunctionDeclaration\" &&\n node.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const returnType = node.returnType;\n\n if (returnType === undefined) {\n return;\n }\n\n const promiseValueUnionType =\n getPromiseValueUnionType(returnType);\n\n if (promiseValueUnionType === undefined) {\n return;\n }\n\n if (!hasDefinitelyDefinedReturnValue(node)) {\n return;\n }\n\n const fixedPromiseValueTypeText = buildFixedTypeText(\n sourceCode,\n promiseValueUnionType\n );\n\n if (!isDefined(fixedPromiseValueTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n promiseValueUnionType,\n fixedPromiseValueTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: promiseValueUnionType,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in Promise return value unions for async functions that deterministically return definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-promise-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Async Promise return value unions should not redundantly include `undefined` when the function deterministically returns definitely-defined values.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this Promise return value union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-promise-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\n/**\n * Disallow redundant `undefined` unions on readonly class properties with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"PropertyDefinition[readonly=true][optional!=true]\": (\n node: Readonly<es.Node>\n ): void => {\n if (node.type !== \"PropertyDefinition\") {\n return;\n }\n\n if (node.declare) {\n return;\n }\n\n if (node.value === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(node.value)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in readonly property union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-readonly-property\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Readonly properties with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this readonly property type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-readonly-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, arrayFirst, arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\ntype ReturnableFunctionNode =\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression;\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ConditionalExpression\") {\n return (\n isDefinitelyDefinedExpression(unwrappedExpression.consequent) &&\n isDefinitelyDefinedExpression(unwrappedExpression.alternate)\n );\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (\n unwrappedExpression.type === \"LogicalExpression\" &&\n unwrappedExpression.operator === \"??\"\n ) {\n return isDefinitelyDefinedExpression(unwrappedExpression.right);\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"SequenceExpression\") {\n const lastExpression = arrayAt(unwrappedExpression.expressions, -1);\n\n return (\n lastExpression !== undefined &&\n isDefinitelyDefinedExpression(lastExpression)\n );\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst hasDefinitelyDefinedReturnValue = (\n node: Readonly<ReturnableFunctionNode>\n): boolean => {\n const body = node.body;\n\n if (body.type !== \"BlockStatement\") {\n return isDefinitelyDefinedExpression(body);\n }\n\n if (body.body.length !== 1) {\n return false;\n }\n\n const statement = arrayFirst(body.body);\n\n if (statement === undefined) {\n return false;\n }\n\n if (statement.type !== \"ReturnStatement\") {\n return false;\n }\n\n if (statement.argument === null) {\n return false;\n }\n\n return isDefinitelyDefinedExpression(statement.argument);\n};\n\n/**\n * Disallow redundant `undefined` in return type unions when the function body\n * deterministically returns a definitely-defined value.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)\":\n (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"ArrowFunctionExpression\" &&\n node.type !== \"FunctionDeclaration\" &&\n node.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const returnType = node.returnType;\n\n if (returnType === undefined) {\n return;\n }\n\n if (returnType.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n if (!hasDefinitelyDefinedReturnValue(node)) {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n returnType.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n returnType.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: returnType.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in return type unions when the function deterministically returns a definitely-defined value.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Return types should not redundantly include `undefined` when the function deterministically returns a definitely-defined value.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this return type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst isNeverReassigned = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n declarator: Readonly<es.VariableDeclarator>\n): boolean => {\n const [declaredVariable] = sourceCode.getDeclaredVariables(declarator);\n\n if (declaredVariable === undefined) {\n return false;\n }\n\n return !declaredVariable.references.some(\n (reference) => reference.isWrite() && reference.init !== true\n );\n};\n\n/**\n * Disallow redundant `undefined` unions on `var` declarations that are never\n * reassigned and initialized with definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"VariableDeclaration[kind='var'] > VariableDeclarator[id.type='Identifier']\":\n (node: Readonly<es.VariableDeclarator>): void => {\n const initializer = node.init;\n\n if (initializer === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(initializer)) {\n return;\n }\n\n if (!isNeverReassigned(sourceCode, node)) {\n return;\n }\n\n const id = node.id;\n\n if (id.type !== \"Identifier\") {\n return;\n }\n\n const typeAnnotation = id.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in `var` type unions when declarations are never reassigned and initialized with definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-var\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Never-reassigned `var` declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this `var` declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-var\",\n});\n\nexport default rule;\n", "import {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport noRestrictedSyntaxRule from \"./no-restricted-syntax.js\";\n\n/**\n * TypeScript-prefixed alias for selector-based restricted syntax checks.\n */\nconst typescriptNoRestrictedSyntaxRule: typeof noRestrictedSyntaxRule = {\n ...noRestrictedSyntaxRule,\n meta: {\n deprecated: true,\n ...noRestrictedSyntaxRule.meta,\n docs: {\n deprecated: true,\n frozen: true,\n recommended: false,\n ...noRestrictedSyntaxRule.meta.docs,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-restricted-syntax\",\n } as NonNullable<typeof noRestrictedSyntaxRule.meta.docs>,\n },\n};\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof typescriptNoRestrictedSyntaxRule =\n withDeprecatedRuleLifecycle(typescriptNoRestrictedSyntaxRule, {\n message:\n \"Deprecated in favor of @typescript-eslint/no-restricted-syntax.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-restricted-syntax\",\n url: \"https://typescript-eslint.io/rules/no-restricted-syntax\",\n },\n }),\n ],\n ruleId: \"typescript/no-restricted-syntax\",\n });\n\nexport default deprecatedRule;\n", "import { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Disallow Object.assign into targets with readonly properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const checker = parserServices.program.getTypeChecker();\n\n const hasReadonlyProperty = (\n type: ReturnType<typeof checker.getTypeAtLocation>\n ): boolean =>\n type\n .getProperties()\n .some((property) =>\n tsutils.isPropertyReadonlyInType(\n type,\n property.getEscapedName(),\n checker\n )\n );\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name='Object'][callee.property.type='Identifier'][callee.property.name='assign']\":\n (node: Readonly<es.CallExpression>): void => {\n const [target] = node.arguments;\n if (target === undefined) {\n return;\n }\n\n const targetType = getConstrainedTypeAtLocation(\n parserServices,\n target\n );\n if (!hasReadonlyProperty(targetType)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow Object.assign calls that mutate readonly-typed targets.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-unsafe-object-assign\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not use Object.assign on targets with readonly properties.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-unsafe-object-assign\",\n});\n\nexport default rule;\n", "import coreNoUnsafeObjectAssignRule from \"./typescript-no-unsafe-object-assign.js\";\n\n/**\n * TypeScript-prefixed alias for Object.assign readonly-target safety checks.\n */\nconst rule: typeof coreNoUnsafeObjectAssignRule = {\n ...coreNoUnsafeObjectAssignRule,\n meta: {\n deprecated: false,\n ...coreNoUnsafeObjectAssignRule.meta,\n docs: {\n deprecated: false,\n frozen: false,\n recommended: false,\n ...coreNoUnsafeObjectAssignRule.meta.docs,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-unsafe-object-assignment\",\n } as NonNullable<typeof coreNoUnsafeObjectAssignRule.meta.docs>,\n },\n};\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`TSTypeAliasDeclaration > Identifier.id:matches([parent.typeAnnotation.type='TSArrayType'], [parent.typeAnnotation.type='TSTupleType']):not([name=/^(?:[A-Z][a-z\\d]*)+(?:Array|s)$/u])`;\n\n/**\n * Prefer reusable named aliases for array and tuple type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require reusable alias names for array and tuple type aliases.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-array-type-alias\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Prefer a named alias ending in \"Array\" or \"s\" for array/tuple type aliases.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-array-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"PropertyDefinition:not([typeAnnotation]) > ArrowFunctionExpression\";\n\n/**\n * Prefer class methods over untyped arrow-function class properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require class methods over untyped arrow-function class properties.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-class-method\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use a class method instead of an untyped function property.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-class-method\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isTypeFlagSet,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\nimport ts from \"typescript\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds =\n | \"preferEnumComparison\"\n | \"preferEnumReturn\"\n | \"preferEnumUnion\";\n\ntype Options = readonly [];\n\nconst isEnumLikeOrUndefinedType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n let hasEnumLike = false;\n\n for (const typeVariant of tsutils.unionTypeParts(type)) {\n const apparentType = checker.getApparentType(typeVariant);\n\n if (isTypeFlagSet(typeVariant, ts.TypeFlags.Undefined)) {\n continue;\n }\n\n if (\n isTypeFlagSet(typeVariant, ts.TypeFlags.EnumLike) ||\n isTypeFlagSet(apparentType, ts.TypeFlags.EnumLike)\n ) {\n hasEnumLike = true;\n continue;\n }\n\n return false;\n }\n\n return hasEnumLike;\n};\n\nconst isStringLiteral = (node: Readonly<es.Node>): node is es.Literal =>\n node.type === \"Literal\" && typeof node.value === \"string\";\n\n/**\n * Prefer enums over string literal comparisons and unions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const checker = parserServices.program.getTypeChecker();\n\n return {\n BinaryExpression: (node: Readonly<es.BinaryExpression>): void => {\n const isEqualityOperator =\n node.operator === \"==\" ||\n node.operator === \"===\" ||\n node.operator === \"!=\" ||\n node.operator === \"!==\";\n if (!isEqualityOperator) {\n return;\n }\n\n let literalNode: es.Literal | null = null;\n if (isStringLiteral(node.left)) {\n literalNode = node.left;\n } else if (isStringLiteral(node.right)) {\n literalNode = node.right;\n }\n const expressionNode =\n literalNode === node.left ? node.right : node.left;\n if (literalNode === null) {\n return;\n }\n\n const expressionType = getConstrainedTypeAtLocation(\n parserServices,\n expressionNode\n );\n if (!isEnumLikeOrUndefinedType(checker, expressionType)) {\n return;\n }\n\n context.report({\n messageId: \"preferEnumComparison\",\n node: literalNode,\n });\n },\n ReturnStatement: (node: Readonly<es.ReturnStatement>): void => {\n if (node.argument === null || !isStringLiteral(node.argument)) {\n return;\n }\n\n let functionNode:\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression\n | null = null;\n for (const ancestor of context.sourceCode.getAncestors(node)) {\n if (\n ancestor.type === \"ArrowFunctionExpression\" ||\n ancestor.type === \"FunctionDeclaration\" ||\n ancestor.type === \"FunctionExpression\"\n ) {\n functionNode = ancestor;\n }\n }\n if (functionNode === null) {\n return;\n }\n\n const signature = arrayFirst(\n getConstrainedTypeAtLocation(\n parserServices,\n functionNode\n ).getCallSignatures()\n );\n const returnType = isDefined(signature)\n ? checker.getReturnTypeOfSignature(signature)\n : undefined;\n if (!isDefined(returnType)) {\n return;\n }\n\n if (!isEnumLikeOrUndefinedType(checker, returnType)) {\n return;\n }\n\n context.report({\n messageId: \"preferEnumReturn\",\n node: node.argument,\n });\n },\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n if (node.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n let literalCount = 0;\n for (const typeNode of node.typeAnnotation.types) {\n if (\n typeNode.type === \"TSLiteralType\" &&\n typeNode.literal.type === \"Literal\" &&\n typeof typeNode.literal.value === \"string\"\n ) {\n literalCount += 1;\n }\n }\n if (\n literalCount > 1 &&\n literalCount === node.typeAnnotation.types.length\n ) {\n context.report({\n messageId: \"preferEnumUnion\",\n node,\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce enums over string literal comparisons and pure string unions.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-enum\",\n },\n hasSuggestions: false,\n messages: {\n preferEnumComparison:\n \"Use enum members instead of string literals in enum comparisons.\",\n preferEnumReturn:\n \"Return enum members instead of string literals from enum-returning functions.\",\n preferEnumUnion:\n \"Prefer an enum declaration instead of a pure string-literal union type.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-enum\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestPreferNamedTupleMembers\";\n\ntype Options = readonly [];\n\nconst isUnnamedTupleElement = (\n tupleElement: Readonly<es.TypeNode>\n): boolean => {\n if (tupleElement.type === \"TSNamedTupleMember\") {\n return false;\n }\n\n if (\n tupleElement.type === \"TSRestType\" &&\n tupleElement.typeAnnotation.type === \"TSNamedTupleMember\"\n ) {\n return false;\n }\n\n return true;\n};\n\nconst generateUniqueTupleMemberName = (\n preferredName: string,\n usedNames: Readonly<{\n readonly add: (value: string) => unknown;\n readonly has: (value: string) => boolean;\n }>\n): string => {\n if (!usedNames.has(preferredName)) {\n usedNames.add(preferredName);\n\n return preferredName;\n }\n\n let suffix = 2;\n\n while (usedNames.has(`${preferredName}_${suffix}`)) {\n suffix += 1;\n }\n\n const generatedName = `${preferredName}_${suffix}`;\n\n usedNames.add(generatedName);\n\n return generatedName;\n};\n\nconst getTupleMemberReplacementText = (\n tupleElement: Readonly<es.TypeNode>,\n memberName: string,\n sourceCode: Readonly<TSESLint.SourceCode>\n): string => {\n if (tupleElement.type === \"TSOptionalType\") {\n return `${memberName}?: ${sourceCode.getText(tupleElement.typeAnnotation)}`;\n }\n\n if (tupleElement.type === \"TSRestType\") {\n if (tupleElement.typeAnnotation.type === \"TSNamedTupleMember\") {\n return sourceCode.getText(tupleElement);\n }\n\n return `...${memberName}: ${sourceCode.getText(tupleElement.typeAnnotation)}`;\n }\n\n return `${memberName}: ${sourceCode.getText(tupleElement)}`;\n};\n\n/**\n * Prefer named tuple members for readability.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSTupleType: (node: Readonly<es.TSTupleType>): void => {\n const hasUnnamedTupleElements = node.elementTypes.some(\n (tupleElement) => isUnnamedTupleElement(tupleElement)\n );\n\n if (!hasUnnamedTupleElements) {\n return;\n }\n\n const usedNames = new Set<string>(\n node.elementTypes.flatMap((tupleElement) => {\n if (tupleElement.type !== \"TSNamedTupleMember\") {\n return [];\n }\n\n if (tupleElement.label.type !== \"Identifier\") {\n return [];\n }\n\n return [tupleElement.label.name];\n })\n );\n\n let fixesByElement: readonly Readonly<{\n readonly replacementText: string;\n readonly tupleElement: es.TypeNode;\n }>[] = [];\n\n for (const [\n index,\n tupleElement,\n ] of node.elementTypes.entries()) {\n if (!isUnnamedTupleElement(tupleElement)) {\n continue;\n }\n\n const preferredName = `item${index + 1}`;\n const memberName = generateUniqueTupleMemberName(\n preferredName,\n usedNames\n );\n const replacementText = getTupleMemberReplacementText(\n tupleElement,\n memberName,\n sourceCode\n );\n\n fixesByElement = [\n ...fixesByElement,\n { replacementText, tupleElement },\n ];\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): readonly TSESLint.RuleFix[] =>\n fixesByElement.map(({ replacementText, tupleElement }) =>\n fixer.replaceText(tupleElement, replacementText)\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestPreferNamedTupleMembers\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit names for tuple members in TypeScript tuple types.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-named-tuple-members\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Prefer named tuple members for readability and API clarity.\",\n suggestPreferNamedTupleMembers:\n \"Add generated names to unnamed tuple members.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-named-tuple-members\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestPreferReadonlyArrayParameter\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Prefer readonly array-like parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestPreferReadonlyArrayParameter\",\n },\n ],\n });\n }\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-array-parameter\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like parameter types.\",\n suggestPreferReadonlyArrayParameter:\n \"Convert this parameter type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-array-parameter\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \":not(TSTypeOperator[operator='readonly']) > :matches(TSArrayType, TSTupleType)\",\n \"TSTypeReference > Identifier[name='Array']\",\n ],\n \", \"\n);\n\n/**\n * Require readonly array and tuple type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"Identifier\" &&\n node.type !== \"TSArrayType\" &&\n node.type !== \"TSTupleType\"\n ) {\n return;\n }\n\n const fix =\n node.type === \"Identifier\"\n ? (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\")\n : (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n node,\n `readonly ${sourceCode.getText(node)}`\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly array and tuple type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-array\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly array or tuple types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-array\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSIndexSignature[readonly!=true]\";\n\n/**\n * Require readonly index signatures.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSIndexSignature\" || node.readonly) {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.insertTextBefore(node, \"readonly \"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly index signatures.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-index-signature\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly index signatures.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-index-signature\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Map']\";\n\n/**\n * Require ReadonlyMap in place of Map type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"ReadonlyMap\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require ReadonlyMap instead of Map in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-map\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly map types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-map\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAddReadonly\";\n\ntype Options = readonly [];\n\nconst selector =\n \":matches(PropertyDefinition, TSPropertySignature)[readonly!=true]\";\n\n/**\n * Require readonly modifiers on class and interface properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"PropertyDefinition\" &&\n node.type !== \"TSPropertySignature\"\n ) {\n return;\n }\n\n const keyNode = node.key;\n\n const fix =\n keyNode.type === \"Identifier\" ||\n keyNode.type === \"PrivateIdentifier\" ||\n keyNode.type === \"Literal\"\n ? (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.insertTextBefore(keyNode, \"readonly \")\n : undefined;\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(isDefined(fix)\n ? {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestAddReadonly\",\n },\n ],\n }\n : {}),\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly for class and interface properties.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-property\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly property declarations.\",\n suggestAddReadonly:\n \"Insert readonly modifier for this property declaration.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Record']\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const parent = typeReference.parent;\n\n if (parent?.type !== \"TSTypeParameterInstantiation\") {\n return false;\n }\n\n const maybeReadonlyTypeReference = parent.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\n/**\n * Require readonly wrappers around bare Record type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n const typeReference = node.parent;\n\n if (\n typeReference?.type !== \"TSTypeReference\" ||\n typeReference.typeName.type !== \"Identifier\" ||\n typeReference.typeName.name !== \"Record\" ||\n isReadonlyWrappedRecord(typeReference)\n ) {\n return;\n }\n\n context.report({\n fix: (fixer) => [\n fixer.replaceText(node, \"Readonly<Record\"),\n fixer.insertTextAfter(typeReference, \">\"),\n ],\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> instead of Record<...> in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-record\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly record types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-record\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Set']\";\n\n/**\n * Require ReadonlySet in place of Set type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"ReadonlySet\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require ReadonlySet instead of Set in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-set\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly set types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-set\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAnnotateUnknown\";\n\ntype Options = readonly [];\n\nconst selector = \"PropertyDefinition[typeAnnotation=undefined][value=null]\";\n\n/**\n * Require explicit type annotations for uninitialized class properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"PropertyDefinition\") {\n return;\n }\n\n const canProvideSafeSuggestion =\n !node.computed &&\n node.key.type === \"Identifier\" &&\n !node.optional &&\n !node.definite;\n\n const fix = canProvideSafeSuggestion\n ? (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.insertTextAfter(node.key, \": unknown\")\n : undefined;\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(isDefined(fix)\n ? {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestAnnotateUnknown\",\n },\n ],\n }\n : {}),\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit type annotations for class properties without initializers.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-prop-type-annotation\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Expecting a type annotation for this property.\",\n suggestAnnotateUnknown:\n \"Add an explicit ': unknown' type annotation.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/require-prop-type-annotation\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayPropertyType\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly array-like property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayPropertyType\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like property types.\",\n suggestRequireReadonlyArrayPropertyType:\n \"Convert this property type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayReturnType\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Require readonly array-like return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayReturnType\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like return types.\",\n suggestRequireReadonlyArrayReturnType:\n \"Convert this return type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayTypeAlias\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Require readonly array-like type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(node.typeAnnotation);\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayTypeAlias\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like type aliases.\",\n suggestRequireReadonlyArrayTypeAlias:\n \"Convert this type alias annotation to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapParameterType\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyMapParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map parameter types.\",\n suggestRequireReadonlyMapParameterType:\n \"Convert this parameter type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapPropertyType\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly map property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map property types.\",\n suggestRequireReadonlyMapPropertyType:\n \"Convert this property type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapReturnType\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly es.Identifier[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<es.Identifier>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map return types.\",\n suggestRequireReadonlyMapReturnType:\n \"Convert this return type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapTypeAlias\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map type aliases.\",\n suggestRequireReadonlyMapTypeAlias:\n \"Convert this type alias annotation to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordParameterType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyRecordParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record parameter types.\",\n suggestRequireReadonlyRecordParameterType:\n \"Convert this parameter type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordPropertyType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly record property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyRecordPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record property types.\",\n suggestRequireReadonlyRecordPropertyType:\n \"Convert this property type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordReturnType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyRecordReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record return types.\",\n suggestRequireReadonlyRecordReturnType:\n \"Convert this return type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordTypeAlias\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyRecordTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record type aliases.\",\n suggestRequireReadonlyRecordTypeAlias:\n \"Convert this type alias annotation to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetParameterType\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlySetParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set parameter types.\",\n suggestRequireReadonlySetParameterType:\n \"Convert this parameter type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetPropertyType\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly set property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set property types.\",\n suggestRequireReadonlySetPropertyType:\n \"Convert this property type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetReturnType\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly es.Identifier[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<es.Identifier>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set return types.\",\n suggestRequireReadonlySetReturnType:\n \"Convert this return type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetTypeAlias\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set type aliases.\",\n suggestRequireReadonlySetTypeAlias:\n \"Convert this type alias annotation to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAddThisVoid\";\n\ntype Options = readonly [];\n\nconst selector =\n \"MethodDefinition[static=true] > FunctionExpression:not([params.0.name='this'][params.0.typeAnnotation.typeAnnotation.type='TSVoidKeyword'])\";\n\nconst createThisVoidSuggestionFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n functionExpression: Readonly<es.FunctionExpression>\n): TSESLint.ReportFixFunction | undefined => {\n const firstParameter = arrayFirst(functionExpression.params);\n\n if (\n firstParameter?.type === \"Identifier\" &&\n firstParameter.name === \"this\"\n ) {\n const existingTypeAnnotation = firstParameter.typeAnnotation;\n\n if (existingTypeAnnotation === undefined) {\n return (fixer) => fixer.insertTextAfter(firstParameter, \": void\");\n }\n\n return (fixer) => fixer.replaceText(existingTypeAnnotation, \": void\");\n }\n\n const openingParenthesisToken =\n sourceCode.getFirstToken(functionExpression);\n if (openingParenthesisToken?.value !== \"(\") {\n return undefined;\n }\n\n return (fixer) =>\n fixer.insertTextAfter(\n openingParenthesisToken,\n firstParameter === undefined ? \"this: void\" : \"this: void, \"\n );\n};\n\n/**\n * Require static class methods to declare `this: void`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"FunctionExpression\") {\n return;\n }\n\n const suggestionFix = createThisVoidSuggestionFix(\n sourceCode,\n node\n );\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(suggestionFix === undefined\n ? {}\n : {\n fix: suggestionFix,\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestAddThisVoid\",\n },\n ],\n }),\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require static class methods to declare `this: void`.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-this-void\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: 'Add \"this: void\" to static method signatures.',\n suggestAddThisVoid: 'Insert \"this: void\" parameter in signature.',\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/require-this-void\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\nconst internalTagPattern = /@internal\\b/u;\n\nconst isNonUnderscoreIdentifier = (\n identifier: Readonly<es.Identifier>\n): boolean => !identifier.name.startsWith(\"_\");\n\nconst isExportDeclaration = (\n node: null | Readonly<es.Node> | undefined\n): node is es.ExportDefaultDeclaration | es.ExportNamedDeclaration =>\n node?.type === \"ExportDefaultDeclaration\" ||\n node?.type === \"ExportNamedDeclaration\";\n\n/**\n * Enforce underscore prefixes for declarations marked with `@internal`.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n const hasInternalTag = (node: Readonly<es.Node>): boolean => {\n let commentTargets: readonly es.Node[] = [node];\n if (isExportDeclaration(node.parent)) {\n commentTargets = [...commentTargets, node.parent];\n }\n\n return commentTargets.some((commentTarget) =>\n context.sourceCode\n .getCommentsBefore(commentTarget)\n .some((comment) =>\n internalTagPattern.test(comment.value)\n )\n );\n };\n\n const reportIfInternal = (\n nameIdentifier: Readonly<es.Identifier>,\n commentTarget: Readonly<es.Node>\n ): void => {\n if (!isNonUnderscoreIdentifier(nameIdentifier)) {\n return;\n }\n\n if (!hasInternalTag(commentTarget)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: nameIdentifier,\n });\n };\n\n return {\n \"ClassDeclaration[id.type='Identifier']\": (\n node: Readonly<es.ClassDeclaration>\n ) => {\n if (node.id === null) {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"FunctionDeclaration[id.type='Identifier']\": (\n node: Readonly<es.FunctionDeclaration>\n ) => {\n if (node.id === null) {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"MethodDefinition[key.type='Identifier']\": (\n node: Readonly<es.MethodDefinition>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"PropertyDefinition[key.type='Identifier']\": (\n node: Readonly<es.PropertyDefinition>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSEnumDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSEnumDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"TSEnumMember[id.type='Identifier']\": (\n node: Readonly<es.TSEnumMember>\n ) => {\n if (node.id.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"TSInterfaceDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSInterfaceDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"TSMethodSignature[key.type='Identifier']\": (\n node: Readonly<es.TSMethodSignature>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSPropertySignature[key.type='Identifier']\": (\n node: Readonly<es.TSPropertySignature>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSTypeAliasDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSTypeAliasDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"VariableDeclarator[id.type='Identifier']\": (\n node: Readonly<es.VariableDeclarator>\n ) => {\n if (node.id.type !== \"Identifier\") {\n return;\n }\n\n const declaration = node.parent;\n if (declaration?.type !== \"VariableDeclaration\") {\n return;\n }\n\n reportIfInternal(node.id, declaration);\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow internal APIs that are not prefixed with underscores.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/underscore-internal\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Internal APIs not prefixed with underscores are forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"underscore-internal\",\n });\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `unicorn/no-unused-properties`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"no-unused-properties\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/unused-internal-properties\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/no-unused-properties.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"no-unused-properties\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md\",\n },\n }),\n ],\n ruleId: \"unused-internal-properties\",\n});\n\nexport default deprecatedRule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `unicorn/no-unreadable-iife`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"no-unreadable-iife\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/uppercase-iife\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/no-unreadable-iife.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"no-unreadable-iife\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md\",\n },\n }),\n ],\n ruleId: \"uppercase-iife\",\n});\n\nexport default deprecatedRule;\n", "import writeGoodCommentsPlugin from \"eslint-plugin-write-good-comments-2\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `write-good-comments/write-good-comments`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n writeGoodCommentsPlugin,\n \"write-good-comments\",\n \"eslint-plugin-write-good-comments-2\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/words\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of write-good-comments/write-good-comments.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"write-good-comments\",\n url: \"https://github.com/Nick2bad4u/eslint-plugin-write-good-comments-2\",\n },\n rule: {\n name: \"write-good-comments\",\n url: \"https://github.com/Nick2bad4u/eslint-plugin-write-good-comments-2\",\n },\n }),\n ],\n ruleId: \"words\",\n});\n\nexport default deprecatedRule;\n", "/* eslint-disable canonical/no-reassign-imports -- Rule entry map intentionally references imported plugin rules object. */\n\nimport { objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\n\ntype AllConfig = {\n readonly name: \"etc-misc/all\";\n readonly rules: Readonly<Record<string, RuleSeverity>>;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst getAllPresetSeverity = (\n ruleModule: Readonly<(typeof pluginRules)[string]>\n): RuleSeverity => {\n if (ruleModule.meta.deprecated !== false) {\n return \"warn\";\n }\n\n return ruleModule.meta.type === \"problem\" ? \"error\" : \"warn\";\n};\n\nconst allRuleEntries = objectEntries(pluginRules).map(\n ([ruleName, ruleModule]) =>\n [`etc-misc/${ruleName}`, getAllPresetSeverity(ruleModule)] as const\n);\n\nconst allRules = objectFromEntries(allRuleEntries) as Readonly<\n Record<string, RuleSeverity>\n>;\n\n/**\n * Flat config preset enabling every available plugin rule.\n */\nexport const all: AllConfig = {\n name: \"etc-misc/all\",\n rules: allRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "/**\n * Minimal starter preset: `recommended` without the `prefer-readonly*` rules.\n */\nexport const minimal = {\n name: \"etc-misc/minimal\",\n rules: {\n \"etc-misc/consistent-optional-props\": \"warn\",\n \"etc-misc/no-assign-mutated-array\": \"error\",\n \"etc-misc/no-const-enum\": \"warn\",\n \"etc-misc/no-function-declare-after-return\": \"warn\",\n \"etc-misc/no-implicit-any-catch\": \"error\",\n \"etc-misc/no-internal\": \"error\",\n \"etc-misc/no-t\": \"error\",\n \"etc-misc/no-unnecessary-as-const\": \"warn\",\n \"etc-misc/no-unnecessary-break\": \"warn\",\n \"etc-misc/no-unnecessary-initialization\": \"warn\",\n \"etc-misc/no-unnecessary-template-literal\": \"warn\",\n \"etc-misc/no-vulnerable\": \"error\",\n \"etc-misc/throw-error\": \"error\",\n \"etc-misc/typescript/no-boolean-literal-type\": \"error\",\n \"etc-misc/typescript/require-readonly-array-return-type\": \"warn\",\n \"etc-misc/typescript/require-this-void\": \"warn\",\n },\n} as const;\n", "/**\n * Opinionated starter preset for the plugin.\n */\nexport const recommended = {\n name: \"etc-misc/recommended\",\n rules: {\n \"etc-misc/consistent-optional-props\": \"warn\",\n \"etc-misc/no-assign-mutated-array\": \"error\",\n \"etc-misc/no-const-enum\": \"warn\",\n \"etc-misc/no-function-declare-after-return\": \"warn\",\n \"etc-misc/no-implicit-any-catch\": \"error\",\n \"etc-misc/no-internal\": \"error\",\n \"etc-misc/no-t\": \"error\",\n \"etc-misc/no-unnecessary-as-const\": \"warn\",\n \"etc-misc/no-unnecessary-break\": \"warn\",\n \"etc-misc/no-unnecessary-initialization\": \"warn\",\n \"etc-misc/no-unnecessary-template-literal\": \"warn\",\n \"etc-misc/no-vulnerable\": \"error\",\n \"etc-misc/throw-error\": \"error\",\n \"etc-misc/typescript/no-boolean-literal-type\": \"error\",\n \"etc-misc/typescript/prefer-readonly-array\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-array-parameter\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-index-signature\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-map\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-property\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-record\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-set\": \"warn\",\n \"etc-misc/typescript/require-readonly-array-return-type\": \"warn\",\n \"etc-misc/typescript/require-this-void\": \"warn\",\n },\n} as const;\n", "/* eslint-disable canonical/no-reassign-imports -- Flat-config strict type-checked preset intentionally inspects imported plugin rule metadata. */\n\nimport { keyIn, objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\nimport { strict } from \"./strict.js\";\n\ntype RuleDocsMetadata = Readonly<{\n readonly requiresTypeChecking?: boolean;\n}>;\n\ntype StrictTypeCheckedConfig = {\n readonly languageOptions: Readonly<{\n readonly parserOptions: Readonly<{\n readonly projectService: true;\n }>;\n }>;\n readonly name: \"etc-misc/strict-type-checked\";\n readonly rules: Readonly<Record<string, \"error\">>;\n};\n\nconst additionalTypeCheckedRuleEntries: readonly (readonly [\n string,\n \"error\",\n])[] = objectEntries(pluginRules).flatMap(([ruleName, ruleModule]) => {\n if (ruleModule.meta.deprecated !== false) {\n return [];\n }\n\n const docsMetadata = ruleModule.meta.docs as RuleDocsMetadata | undefined;\n\n if (docsMetadata?.requiresTypeChecking !== true) {\n return [];\n }\n\n const qualifiedRuleName = `etc-misc/${ruleName}`;\n\n if (keyIn(strict.rules, qualifiedRuleName)) {\n return [];\n }\n\n return [[qualifiedRuleName, \"error\"] as const];\n});\n\nconst strictTypeCheckedRules = {\n ...strict.rules,\n ...objectFromEntries(additionalTypeCheckedRuleEntries),\n} satisfies Readonly<Record<string, \"error\">>;\n\n/**\n * Strict preset augmented with every non-deprecated rule that requires type\n * information.\n */\nexport const strictTypeChecked: StrictTypeCheckedConfig = {\n languageOptions: {\n parserOptions: {\n projectService: true,\n },\n },\n name: \"etc-misc/strict-type-checked\",\n rules: strictTypeCheckedRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "import { objectFromEntries, objectKeys, safeCastTo } from \"ts-extras\";\n\nimport { recommended } from \"./recommended.js\";\n\ntype StrictConfig = {\n readonly name: \"etc-misc/strict\";\n readonly rules: StrictRules;\n};\n\ntype StrictRules = Readonly<{\n readonly [TRuleName in keyof typeof recommended.rules]: \"error\";\n}>;\n\nconst recommendedRuleNames = safeCastTo<\n readonly (keyof typeof recommended.rules)[]\n>(objectKeys(recommended.rules));\n\nconst strictRules = objectFromEntries(\n recommendedRuleNames.map((ruleName) => [ruleName, \"error\"] as const)\n) as StrictRules;\n\n/**\n * Strict preset that promotes every recommended rule to `error`.\n */\nexport const strict: StrictConfig = {\n name: \"etc-misc/strict\",\n rules: strictRules,\n};\n", "/* eslint-disable canonical/no-reassign-imports -- Flat-config preset object intentionally references imported preset modules. */\n\nimport { pluginMeta } from \"./_internal/plugin-meta.js\";\nimport { allStrict as allStrictConfig } from \"./configs/all-strict.js\";\nimport { all as allConfig } from \"./configs/all.js\";\nimport { minimal as minimalConfig } from \"./configs/minimal.js\";\nimport { recommended as recommendedConfig } from \"./configs/recommended.js\";\nimport { strictTypeChecked as strictTypeCheckedConfig } from \"./configs/strict-type-checked.js\";\nimport { strict as strictConfig } from \"./configs/strict.js\";\nimport { rules } from \"./rules.js\";\n\ntype PluginReference = {\n readonly meta: typeof pluginMeta;\n readonly rules: typeof rules;\n};\n\ntype PresetWithPlugin<\n TName extends string,\n TRules extends Readonly<Record<string, RuleSeverity>>,\n> = {\n readonly name: TName;\n readonly plugins: Readonly<\n Record<typeof pluginMeta.namespace, PluginReference>\n >;\n readonly rules: TRules;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst pluginReference: PluginReference = {\n meta: pluginMeta,\n rules,\n};\n\nconst withPluginReference = <\n TName extends string,\n TRules extends Readonly<Record<string, RuleSeverity>>,\n>(\n config: Readonly<{ readonly name: TName; readonly rules: TRules }>\n): PresetWithPlugin<TName, TRules> => ({\n name: config.name,\n plugins: {\n [pluginMeta.namespace]: pluginReference,\n },\n rules: config.rules,\n});\n\n/**\n * Available flat-config presets exported by the plugin.\n */\nexport type PluginConfigs = {\n readonly all: PresetWithPlugin<\n typeof allConfig.name,\n typeof allConfig.rules\n >;\n readonly allStrict: PresetWithPlugin<\n typeof allStrictConfig.name,\n typeof allStrictConfig.rules\n >;\n readonly minimal: PresetWithPlugin<\n typeof minimalConfig.name,\n typeof minimalConfig.rules\n >;\n readonly recommended: PresetWithPlugin<\n typeof recommendedConfig.name,\n typeof recommendedConfig.rules\n >;\n readonly strict: PresetWithPlugin<\n typeof strictConfig.name,\n typeof strictConfig.rules\n >;\n readonly strictTypeChecked: PresetWithPlugin<\n typeof strictTypeCheckedConfig.name,\n typeof strictTypeCheckedConfig.rules\n > & {\n readonly languageOptions: typeof strictTypeCheckedConfig.languageOptions;\n };\n};\n\n/**\n * Plugin configuration presets.\n */\nexport const configs: PluginConfigs = {\n all: withPluginReference(allConfig),\n allStrict: withPluginReference(allStrictConfig),\n minimal: withPluginReference(minimalConfig),\n recommended: withPluginReference(recommendedConfig),\n strict: withPluginReference(strictConfig),\n strictTypeChecked: {\n ...withPluginReference(strictTypeCheckedConfig),\n languageOptions: strictTypeCheckedConfig.languageOptions,\n },\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions outside this intentional assembly block. */\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACGO,IAAM,aAAa;EACtB,MAAM;EACN,WAAW;EACX,SAAS;;;;ACJb,IAAAA,qBAAiD;;;ACCjD,IAAAC,qBAA8D;;;ACiB9D,IAAM,uBAAuB,CAAC,iBAC1B,GAAG,YAAY,GAAG,SAAS,GAAG,GAAG;AAK9B,IAAM,kBAAkB,CAAC,iBAC5B,IAAI,qBAAqB,YAAY,CAAC;AAKnC,IAAM,cAAc,CAAC,aACxB,SAAS,WAAW,KAAK,GAAG;AAKzB,IAAM,6BAA6B,CACtC,cACA,kBACQ;AACR,QAAM,uBAAuB,aAAa,WAAW,aAAa;AAClE,QAAM,wBAAwB,cAAc,WAAW,aAAa;AAEpE,MAAI,yBAAyB,uBAAuB;AAChD,WAAO,uBAAuB,IAAI;EACtC;AAEA,SAAO,aAAa,cAAc,aAAa;AAC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AI,0BAAM,OAAO,OAAO,iBAAiB,GAAG;AACxC,WAAO,CAAA;EACX;AAEA,SAAO,CAAC,CAAC,mBAAmB,OAAO,CAAU;AACjD,CAAC;AAED,IAAM,yBAAyB;EAC3B,GAAG,OAAO;EACV,OAAG,sCAAkB,gCAAgC;;AAOlD,IAAM,oBAA6C;EACtD,iBAAiB;IACb,eAAe;MACX,gBAAgB;;;EAGxB,MAAM;EACN,OAAO;;;;AE/BX,IAAM,kBAAmC;EACrC,MAAM;EACN;;AAGJ,IAAM,sBAAsB,CAIxB,YACmC;EACnC,MAAM,OAAO;EACb,SAAS;IACL,CAAC,WAAW,SAAS,GAAG;;EAE5B,OAAO,OAAO;;AAsCX,IAAM,UAAyB;EAClC,KAAK,oBAAoB,GAAS;EAClC,WAAW,oBAAoB,SAAe;EAC9C,SAAS,oBAAoB,OAAa;EAC1C,aAAa,oBAAoB,WAAiB;EAClD,QAAQ,oBAAoB,MAAY;EACxC,mBAAmB;IACf,GAAG,oBAAoB,iBAAuB;IAC9C,iBAAiB,kBAAwB;;;;;A1J5EjD,IAAM,SAAuB;EACzB;EACA,MAAM;EACN,YAAY,CAAA;EACZ;;AAGJ,IAAA,iBAAe;",
|
|
6
|
-
"names": ["import_ts_extras", "import_ts_extras", "plugin", "rules", "externalRule", "import_ts_extras", "rule", "tsEslintPlugin", "rule", "import_ts_extras", "rule", "import_ts_extras", "isEmpty", "rule", "rule", "import_ts_extras", "import_ts_extras", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "rule", "import_ts_extras", "selector", "rule", "rule", "deprecatedRule", "disallowedSelector", "rule", "import_ts_extras", "rule", "import_ts_extras", "rule", "import_node_path", "import_ts_extras", "rule", "exports", "import_node_path", "import_ts_extras", "selector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_utils", "import_ts_extras", "rule", "rule", "rule", "disallowedSelector", "rule", "import_ts_extras", "parser", "rule", "deprecatedRule", "import_ts_extras", "defaultOptions", "rule", "import_utils", "import_ts_extras", "import_ts_extras", "import_type_utils", "import_ts_extras", "normalized", "matchesAnyPattern", "defaultOptions", "rule", "matchesAnyPattern", "deprecatedRule", "rule", "import_ts_extras", "splitLines", "rule", "import_type_utils", "import_utils", "import_ts_extras", "defaultOptions", "rule", "import_ts_extras", "rule", "import_type_utils", "import_utils", "import_ts_extras", "defaultOptions", "rule", "rule", "rule", "import_utils", "import_ts_extras", "defaultOptions", "rule", "matchesAnyPattern", "import_ts_extras", "disallowedSelector", "rule", "import_utils", "import_ts_extras", "rule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_ts_extras", "rule", "rule", "import_ts_extras", "rule", "rule", "deprecatedRule", "import_ts_extras", "import_ts_extras", "selector", "rule", "selector", "deprecatedRule", "rule", "noSecretsPlugin", "deprecatedRule", "import_node_path", "import_ts_extras", "rule", "deprecatedRule", "rule", "deprecatedRule", "rule", "commentText", "rule", "defaultOptions", "rule", "import_ts_extras", "disallowedSelector", "rule", "disallowedSelector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_ts_extras", "selector", "rule", "rule", "eslintCommentsPlugin", "deprecatedRule", "import_ts_extras", "rule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_ts_extras", "rule", "externalRule", "rule", "rule", "import_ts_extras", "rule", "disallowedSelector", "rule", "disallowedSelector", "rule", "rule", "unicornPlugin", "deprecatedRule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "defaultOptions", "rule", "deprecatedRule", "rule", "externalRule", "rule", "deprecatedRule", "selector", "rule", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "rule", "selector", "disallowedSelector", "rule", "import_ts_extras", "buildFix", "rule", "disallowedSelector", "rule", "import_ts_extras", "rule", "deprecatedRule", "disallowedSelector", "rule", "import_ts_extras", "buildFix", "rule", "import_ts_extras", "buildFix", "rule", "import_ts_extras", "rule", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "buildFix", "rule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "rule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "import_type_utils", "import_utils", "import_ts_extras", "readonlyArrayTypeNames", "isArrayLikeType", "rule", "import_ts_extras", "rule", "deprecatedRule", "selector", "rule", "selector", "rule", "selector", "rule", "deprecatedRule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "selector", "rule", "deprecatedRule", "import_ts_extras", "selector", "rule", "deprecatedRule", "selector", "rule", "import_type_utils", "import_utils", "rule", "import_ts_extras", "unwrapExpression", "rule", "import_ts_extras", "unwrapExpression", "isDefinitelyDefinedExpression", "buildFixedTypeText", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "selector", "buildFixedTypeText", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "hasDefinitelyDefinedReturnValue", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "isNeverReassigned", "rule", "deprecatedRule", "import_type_utils", "import_utils", "tsutils", "rule", "rule", "selector", "rule", "selector", "rule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "ts", "rule", "memberName", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "rule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "import_ts_extras", "selector", "rule", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "functionLikeNodeSelector", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "rule", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "rule", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "isReadonlyWrappedRecord", "rule", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "rule", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "rule", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "rule", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "rule", "import_ts_extras", "selector", "rule", "rule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "rule", "writeGoodCommentsPlugin", "deprecatedRule", "import_ts_extras", "import_ts_extras", "import_ts_extras", "recommendedRuleNames"]
|
|
4
|
+
"sourcesContent": ["import { pluginMeta, type PluginMeta } from \"./_internal/plugin-meta.js\";\nimport { configs } from \"./configs.js\";\nimport { rules } from \"./rules.js\";\n\ntype PluginModule = {\n readonly configs: typeof configs;\n readonly meta: PluginMeta;\n readonly processors: Readonly<Record<string, never>>;\n readonly rules: typeof rules;\n};\n\n/**\n * ESLint plugin module export.\n */\nconst plugin: PluginModule = {\n configs,\n meta: pluginMeta,\n processors: {},\n rules,\n};\n\nexport default plugin;\n", "/**\n * Immutable metadata describing this ESLint plugin package.\n */\nexport const pluginMeta = {\n name: \"eslint-plugin-etc-misc\",\n namespace: \"etc-misc\",\n version: \"1.0.0\",\n} as const;\n\n/**\n * Static type representation of {@link pluginMeta}.\n */\nexport type PluginMeta = typeof pluginMeta;\n", "/* eslint-disable canonical/no-reassign-imports -- Rule entry map intentionally references imported plugin rules metadata. */\n\nimport { objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\n\ntype AllStrictConfig = {\n readonly name: \"etc-misc/all-strict\";\n readonly rules: Readonly<Record<string, RuleSeverity>>;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst allStrictRuleEntries = objectEntries(pluginRules).map(\n ([ruleName, ruleModule]) =>\n [\n `etc-misc/${ruleName}`,\n ruleModule.meta.deprecated === false ? \"error\" : \"warn\",\n ] as const\n);\n\nconst allStrictRules = objectFromEntries(allStrictRuleEntries) as Readonly<\n Record<string, RuleSeverity>\n>;\n\n/**\n * Flat config preset enabling every plugin rule at `error`, except deprecated\n * rules which remain at `warn`.\n */\nexport const allStrict: AllStrictConfig = {\n name: \"etc-misc/all-strict\",\n rules: allStrictRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { objectEntries, objectKeys, safeCastTo, setHas } from \"ts-extras\";\n\nimport type { RuleCatalogEntry } from \"./_internal/rule-catalog.js\";\n\nimport { buildRuleCatalog } from \"./_internal/rule-catalog.js\";\nimport arrayType from \"./rules/array-type.js\";\nimport matchFilenameRule from \"./rules/class-match-filename.js\";\nimport commentSpacing from \"./rules/comment-spacing.js\";\nimport consistentEmptyLines from \"./rules/consistent-empty-lines.js\";\nimport consistentEnumMembers from \"./rules/consistent-enum-members.js\";\nimport consistentFilename from \"./rules/consistent-filename.js\";\nimport consistentImport from \"./rules/consistent-import.js\";\nimport consistentOptionalProps from \"./rules/consistent-optional-props.js\";\nimport consistentSourceExtension from \"./rules/consistent-source-extension.js\";\nimport consistentSymbolDescription from \"./rules/consistent-symbol-description.js\";\nimport defaultCase from \"./rules/default-case.js\";\nimport disallowImport from \"./rules/disallow-import.js\";\nimport exportMatchingFilenameOnly from \"./rules/export-matching-filename-only.js\";\nimport matchFilename from \"./rules/match-filename.js\";\nimport maxIdentifierBlocks from \"./rules/max-identifier-blocks.js\";\nimport noAssignMutatedArray from \"./rules/no-assign-mutated-array.js\";\nimport noAtSignImport from \"./rules/no-at-sign-import.js\";\nimport noAtSignInternalImport from \"./rules/no-at-sign-internal-import.js\";\nimport noChainCoalescenceMixture from \"./rules/no-chain-coalescence-mixture.js\";\nimport noCommentedOutCode from \"./rules/no-commented-out-code.js\";\nimport noConstEnum from \"./rules/no-const-enum.js\";\nimport noDeprecated from \"./rules/no-deprecated.js\";\nimport noEnum from \"./rules/no-enum.js\";\nimport noExpressionEmptyLines from \"./rules/no-expression-empty-lines.js\";\nimport noForeach from \"./rules/no-foreach.js\";\nimport noFunctionDeclareAfterReturn from \"./rules/no-function-declare-after-return.js\";\nimport noImplicitAnyCatch from \"./rules/no-implicit-any-catch.js\";\nimport noIndexImport from \"./rules/no-index-import.js\";\nimport noInternalModules from \"./rules/no-internal-modules.js\";\nimport noInternal from \"./rules/no-internal.js\";\nimport noLanguageMixing from \"./rules/no-language-mixing.js\";\nimport noMisusedGenerics from \"./rules/no-misused-generics.js\";\nimport noMixedEnums from \"./rules/no-mixed-enums.js\";\nimport noNegatedConditions from \"./rules/no-negated-conditions.js\";\nimport noNodejsModules from \"./rules/no-nodejs-modules.js\";\nimport noParamReassign from \"./rules/no-param-reassign.js\";\nimport noRelativeParentImport from \"./rules/no-relative-parent-import.js\";\nimport noRestrictedSyntax from \"./rules/no-restricted-syntax.js\";\nimport noSecret from \"./rules/no-secret.js\";\nimport noSelfImport from \"./rules/no-self-import.js\";\nimport noShadow from \"./rules/no-shadow.js\";\nimport noSiblingImport from \"./rules/no-sibling-import.js\";\nimport noSingleLineComment from \"./rules/no-single-line-comment.js\";\nimport noT from \"./rules/no-t.js\";\nimport noUnderscoreExport from \"./rules/no-underscore-export.js\";\nimport noUnnecessaryAsConst from \"./rules/no-unnecessary-as-const.js\";\nimport noUnnecessaryBreak from \"./rules/no-unnecessary-break.js\";\nimport noUnnecessaryInitialization from \"./rules/no-unnecessary-initialization.js\";\nimport noUnnecessaryTemplateLiteral from \"./rules/no-unnecessary-template-literal.js\";\nimport noUnusedDisable from \"./rules/no-unused-disable.js\";\nimport noUseExtendNative from \"./rules/no-use-extend-native.js\";\nimport noUselessGenerics from \"./rules/no-useless-generics.js\";\nimport noValueToString from \"./rules/no-value-tostring.js\";\nimport noVulnerable from \"./rules/no-vulnerable.js\";\nimport noWriteonly from \"./rules/no-writeonly.js\";\nimport objectFormat from \"./rules/object-format.js\";\nimport onlyExportName from \"./rules/only-export-name.js\";\nimport preferArrowFunctionProperty from \"./rules/prefer-arrow-function-property.js\";\nimport preferConstRequire from \"./rules/prefer-const-require.js\";\nimport preferIncludes from \"./rules/prefer-includes.js\";\nimport preferInterface from \"./rules/prefer-interface.js\";\nimport preferLessThan from \"./rules/prefer-less-than.js\";\nimport preferObjectHasOwn from \"./rules/prefer-object-has-own.js\";\nimport preferOnlyExport from \"./rules/prefer-only-export.js\";\nimport requireJSDoc from \"./rules/require-jsdoc.js\";\nimport requireSyntax from \"./rules/require-syntax.js\";\nimport restrictIdentifierCharacters from \"./rules/restrict-identifier-characters.js\";\nimport sortArray from \"./rules/sort-array.js\";\nimport sortCallSignature from \"./rules/sort-call-signature.js\";\nimport sortClassMembers from \"./rules/sort-class-members.js\";\nimport sortConstructSignature from \"./rules/sort-construct-signature.js\";\nimport sortExportSpecifiers from \"./rules/sort-export-specifiers.js\";\nimport sortKeys from \"./rules/sort-keys.js\";\nimport sortTopComments from \"./rules/sort-top-comments.js\";\nimport switchCaseSpacing from \"./rules/switch-case-spacing.js\";\nimport templateLiteralFormat from \"./rules/template-literal-format.js\";\nimport throwError from \"./rules/throw-error.js\";\nimport throwNewError from \"./rules/throw-new-error.js\";\nimport typescriptArrayCallbackReturnType from \"./rules/typescript-array-callback-return-type.js\";\nimport typescriptClassMethodsUseThis from \"./rules/typescript-class-methods-use-this.js\";\nimport typescriptConsistentArrayTypeName from \"./rules/typescript-consistent-array-type-name.js\";\nimport typescriptDefineFunctionInOneStatement from \"./rules/typescript-define-function-in-one-statement.js\";\nimport typescriptExhaustiveSwitch from \"./rules/typescript-exhaustive-switch.js\";\nimport typescriptNoBooleanLiteralType from \"./rules/typescript-no-boolean-literal-type.js\";\nimport typescriptNoComplexDeclaratorType from \"./rules/typescript-no-complex-declarator-type.js\";\nimport typescriptNoComplexReturnType from \"./rules/typescript-no-complex-return-type.js\";\nimport typescriptNoEmptyInterfaces from \"./rules/typescript-no-empty-interfaces.js\";\nimport typescriptNoInferrableTypes from \"./rules/typescript-no-inferrable-types.js\";\nimport typescriptNoMultiTypeTuples from \"./rules/typescript-no-multi-type-tuples.js\";\nimport typescriptNoNever from \"./rules/typescript-no-never.js\";\nimport typescriptNoRedundantUndefinedConst from \"./rules/typescript-no-redundant-undefined-const.js\";\nimport typescriptNoRedundantUndefinedDefaultParameter from \"./rules/typescript-no-redundant-undefined-default-parameter.js\";\nimport typescriptNoRedundantUndefinedLet from \"./rules/typescript-no-redundant-undefined-let.js\";\nimport typescriptNoRedundantUndefinedOptional from \"./rules/typescript-no-redundant-undefined-optional.js\";\nimport typescriptNoRedundantUndefinedPromiseReturnType from \"./rules/typescript-no-redundant-undefined-promise-return-type.js\";\nimport typescriptNoRedundantUndefinedReadonlyProperty from \"./rules/typescript-no-redundant-undefined-readonly-property.js\";\nimport typescriptNoRedundantUndefinedReturnType from \"./rules/typescript-no-redundant-undefined-return-type.js\";\nimport typescriptNoRedundantUndefinedVar from \"./rules/typescript-no-redundant-undefined-var.js\";\nimport typescriptNoRestrictedSyntax from \"./rules/typescript-no-restricted-syntax.js\";\nimport typescriptNoUnsafeObjectAssign from \"./rules/typescript-no-unsafe-object-assign.js\";\nimport typescriptNoUnsafeObjectAssignment from \"./rules/typescript-no-unsafe-object-assignment.js\";\nimport typescriptPreferArrayTypeAlias from \"./rules/typescript-prefer-array-type-alias.js\";\nimport typescriptPreferClassMethod from \"./rules/typescript-prefer-class-method.js\";\nimport typescriptPreferEnum from \"./rules/typescript-prefer-enum.js\";\nimport typescriptPreferNamedTupleMembers from \"./rules/typescript-prefer-named-tuple-members.js\";\nimport typescriptPreferReadonlyArrayParameter from \"./rules/typescript-prefer-readonly-array-parameter.js\";\nimport typescriptPreferReadonlyArray from \"./rules/typescript-prefer-readonly-array.js\";\nimport typescriptPreferReadonlyIndexSignature from \"./rules/typescript-prefer-readonly-index-signature.js\";\nimport typescriptPreferReadonlyMap from \"./rules/typescript-prefer-readonly-map.js\";\nimport typescriptPreferReadonlyProperty from \"./rules/typescript-prefer-readonly-property.js\";\nimport typescriptPreferReadonlyRecord from \"./rules/typescript-prefer-readonly-record.js\";\nimport typescriptPreferReadonlySet from \"./rules/typescript-prefer-readonly-set.js\";\nimport typescriptRequirePropTypeAnnotation from \"./rules/typescript-require-prop-type-annotation.js\";\nimport typescriptRequireReadonlyArrayPropertyType from \"./rules/typescript-require-readonly-array-property-type.js\";\nimport typescriptRequireReadonlyArrayReturnType from \"./rules/typescript-require-readonly-array-return-type.js\";\nimport typescriptRequireReadonlyArrayTypeAlias from \"./rules/typescript-require-readonly-array-type-alias.js\";\nimport typescriptRequireReadonlyMapParameterType from \"./rules/typescript-require-readonly-map-parameter-type.js\";\nimport typescriptRequireReadonlyMapPropertyType from \"./rules/typescript-require-readonly-map-property-type.js\";\nimport typescriptRequireReadonlyMapReturnType from \"./rules/typescript-require-readonly-map-return-type.js\";\nimport typescriptRequireReadonlyMapTypeAlias from \"./rules/typescript-require-readonly-map-type-alias.js\";\nimport typescriptRequireReadonlyRecordParameterType from \"./rules/typescript-require-readonly-record-parameter-type.js\";\nimport typescriptRequireReadonlyRecordPropertyType from \"./rules/typescript-require-readonly-record-property-type.js\";\nimport typescriptRequireReadonlyRecordReturnType from \"./rules/typescript-require-readonly-record-return-type.js\";\nimport typescriptRequireReadonlyRecordTypeAlias from \"./rules/typescript-require-readonly-record-type-alias.js\";\nimport typescriptRequireReadonlySetParameterType from \"./rules/typescript-require-readonly-set-parameter-type.js\";\nimport typescriptRequireReadonlySetPropertyType from \"./rules/typescript-require-readonly-set-property-type.js\";\nimport typescriptRequireReadonlySetReturnType from \"./rules/typescript-require-readonly-set-return-type.js\";\nimport typescriptRequireReadonlySetTypeAlias from \"./rules/typescript-require-readonly-set-type-alias.js\";\nimport typescriptRequireThisVoid from \"./rules/typescript-require-this-void.js\";\nimport underscoreInternal from \"./rules/underscore-internal.js\";\nimport unusedInternalProperties from \"./rules/unused-internal-properties.js\";\nimport uppercaseIife from \"./rules/uppercase-iife.js\";\nimport words from \"./rules/words.js\";\n\ntype RuleDocsMetadata = {\n readonly catalogId?: string;\n readonly catalogIndex?: number;\n readonly deprecated?: boolean;\n readonly description?: string;\n readonly frozen?: boolean;\n readonly recommended?: boolean;\n readonly requiresTypeChecking?: boolean;\n readonly ruleName?: string;\n readonly suggestion?: boolean;\n readonly url?: string;\n};\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst rulesWithRequiredTypeChecking = new Set<string>([\n \"no-assign-mutated-array\",\n \"no-deprecated\",\n \"no-foreach\",\n \"no-implicit-any-catch\",\n \"no-internal\",\n \"no-misused-generics\",\n \"throw-error\",\n \"typescript/array-callback-return-type\",\n \"typescript/no-never\",\n \"typescript/no-unsafe-object-assign\",\n \"typescript/prefer-enum\",\n]);\n\nconst recommendedRuleNames = new Set<string>([\n \"consistent-optional-props\",\n \"no-assign-mutated-array\",\n \"no-const-enum\",\n \"no-function-declare-after-return\",\n \"no-implicit-any-catch\",\n \"no-internal\",\n \"no-t\",\n \"no-unnecessary-as-const\",\n \"no-unnecessary-break\",\n \"no-unnecessary-initialization\",\n \"no-unnecessary-template-literal\",\n \"no-vulnerable\",\n \"throw-error\",\n \"typescript/no-boolean-literal-type\",\n \"typescript/prefer-readonly-array\",\n \"typescript/prefer-readonly-array-parameter\",\n \"typescript/prefer-readonly-index-signature\",\n \"typescript/prefer-readonly-map\",\n \"typescript/prefer-readonly-property\",\n \"typescript/prefer-readonly-record\",\n \"typescript/prefer-readonly-set\",\n \"typescript/require-readonly-array-return-type\",\n \"typescript/require-this-void\",\n]);\n\n/**\n * Rule implementations keyed by rule name.\n */\nconst baseRules: Readonly<Record<string, RuleModule>> = {\n \"array-type\": arrayType,\n \"class-match-filename\": matchFilenameRule,\n \"comment-spacing\": commentSpacing,\n \"consistent-empty-lines\": consistentEmptyLines,\n \"consistent-enum-members\": consistentEnumMembers,\n \"consistent-filename\": consistentFilename,\n \"consistent-import\": consistentImport,\n \"consistent-optional-props\": consistentOptionalProps,\n \"consistent-source-extension\": consistentSourceExtension,\n \"consistent-symbol-description\": consistentSymbolDescription,\n \"default-case\": defaultCase,\n \"disallow-import\": disallowImport,\n \"export-matching-filename-only\": exportMatchingFilenameOnly,\n \"match-filename\": matchFilename,\n \"max-identifier-blocks\": maxIdentifierBlocks,\n \"no-assign-mutated-array\": noAssignMutatedArray,\n \"no-at-sign-import\": noAtSignImport,\n \"no-at-sign-internal-import\": noAtSignInternalImport,\n \"no-chain-coalescence-mixture\": noChainCoalescenceMixture,\n \"no-commented-out-code\": noCommentedOutCode,\n \"no-const-enum\": noConstEnum,\n \"no-deprecated\": noDeprecated,\n \"no-enum\": noEnum,\n \"no-expression-empty-lines\": noExpressionEmptyLines,\n \"no-foreach\": noForeach,\n \"no-function-declare-after-return\": noFunctionDeclareAfterReturn,\n \"no-implicit-any-catch\": noImplicitAnyCatch,\n \"no-index-import\": noIndexImport,\n \"no-internal\": noInternal,\n \"no-internal-modules\": noInternalModules,\n \"no-language-mixing\": noLanguageMixing,\n \"no-misused-generics\": noMisusedGenerics,\n \"no-mixed-enums\": noMixedEnums,\n \"no-negated-conditions\": noNegatedConditions,\n \"no-nodejs-modules\": noNodejsModules,\n \"no-param-reassign\": noParamReassign,\n \"no-relative-parent-import\": noRelativeParentImport,\n \"no-restricted-syntax\": noRestrictedSyntax,\n \"no-secret\": noSecret,\n \"no-self-import\": noSelfImport,\n \"no-shadow\": noShadow,\n \"no-sibling-import\": noSiblingImport,\n \"no-single-line-comment\": noSingleLineComment,\n \"no-t\": noT,\n \"no-underscore-export\": noUnderscoreExport,\n \"no-unnecessary-as-const\": noUnnecessaryAsConst,\n \"no-unnecessary-break\": noUnnecessaryBreak,\n \"no-unnecessary-initialization\": noUnnecessaryInitialization,\n \"no-unnecessary-template-literal\": noUnnecessaryTemplateLiteral,\n \"no-unused-disable\": noUnusedDisable,\n \"no-use-extend-native\": noUseExtendNative,\n \"no-useless-generics\": noUselessGenerics,\n \"no-value-tostring\": noValueToString,\n \"no-vulnerable\": noVulnerable,\n \"no-writeonly\": noWriteonly,\n \"object-format\": objectFormat,\n \"only-export-name\": onlyExportName,\n \"prefer-arrow-function-property\": preferArrowFunctionProperty,\n \"prefer-const-require\": preferConstRequire,\n \"prefer-includes\": preferIncludes,\n \"prefer-interface\": preferInterface,\n \"prefer-less-than\": preferLessThan,\n \"prefer-object-has-own\": preferObjectHasOwn,\n \"prefer-only-export\": preferOnlyExport,\n \"require-jsdoc\": requireJSDoc,\n \"require-syntax\": requireSyntax,\n \"restrict-identifier-characters\": restrictIdentifierCharacters,\n \"sort-array\": sortArray,\n \"sort-call-signature\": sortCallSignature,\n \"sort-class-members\": sortClassMembers,\n \"sort-construct-signature\": sortConstructSignature,\n \"sort-export-specifiers\": sortExportSpecifiers,\n \"sort-keys\": sortKeys,\n \"sort-top-comments\": sortTopComments,\n \"switch-case-spacing\": switchCaseSpacing,\n \"template-literal-format\": templateLiteralFormat,\n \"throw-error\": throwError,\n \"throw-new-error\": throwNewError,\n \"typescript/array-callback-return-type\": typescriptArrayCallbackReturnType,\n \"typescript/class-methods-use-this\": typescriptClassMethodsUseThis,\n \"typescript/consistent-array-type-name\": typescriptConsistentArrayTypeName,\n \"typescript/define-function-in-one-statement\":\n typescriptDefineFunctionInOneStatement,\n \"typescript/exhaustive-switch\": typescriptExhaustiveSwitch,\n \"typescript/no-boolean-literal-type\": typescriptNoBooleanLiteralType,\n \"typescript/no-complex-declarator-type\": typescriptNoComplexDeclaratorType,\n \"typescript/no-complex-return-type\": typescriptNoComplexReturnType,\n \"typescript/no-empty-interfaces\": typescriptNoEmptyInterfaces,\n \"typescript/no-inferrable-types\": typescriptNoInferrableTypes,\n \"typescript/no-multi-type-tuples\": typescriptNoMultiTypeTuples,\n \"typescript/no-never\": typescriptNoNever,\n \"typescript/no-redundant-undefined-const\":\n typescriptNoRedundantUndefinedConst,\n \"typescript/no-redundant-undefined-default-parameter\":\n typescriptNoRedundantUndefinedDefaultParameter,\n \"typescript/no-redundant-undefined-let\": typescriptNoRedundantUndefinedLet,\n \"typescript/no-redundant-undefined-optional\":\n typescriptNoRedundantUndefinedOptional,\n \"typescript/no-redundant-undefined-promise-return-type\":\n typescriptNoRedundantUndefinedPromiseReturnType,\n \"typescript/no-redundant-undefined-readonly-property\":\n typescriptNoRedundantUndefinedReadonlyProperty,\n \"typescript/no-redundant-undefined-return-type\":\n typescriptNoRedundantUndefinedReturnType,\n \"typescript/no-redundant-undefined-var\": typescriptNoRedundantUndefinedVar,\n \"typescript/no-restricted-syntax\": typescriptNoRestrictedSyntax,\n \"typescript/no-unsafe-object-assign\": typescriptNoUnsafeObjectAssign,\n \"typescript/no-unsafe-object-assignment\":\n typescriptNoUnsafeObjectAssignment,\n \"typescript/prefer-array-type-alias\": typescriptPreferArrayTypeAlias,\n \"typescript/prefer-class-method\": typescriptPreferClassMethod,\n \"typescript/prefer-enum\": typescriptPreferEnum,\n \"typescript/prefer-named-tuple-members\": typescriptPreferNamedTupleMembers,\n \"typescript/prefer-readonly-array\": typescriptPreferReadonlyArray,\n \"typescript/prefer-readonly-array-parameter\":\n typescriptPreferReadonlyArrayParameter,\n \"typescript/prefer-readonly-index-signature\":\n typescriptPreferReadonlyIndexSignature,\n \"typescript/prefer-readonly-map\": typescriptPreferReadonlyMap,\n \"typescript/prefer-readonly-property\": typescriptPreferReadonlyProperty,\n \"typescript/prefer-readonly-record\": typescriptPreferReadonlyRecord,\n \"typescript/prefer-readonly-set\": typescriptPreferReadonlySet,\n \"typescript/require-prop-type-annotation\":\n typescriptRequirePropTypeAnnotation,\n \"typescript/require-readonly-array-property-type\":\n typescriptRequireReadonlyArrayPropertyType,\n \"typescript/require-readonly-array-return-type\":\n typescriptRequireReadonlyArrayReturnType,\n \"typescript/require-readonly-array-type-alias\":\n typescriptRequireReadonlyArrayTypeAlias,\n \"typescript/require-readonly-map-parameter-type\":\n typescriptRequireReadonlyMapParameterType,\n \"typescript/require-readonly-map-property-type\":\n typescriptRequireReadonlyMapPropertyType,\n \"typescript/require-readonly-map-return-type\":\n typescriptRequireReadonlyMapReturnType,\n \"typescript/require-readonly-map-type-alias\":\n typescriptRequireReadonlyMapTypeAlias,\n \"typescript/require-readonly-record-parameter-type\":\n typescriptRequireReadonlyRecordParameterType,\n \"typescript/require-readonly-record-property-type\":\n typescriptRequireReadonlyRecordPropertyType,\n \"typescript/require-readonly-record-return-type\":\n typescriptRequireReadonlyRecordReturnType,\n \"typescript/require-readonly-record-type-alias\":\n typescriptRequireReadonlyRecordTypeAlias,\n \"typescript/require-readonly-set-parameter-type\":\n typescriptRequireReadonlySetParameterType,\n \"typescript/require-readonly-set-property-type\":\n typescriptRequireReadonlySetPropertyType,\n \"typescript/require-readonly-set-return-type\":\n typescriptRequireReadonlySetReturnType,\n \"typescript/require-readonly-set-type-alias\":\n typescriptRequireReadonlySetTypeAlias,\n \"typescript/require-this-void\": typescriptRequireThisVoid,\n \"underscore-internal\": underscoreInternal,\n \"unused-internal-properties\": unusedInternalProperties,\n \"uppercase-iife\": uppercaseIife,\n words: words,\n};\n\nconst ruleCatalog = buildRuleCatalog(objectKeys(baseRules));\n\n/**\n * Globally ordered catalog entries for every rule.\n */\nexport const ruleCatalogEntries: readonly RuleCatalogEntry[] =\n ruleCatalog.ordered;\n\n/**\n * Catalog metadata keyed by rule name.\n */\nexport const ruleCatalogByRuleName: Readonly<Record<string, RuleCatalogEntry>> =\n ruleCatalog.byRuleName;\n\n/**\n * Catalog metadata keyed by documentation id (`/` replaced with `-`).\n */\nexport const ruleCatalogByDocId: Readonly<Record<string, RuleCatalogEntry>> =\n ruleCatalog.byDocId;\n\nconst withCatalogDocsMetadata = (\n ruleName: string,\n ruleModule: Readonly<RuleModule>\n): RuleModule => {\n const catalogEntry = ruleCatalog.byRuleName[ruleName];\n\n if (!catalogEntry) {\n throw new Error(`Missing rule catalog entry for rule \"${ruleName}\".`);\n }\n\n const currentDocsMetadata = safeCastTo<RuleDocsMetadata>(\n ruleModule.meta.docs ?? {}\n );\n const hasRequiredTypeChecking = setHas(\n rulesWithRequiredTypeChecking,\n ruleName\n );\n const deprecatedMetadata = ruleModule.meta.deprecated ?? false;\n const isDeprecatedRule = deprecatedMetadata !== false;\n const docsWithCatalogMetadata = {\n ...currentDocsMetadata,\n catalogId: catalogEntry.catalogId,\n catalogIndex: catalogEntry.catalogIndex,\n deprecated: currentDocsMetadata.deprecated ?? isDeprecatedRule,\n frozen:\n currentDocsMetadata.frozen ??\n currentDocsMetadata.deprecated ??\n isDeprecatedRule,\n recommended: setHas(recommendedRuleNames, ruleName),\n requiresTypeChecking:\n currentDocsMetadata.requiresTypeChecking ?? hasRequiredTypeChecking,\n ruleName,\n } as NonNullable<RuleModule[\"meta\"][\"docs\"]>;\n\n return {\n ...ruleModule,\n meta: {\n ...ruleModule.meta,\n deprecated: deprecatedMetadata,\n docs: docsWithCatalogMetadata,\n },\n };\n};\n\nconst decoratedRuleEntries = objectEntries(baseRules).map(\n ([ruleName, ruleModule]) =>\n [ruleName, withCatalogDocsMetadata(ruleName, ruleModule)] as const\n);\n\nlet decoratedRulesAccumulator: Readonly<Record<string, RuleModule>> = {};\n\nfor (const [ruleName, ruleModule] of decoratedRuleEntries) {\n decoratedRulesAccumulator = {\n ...decoratedRulesAccumulator,\n [ruleName]: ruleModule,\n };\n}\n\nconst decoratedRules: Readonly<Record<string, RuleModule>> =\n decoratedRulesAccumulator;\n\n/**\n * Rule implementations keyed by rule name with normalized docs metadata.\n */\nexport const rules: Readonly<Record<string, RuleModule>> =\n Object.freeze(decoratedRules);\n", "/**\n * Global rule catalog indexed by rule name and documentation id.\n */\ntype RuleCatalog = Readonly<{\n readonly byDocId: Readonly<Record<string, RuleCatalogEntry>>;\n readonly byRuleName: Readonly<Record<string, RuleCatalogEntry>>;\n readonly ordered: readonly RuleCatalogEntry[];\n}>;\n\n/**\n * Single rule entry in the global catalog.\n */\ntype RuleCatalogEntry = Readonly<{\n readonly catalogId: string;\n readonly catalogIndex: number;\n readonly docId: string;\n readonly isTypeScriptRule: boolean;\n readonly ruleName: string;\n}>;\n\nconst toCatalogNumericPart = (catalogIndex: number): string =>\n `${catalogIndex}`.padStart(3, \"0\");\n\n/**\n * Format a catalog index as an ID like `R001`.\n */\nexport const toRuleCatalogId = (catalogIndex: number): string =>\n `R${toCatalogNumericPart(catalogIndex)}`;\n\n/**\n * Convert a rule name to its documentation page id.\n */\nexport const toRuleDocId = (ruleName: string): string =>\n ruleName.replaceAll(\"/\", \"-\");\n\n/**\n * Sort rules so core rules come first, then TypeScript-scoped rules.\n */\nexport const compareRuleNamesForCatalog = (\n leftRuleName: string,\n rightRuleName: string\n): number => {\n const leftIsTypeScriptRule = leftRuleName.startsWith(\"typescript/\");\n const rightIsTypeScriptRule = rightRuleName.startsWith(\"typescript/\");\n\n if (leftIsTypeScriptRule !== rightIsTypeScriptRule) {\n return leftIsTypeScriptRule ? 1 : -1;\n }\n\n return leftRuleName.localeCompare(rightRuleName);\n};\n\n/**\n * Build a globally ordered rule catalog map keyed by both rule name and doc id.\n */\nexport const buildRuleCatalog = (ruleNames: readonly string[]): RuleCatalog => {\n const sortedRuleNames = ruleNames.toSorted(compareRuleNamesForCatalog);\n let ordered: readonly RuleCatalogEntry[] = [];\n let byRuleName: Readonly<Record<string, RuleCatalogEntry>> = {};\n let byDocId: Readonly<Record<string, RuleCatalogEntry>> = {};\n\n for (const [zeroBasedIndex, ruleName] of sortedRuleNames.entries()) {\n const catalogIndex = zeroBasedIndex + 1;\n const docId = toRuleDocId(ruleName);\n const entry: RuleCatalogEntry = {\n catalogId: toRuleCatalogId(catalogIndex),\n catalogIndex,\n docId,\n isTypeScriptRule: ruleName.startsWith(\"typescript/\"),\n ruleName,\n };\n\n ordered = [...ordered, entry];\n byRuleName = { ...byRuleName, [ruleName]: entry };\n byDocId = { ...byDocId, [docId]: entry };\n }\n\n return {\n byDocId,\n byRuleName,\n ordered,\n };\n};\n\nexport type { RuleCatalog, RuleCatalogEntry };\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"array-type\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/array-type\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/array-type.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"array-type\",\n url: \"https://typescript-eslint.io/rules/array-type\",\n },\n }),\n ],\n ruleId: \"array-type\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray, UnknownRecord } from \"type-fest\";\n\nimport { objectHasOwn, safeCastTo } from \"ts-extras\";\n\ntype RuleContext = TSESLint.RuleContext<string, Readonly<UnknownArray>>;\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst isObjectRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null;\n\nconst hasCreateFunction = (\n value: unknown\n): value is Readonly<UnknownRecord> &\n Readonly<{ readonly create: RuleModule[\"create\"] }> =>\n isObjectRecord(value) && typeof value[\"create\"] === \"function\";\n\nconst createLegacyContextCompat = (context: RuleContext): RuleContext =>\n new Proxy(context, {\n get: (target, property, receiver): unknown => {\n if (property === \"getSourceCode\") {\n return (): Readonly<TSESLint.SourceCode> => target.sourceCode;\n }\n\n if (property === \"getFilename\") {\n return (): string => target.filename;\n }\n\n if (property === \"getPhysicalFilename\") {\n return (): string => target.physicalFilename;\n }\n\n if (property === \"getCwd\") {\n return (): string => target.cwd;\n }\n\n return Reflect.get(target, property, receiver);\n },\n });\n\n/**\n * Resolve a rule module from an external ESLint plugin's `rules` map.\n */\nexport const getExternalRuleFromPlugin = (\n plugin: unknown,\n ruleName: string,\n pluginName: string\n): unknown => {\n if (!isObjectRecord(plugin) || !isObjectRecord(plugin[\"rules\"])) {\n throw new TypeError(\n `Plugin \"${pluginName}\" does not expose a valid rules map.`\n );\n }\n\n const rules = plugin[\"rules\"];\n if (!objectHasOwn(rules, ruleName)) {\n throw new Error(\n `Rule \"${ruleName}\" was not found in plugin \"${pluginName}\".`\n );\n }\n\n return rules[ruleName];\n};\n\n/**\n * Adapt an external rule so it points docs to this repository.\n */\nexport const adaptExternalRule = (\n externalRule: unknown,\n docsUrl: string\n): RuleModule => {\n if (!hasCreateFunction(externalRule)) {\n throw new TypeError(\"External rule module does not expose create().\");\n }\n\n const externalRuleRecord = externalRule;\n const externalMeta = isObjectRecord(externalRuleRecord[\"meta\"])\n ? externalRuleRecord[\"meta\"]\n : {};\n const externalDocs = isObjectRecord(externalMeta[\"docs\"])\n ? externalMeta[\"docs\"]\n : {};\n const create: RuleModule[\"create\"] = (context) =>\n externalRule.create(createLegacyContextCompat(context));\n\n return {\n ...(externalRuleRecord as unknown as RuleModule),\n create,\n defaultOptions: Array.isArray(externalRuleRecord[\"defaultOptions\"])\n ? safeCastTo<Readonly<UnknownArray>>(\n externalRuleRecord[\"defaultOptions\"]\n )\n : [],\n meta: {\n ...(externalMeta as unknown as RuleModule[\"meta\"]),\n docs: {\n ...(externalDocs as unknown as NonNullable<\n RuleModule[\"meta\"]\n >[\"docs\"]),\n url: docsUrl,\n },\n } as RuleModule[\"meta\"],\n };\n};\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { isDefined } from \"ts-extras\";\n\ntype DeprecatedInfo = Exclude<\n TSESLint.RuleMetaData<string>[\"deprecated\"],\n boolean | undefined\n>;\ntype ReplacedByInfo = NonNullable<DeprecatedInfo[\"replacedBy\"]>[number];\n\ntype RuleDeprecationOptions = Readonly<{\n readonly message: string;\n readonly replacedBy?: readonly ReplacedByInfo[];\n readonly ruleId: string;\n}>;\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\nconst docsBaseUrl =\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules\";\n\n/**\n * Create a replacement descriptor for deprecation metadata.\n */\nexport const createReplacementRuleInfo = (\n replacement: Readonly<{\n readonly plugin?: Readonly<{\n readonly name: string;\n readonly url?: string;\n }>;\n readonly rule?: Readonly<{\n readonly name: string;\n readonly url?: string;\n }>;\n }>\n): ReplacedByInfo => ({\n ...(isDefined(replacement.plugin) ? { plugin: replacement.plugin } : {}),\n ...(isDefined(replacement.rule) ? { rule: replacement.rule } : {}),\n});\n\n/**\n * Create standardized deprecation metadata for this plugin.\n */\nexport const createDeprecatedRuleInfo = ({\n message,\n replacedBy = [],\n ruleId,\n}: RuleDeprecationOptions): DeprecatedInfo => ({\n availableUntil: \"2.0.0\",\n deprecatedSince: \"1.0.0\",\n message,\n ...(replacedBy.length === 0 ? {} : { replacedBy: [...replacedBy] }),\n url: `${docsBaseUrl}/${ruleId.replaceAll(\"/\", \"-\")}`,\n});\n\n/**\n * Apply deprecated+frozen lifecycle metadata to a rule module.\n */\nexport const withDeprecatedRuleLifecycle = <TRule extends RuleModule>(\n rule: TRule,\n options: RuleDeprecationOptions\n): TRule => ({\n ...rule,\n meta: {\n ...rule.meta,\n deprecated: createDeprecatedRuleInfo(options),\n ...(rule.meta.docs === undefined\n ? {}\n : {\n docs: {\n ...rule.meta.docs,\n deprecated: true,\n frozen: true,\n },\n }),\n },\n});\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { basename, extname } from \"node:path\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"mismatch\";\n\ntype Options = readonly [];\n\nconst getFileStem = (filePath: string): string => {\n const extension = extname(filePath);\n return basename(filePath, extension);\n};\n\n/**\n * Require top-level class declarations to match the current filename.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"Program > ExportDefaultDeclaration > ClassDeclaration > Identifier.id, Program > ExportNamedDeclaration > ClassDeclaration > Identifier.id, Program > ClassDeclaration > Identifier.id\":\n (node: Readonly<es.Identifier>): void => {\n const fileName = context.filename;\n if (fileName === \"<input>\") {\n return;\n }\n\n const fileStem = getFileStem(fileName);\n if (fileStem.length === 0 || fileStem === node.name) {\n return;\n }\n\n context.report({\n data: {\n expected: fileStem,\n got: node.name,\n },\n messageId: \"mismatch\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require class names to match the current filename.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/class-match-filename\",\n },\n hasSuggestions: false,\n messages: {\n mismatch:\n \"Class name '{{got}}' does not match filename '{{expected}}'. Rename the class or the file.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"class-match-filename\",\n});\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\n\n/**\n * Broad rule-module type used by incrementally migrated rule files.\n */\nexport type AnyRuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\ntype RuleCreatorFactory = ReturnType<\n typeof ESLintUtils.RuleCreator<RuleDocsMetadata>\n>;\n\ntype RuleDocsMetadata = {\n readonly catalogId?: string;\n readonly catalogIndex?: number;\n readonly deprecated?: boolean;\n readonly frozen?: boolean;\n readonly recommended: boolean;\n readonly requiresTypeChecking?: boolean;\n readonly ruleName?: string;\n readonly suggestion?: boolean;\n};\n\n/**\n * Shared rule factory for plugin rules.\n */\n/**\n * Typed factory for defining plugin rules with consistent docs URLs.\n */\nexport const ruleCreator: RuleCreatorFactory =\n ESLintUtils.RuleCreator<RuleDocsMetadata>((name) => {\n const docsPathName = name.replaceAll(\"/\", \"-\");\n\n return `https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/${docsPathName}`;\n });\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"invalidSpacing\";\n\ntype Options = readonly [];\n\nconst isEslintDirectiveComment = (comment: Readonly<es.Comment>): boolean =>\n comment.type === \"Block\" && comment.value.trimStart().startsWith(\"eslint-\");\n\nconst expectedBlankLines = (comment: Readonly<es.Comment>): 0 | 1 => {\n if (comment.type === \"Line\" || isEslintDirectiveComment(comment)) {\n return 0;\n }\n\n return /\\r\\n|\\n/u.test(comment.value) ? 1 : 0;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n comment: Readonly<es.Comment>,\n nextNode: Readonly<es.Node | es.Token>,\n expected: number\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const textBetween = sourceCode.text.slice(\n comment.range[1],\n arrayFirst(nextNode.range)\n );\n const lineEnding = textBetween.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n const indentation = \" \".repeat(nextNode.loc.start.column);\n\n return fixer.replaceTextRange(\n [comment.range[1], arrayFirst(nextNode.range)],\n `${lineEnding.repeat(expected + 1)}${indentation}`\n );\n };\n\n/**\n * Enforce consistent blank-line spacing after comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (): void => {\n const comments = context.sourceCode.getAllComments();\n\n for (const comment of comments) {\n const nextNode = context.sourceCode.getTokenAfter(comment, {\n includeComments: false,\n });\n if (nextNode === null) {\n continue;\n }\n\n const blankLines =\n nextNode.loc.start.line - comment.loc.end.line - 1;\n const expected = expectedBlankLines(comment);\n if (blankLines === expected) {\n continue;\n }\n\n context.report({\n fix: buildFix(\n context.sourceCode,\n comment,\n nextNode,\n expected\n ),\n messageId: \"invalidSpacing\",\n node: comment,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent blank-line spacing after comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/comment-spacing\",\n },\n fixable: \"whitespace\",\n hasSuggestions: false,\n messages: {\n invalidSpacing: \"Incorrect blank-line spacing after this comment.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"comment-spacing\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [];\n\nconst splitLines = (sourceText: string): readonly string[] =>\n stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n\nconst collapseEmptyLines = (sourceText: string): string => {\n const lines = splitLines(sourceText);\n let output: readonly string[] = [];\n let emptyRun = 0;\n\n for (const line of lines) {\n const isEmpty = line.trim().length === 0;\n if (!isEmpty) {\n emptyRun = 0;\n output = [...output, line];\n continue;\n }\n\n if (emptyRun < 1) {\n output = [...output, line];\n }\n\n emptyRun += 1;\n }\n\n return arrayJoin(output, \"\\n\");\n};\n\nconst hasTooManyEmptyLines = (sourceText: string): boolean => {\n let emptyRun = 0;\n\n for (const line of splitLines(sourceText)) {\n if (line.trim().length === 0) {\n emptyRun += 1;\n if (emptyRun >= 2) {\n return true;\n }\n } else {\n emptyRun = 0;\n }\n }\n\n return false;\n};\n\n/**\n * Enforce at most one consecutive empty line.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (node: Readonly<es.Program>): void => {\n const sourceText = context.sourceCode.getText();\n if (!hasTooManyEmptyLines(sourceText)) {\n return;\n }\n\n context.report({\n fix: (fixer): TSESLint.RuleFix =>\n fixer.replaceTextRange(\n [0, sourceText.length],\n collapseEmptyLines(sourceText)\n ),\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"enforce at most one consecutive empty line.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-empty-lines\",\n },\n fixable: \"whitespace\",\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Consecutive empty lines should be collapsed to a single blank line.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"consistent-empty-lines\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`TSEnumMember:not([id.name=/^[A-Z][A-Z_\\d]*$/u], [initializer.value=/^[A-Z][A-Z_\\d]*$/u])`;\n\n/**\n * Enforce SCREAMING_SNAKE_CASE enum member names and literal values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce SCREAMING_SNAKE_CASE enum member names and string literal values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-enum-members\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Enum member names and string values must use SCREAMING_SNAKE_CASE.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-enum-members\",\n});\n\nexport default rule;\n", "import { safeCastTo } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n }>,\n];\n\nconst defaultOptions = {\n format: safeCastTo<Casing>(\"kebab-case\"),\n};\n\n/**\n * Enforce filename casing consistency with optional selector-based overrides.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => ({\n Program: (node): void => {\n if (context.filename === \"<input>\") {\n return;\n }\n\n const stem = filenameStem(context.filename);\n const expected = toCasing(\n stem,\n options.format ?? defaultOptions.format\n );\n if (stem === expected) {\n return;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n defaultOptions: [defaultOptions],\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"enforce filename casing consistency.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-filename\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent: \"Filename should use '{{expected}}' casing.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for filename casing consistency enforcement.\",\n properties: {\n format: {\n description:\n \"Expected casing format for filename stems.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"consistent-filename\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/filename-case.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"filename-case\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md\",\n },\n }),\n ],\n ruleId: \"consistent-filename\",\n});\n\nexport default deprecatedRule;\n", "import { arrayAt, arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { splitIdentifierBlocks } from \"./identifier-blocks.js\";\n\n/**\n * Supported casing formats for identifier transformations.\n */\nexport type Casing = \"camelCase\" | \"kebab-case\" | \"PascalCase\";\n\nconst splitWords = (value: string): readonly string[] =>\n splitIdentifierBlocks(value).map((word) => word.toLowerCase());\n\nconst toPascal = (value: string): string =>\n arrayJoin(\n splitWords(value).map(\n (word) => `${word[0]?.toUpperCase() ?? \"\"}${word.slice(1)}`\n ),\n \"\"\n );\n\n/**\n * Convert an input string into the requested casing format.\n */\nexport const toCasing = (value: string, format: Casing): string => {\n switch (format) {\n case \"camelCase\": {\n const pascal = toPascal(value);\n return `${pascal[0]?.toLowerCase() ?? \"\"}${pascal.slice(1)}`;\n }\n\n case \"kebab-case\": {\n return arrayJoin(splitWords(value), \"-\");\n }\n\n case \"PascalCase\": {\n return toPascal(value);\n }\n\n default: {\n return value;\n }\n }\n};\n\n/**\n * Extract the final filename segment without extension.\n */\nexport const filenameStem = (filePath: string): string => {\n const normalizedPath = filePath.replaceAll(\"\\\\\", \"/\");\n const pathSegments = stringSplit(normalizedPath, \"/\");\n const lastPathSegment = arrayAt(pathSegments, -1) ?? filePath;\n\n return lastPathSegment.replace(/\\.[^./\\\\]+$/u, \"\");\n};\n", "import { stringSplit } from \"ts-extras\";\n\nconst camelCaseBoundaryPattern = /(?<=[\\da-z])(?=[A-Z])/gu;\nconst nonAlphanumericPattern = /[^0-9A-Za-z]+/gu;\nconst whitespacePattern = /\\s+/gu;\n\n/**\n * Split identifier-like text into non-empty blocks while preserving original\n * block casing.\n */\nexport const splitIdentifierBlocks = (value: string): readonly string[] => {\n const normalized = value\n .replaceAll(camelCaseBoundaryPattern, \" \")\n .replaceAll(nonAlphanumericPattern, \" \")\n .trim();\n\n if (normalized.length === 0) {\n return [];\n }\n\n const normalizedWhitespace = normalized.replaceAll(whitespacePattern, \" \");\n\n return stringSplit(normalizedWhitespace, \" \").filter(\n (segment) => segment.length > 0\n );\n};\n\n/**\n * Count non-empty identifier blocks after casing/punctuation normalization.\n */\nexport const countIdentifierBlocks = (value: string): number =>\n splitIdentifierBlocks(value).length;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype ImportStyle = \"default\" | \"mixed\" | \"named\" | \"namespace\" | \"side-effect\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly style?: ImportStyle;\n }>,\n];\n\nconst styleFromImport = (node: Readonly<es.ImportDeclaration>): ImportStyle => {\n if (node.specifiers.length === 0) {\n return \"side-effect\";\n }\n\n const hasDefault = node.specifiers.some(\n (specifier) => specifier.type === \"ImportDefaultSpecifier\"\n );\n const hasNamed = node.specifiers.some(\n (specifier) => specifier.type === \"ImportSpecifier\"\n );\n const hasNamespace = node.specifiers.some(\n (specifier) => specifier.type === \"ImportNamespaceSpecifier\"\n );\n\n if (hasNamespace) {\n return \"namespace\";\n }\n\n if (hasDefault && hasNamed) {\n return \"mixed\";\n }\n\n if (hasDefault) {\n return \"default\";\n }\n\n return \"named\";\n};\n\n/**\n * Enforce consistent import declaration style per module source.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const seen = new Map<string, ImportStyle>();\n\n return {\n ImportDeclaration: (node: Readonly<es.ImportDeclaration>): void => {\n if (typeof node.source.value !== \"string\") {\n return;\n }\n\n const source = node.source.value;\n const style = styleFromImport(node);\n const expected = options.style ?? seen.get(source) ?? style;\n if (!isDefined(options.style)) {\n seen.set(source, expected);\n }\n\n if (style === expected) {\n return;\n }\n\n context.report({\n data: {\n expected,\n source,\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n };\n },\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent import declaration style per module source.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-import\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Imports from '{{source}}' should use '{{expected}}' style consistently.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for global import declaration style enforcement.\",\n properties: {\n style: {\n description:\n \"When provided, all imports must use this style.\",\n enum: [\n \"default\",\n \"mixed\",\n \"named\",\n \"namespace\",\n \"side-effect\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"consistent-import\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSUnionType\",\n \"PropertyDefinition[optional=true] > TSTypeAnnotation > TSUnionType\",\n ],\n \", \"\n);\n\nconst buildOptionalUnionFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on already-optional properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildOptionalUnionFixText(\n sourceCode,\n node\n );\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix => fixer.replaceText(node, fixedTypeText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` unions on optional property declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-optional-props\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Optional properties should not redundantly include `undefined` in their type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-optional-props\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = \"Literal.source[value=/.(?:js|json|ts)$/u]\";\n\n/**\n * Disallow explicit `.js`, `.json`, and `.ts` source extensions in\n * imports/exports.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require consistent import/export source paths without file extensions.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-source-extension\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Remove the source file extension from this import/export path.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-source-extension\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/extensions.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"extensions\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md\",\n },\n }),\n ],\n ruleId: \"consistent-source-extension\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst disallowedSelector = String.raw`CallExpression[callee.name='Symbol'] > Literal:not([value=/^(?:[\\da-z-]|__)+$/u])`;\n\n/**\n * Require `Symbol` descriptions to use kebab-case style.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require consistent kebab-case symbol descriptions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/consistent-symbol-description\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer kebab-case Symbol descriptions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"consistent-symbol-description\",\n});\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\nimport type { UnknownArray } from \"type-fest\";\n\n// eslint-disable-next-line import-x/no-deprecated, sonarjs/deprecation -- ESLint currently exposes core rules through this compatibility entrypoint.\nimport { builtinRules } from \"eslint/use-at-your-own-risk\";\nimport { isDefined } from \"ts-extras\";\n\ntype RuleModule = TSESLint.RuleModule<string, Readonly<UnknownArray>>;\n\n/**\n * Resolve a core ESLint rule module by rule ID.\n */\nexport const getCoreRule = (ruleId: string): RuleModule => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated, import-x/no-deprecated, sonarjs/deprecation -- ESLint currently exposes core rule modules through this entrypoint.\n const coreRule = builtinRules.get(ruleId);\n if (!isDefined(coreRule)) {\n throw new Error(`Missing core ESLint rule \"${ruleId}\".`);\n }\n\n return coreRule as unknown as RuleModule;\n};\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\n\nconst externalRule = getCoreRule(\"default-case\");\n\n/**\n * Proxy of ESLint core `default-case` with plugin-local docs URL.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/default-case\"\n);\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport {\n getImportSourceFromNode,\n shouldReportImportSource,\n} from \"./import-patterns.js\";\nimport { ruleCreator } from \"./rule-creator.js\";\n\n/**\n * Rule factory options for import source pattern rules.\n */\ninterface CreateImportPatternRuleOptions {\n /**\n * Default disallow patterns applied when options do not override\n * `disallow`.\n */\n readonly defaultDisallowPatterns: readonly string[];\n /**\n * Human-friendly rule description.\n */\n readonly description: string;\n /**\n * Rule identifier used for metadata and exported rule map key.\n */\n readonly name: string;\n}\n\ntype ImportPatternMessageIds = \"disallowedSource\";\n\n/**\n * Rule options tuple for import pattern rules.\n */\ntype ImportPatternRuleOptions = readonly [\n {\n readonly allow?: readonly string[];\n readonly disallow?: readonly string[];\n }?,\n];\n\nconst createImportVisitors = (\n context: Parameters<\n ReturnType<\n typeof ruleCreator<\n ImportPatternRuleOptions,\n ImportPatternMessageIds\n >\n >[\"create\"]\n >[0],\n defaultDisallowPatterns: readonly string[]\n): Readonly<Record<string, (node: Readonly<es.Node>) => void>> => ({\n \"ImportDeclaration, ExportNamedDeclaration[source], ExportAllDeclaration, ImportExpression\":\n (node: Readonly<es.Node>): void => {\n const sourceText = getImportSourceFromNode(node);\n if (!isDefined(sourceText)) {\n return;\n }\n\n const [options = {}] = context.options;\n if (\n !shouldReportImportSource(\n sourceText,\n options,\n defaultDisallowPatterns\n )\n ) {\n return;\n }\n\n context.report({\n data: {\n source: sourceText,\n },\n messageId: \"disallowedSource\",\n node,\n });\n },\n});\n\n/**\n * Creates a rule that disallows import/export sources by glob pattern.\n *\n * @param options - Rule creation options.\n *\n * @returns ESLint rule module.\n */\nexport const createImportPatternRule = ({\n defaultDisallowPatterns,\n description,\n name,\n}: Readonly<CreateImportPatternRuleOptions>): ReturnType<\n typeof ruleCreator<ImportPatternRuleOptions, ImportPatternMessageIds>\n> =>\n ruleCreator<ImportPatternRuleOptions, ImportPatternMessageIds>({\n create: (context) =>\n createImportVisitors(context, defaultDisallowPatterns),\n meta: {\n defaultOptions: [{}],\n docs: {\n description,\n recommended: false,\n url: `https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/${name.replaceAll(\"/\", \"-\")}`,\n },\n hasSuggestions: false,\n messages: {\n disallowedSource:\n \"Import source `{{ source }}` is disallowed by this rule.\",\n },\n schema: [\n {\n additionalProperties: false,\n properties: {\n allow: {\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n disallow: {\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name,\n });\n\nexport type { ImportPatternRuleOptions };\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { minimatch } from \"minimatch\";\n\n/**\n * Allow/disallow glob options for import source checks.\n */\ntype ImportPathOptions = Readonly<{\n readonly allow?: readonly string[];\n readonly disallow?: readonly string[];\n}>;\n\nconst matchesAnyPattern = (\n value: string,\n patterns: readonly string[]\n): boolean =>\n patterns.some((pattern) =>\n minimatch(value, pattern, {\n dot: true,\n nocase: false,\n })\n );\n\nconst getImportSourceText = (node: Readonly<es.Node>): string | undefined => {\n if (\n node.type === \"ExportAllDeclaration\" ||\n node.type === \"ImportDeclaration\"\n ) {\n return node.source.value;\n }\n\n if (node.type === \"ExportNamedDeclaration\") {\n return node.source?.value;\n }\n\n if (node.type === \"ImportExpression\") {\n return node.source.type === \"Literal\" &&\n typeof node.source.value === \"string\"\n ? node.source.value\n : undefined;\n }\n\n return undefined;\n};\n\nconst toMergedOptions = (\n options: Readonly<ImportPathOptions> | undefined,\n defaultDisallowPatterns: readonly string[]\n): Required<ImportPathOptions> => ({\n allow: options?.allow ?? [],\n disallow: options?.disallow ?? defaultDisallowPatterns,\n});\n\n/**\n * Determines whether an import source should be reported.\n *\n * @param sourceText - Source text from an import/export node.\n * @param options - Rule options for allow/disallow overrides.\n * @param defaultDisallowPatterns - Rule-specific default disallow patterns.\n *\n * @returns `true` when the source matches a disallow pattern and no allow\n * pattern.\n */\nexport const shouldReportImportSource = (\n sourceText: string,\n options: Readonly<ImportPathOptions> | undefined,\n defaultDisallowPatterns: readonly string[]\n): boolean => {\n const mergedOptions = toMergedOptions(options, defaultDisallowPatterns);\n if (!matchesAnyPattern(sourceText, mergedOptions.disallow)) {\n return false;\n }\n\n return !matchesAnyPattern(sourceText, mergedOptions.allow);\n};\n\n/**\n * Gets import source text from supported import/export AST nodes.\n *\n * @param node - AST node to inspect.\n *\n * @returns Source text when present and string-literal based, otherwise\n * `undefined`.\n */\nexport const getImportSourceFromNode = (\n node: Readonly<es.Node>\n): string | undefined => getImportSourceText(node);\n\nexport type { ImportPathOptions };\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow import and export sources by configured glob patterns.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [],\n description:\n \"disallow import sources using configurable glob patterns.\",\n name: \"disallow-import\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { resolve } from \"node:path\";\nimport { isEmpty } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"onlyExport\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n }>,\n];\n\nconst exportedNamesFromDeclaration = (\n node: Readonly<es.ExportNamedDeclaration>\n): readonly string[] => {\n if (node.specifiers.length > 0) {\n return node.specifiers\n .filter(\n (specifier): specifier is es.ExportSpecifier =>\n specifier.type === \"ExportSpecifier\"\n )\n .flatMap((specifier) =>\n specifier.exported.type === \"Identifier\"\n ? [specifier.exported.name]\n : []\n );\n }\n\n if (\n node.declaration?.type === \"ClassDeclaration\" ||\n node.declaration?.type === \"FunctionDeclaration\"\n ) {\n return node.declaration.id === null ? [] : [node.declaration.id.name];\n }\n\n return [];\n};\n\n/**\n * Enforce that exports matching the filename are the only export in the file.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n let exports: readonly {\n readonly name: string;\n readonly node: es.Node;\n }[] = [];\n\n return {\n ExportDefaultDeclaration: (\n node: Readonly<es.ExportDefaultDeclaration>\n ): void => {\n exports = [\n ...exports,\n {\n name: \"default\",\n node,\n },\n ];\n },\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n for (const name of exportedNamesFromDeclaration(node)) {\n exports = [...exports, { name, node }];\n }\n },\n \"Program:exit\": (): void => {\n if (context.filename === \"<input>\") {\n return;\n }\n\n const stem = filenameStem(resolve(context.filename));\n const expected = toCasing(stem, options.format ?? \"PascalCase\");\n const matching = exports.filter(\n (entry) => entry.name === expected\n );\n if (isEmpty(matching) || exports.length <= 1) {\n return;\n }\n\n for (const entry of exports) {\n if (entry.name === expected) {\n continue;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"onlyExport\",\n node: entry.node,\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ format: \"PascalCase\" }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce filename-matching exports to be the only export.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/export-matching-filename-only\",\n },\n hasSuggestions: false,\n messages: {\n onlyExport:\n \"When exporting '{{expected}}', it must be the only export in this file.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for filename-matching export exclusivity checks.\",\n properties: {\n format: {\n description:\n \"Casing format used to derive expected export name from filename.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"export-matching-filename-only\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { resolve } from \"node:path\";\nimport { isDefined } from \"ts-extras\";\n\nimport { type Casing, filenameStem, toCasing } from \"../_internal/casing.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"mismatch\";\n\ntype Options = readonly [\n Readonly<{\n readonly format?: Casing;\n readonly match?: boolean;\n readonly prefix?: string;\n readonly selector?: readonly string[] | string;\n readonly suffix?: string;\n }>,\n];\n\nconst defaultSelectors = [\n \"ClassDeclaration > Identifier.id\",\n \"FunctionDeclaration > Identifier.id\",\n \"TSInterfaceDeclaration > Identifier.id\",\n \"TSTypeAliasDeclaration > Identifier.id\",\n] as const;\n\nconst normalizeSelector = (\n selector: Options[0][\"selector\"]\n): readonly string[] => {\n if (!isDefined(selector)) {\n return defaultSelectors;\n }\n\n if (typeof selector === \"string\") {\n return [selector];\n }\n\n return selector;\n};\n\n/**\n * Enforce that selected declaration identifiers match the current filename.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const selectorList = normalizeSelector(options.selector);\n let listeners: Readonly<\n Record<string, (node: Readonly<es.Node>) => void>\n > = {};\n\n for (const selector of selectorList) {\n listeners = {\n ...listeners,\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n context.filename === \"<input>\" ||\n node.type !== \"Identifier\"\n ) {\n return;\n }\n\n const stem = filenameStem(resolve(context.filename));\n const expected = `${options.prefix ?? \"\"}${toCasing(\n node.name,\n options.format ?? \"kebab-case\"\n )}${options.suffix ?? \"\"}`;\n const matches = stem === expected;\n\n if ((options.match ?? true) ? matches : !matches) {\n return;\n }\n\n context.report({\n data: {\n expected,\n },\n messageId: \"mismatch\",\n node,\n });\n },\n };\n }\n\n return listeners;\n },\n meta: {\n defaultOptions: [{ format: \"kebab-case\", match: true }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce selected declaration identifiers to match filename casing.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/match-filename\",\n },\n hasSuggestions: false,\n messages: {\n mismatch: \"Identifier should match filename '{{expected}}'.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for declaration-name to filename matching.\",\n properties: {\n format: {\n description:\n \"Casing format applied to declaration identifiers.\",\n enum: [\n \"camelCase\",\n \"kebab-case\",\n \"PascalCase\",\n ],\n type: \"string\",\n },\n match: {\n description:\n \"Whether declaration names must match (true) or must differ from (false) filename.\",\n type: \"boolean\",\n },\n prefix: {\n description:\n \"Prefix expected before transformed identifier.\",\n type: \"string\",\n },\n selector: {\n description:\n \"Selector(s) used to pick declaration identifiers to compare.\",\n oneOf: [\n {\n description: \"Single selector string.\",\n type: \"string\",\n },\n {\n description: \"Multiple selector strings.\",\n items: {\n description: \"Selector string.\",\n type: \"string\",\n },\n type: \"array\",\n },\n ],\n },\n suffix: {\n description:\n \"Suffix expected after transformed identifier.\",\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"match-filename\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { countIdentifierBlocks } from \"../_internal/identifier-blocks.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst maxIdentifierBlocks = 4;\n\nconst disallowedSelector = arrayJoin(\n [\"Identifier.id\", \":not(Property[shorthand=true]) > Identifier.key\"],\n \", \"\n);\n\n/**\n * Disallow identifiers containing more than four casing blocks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Identifier>): void => {\n if (countIdentifierBlocks(node.name) <= maxIdentifierBlocks) {\n return;\n }\n\n context.report({\n data: {\n max: maxIdentifierBlocks,\n },\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow identifiers with more than four casing blocks.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/max-identifier-blocks\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Identifier should not contain more than {{max}} blocks.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"max-identifier-blocks\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\nconst readonlyArrayTypeNames = new Set([\"ReadonlyArray\"]);\n\nconst isArrayLikeType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n const apparentType = typeChecker.getApparentType(type);\n\n return (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker) ||\n containsAllTypesByName(type, false, readonlyArrayTypeNames, true)\n );\n};\n\nconst creatorMethodNames = new Set([\n \"concat\",\n \"entries\",\n \"filter\",\n \"keys\",\n \"map\",\n \"slice\",\n \"splice\",\n \"values\",\n]);\n\nconst isArrayFactoryCallee = (callee: Readonly<es.Expression>): boolean => {\n if (callee.type === \"Identifier\") {\n return callee.name === \"Array\";\n }\n\n if (\n callee.type === \"MemberExpression\" &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"Array\" &&\n callee.property.type === \"Identifier\"\n ) {\n return callee.property.name === \"from\" || callee.property.name === \"of\";\n }\n\n return false;\n};\n\nconst isNewArray = (node: Readonly<es.Expression>): boolean => {\n if (node.type === \"ArrayExpression\") {\n return true;\n }\n\n if (node.type === \"CallExpression\") {\n return isArrayFactoryCallee(node.callee);\n }\n\n return false;\n};\n\nconst mutatesReferencedArray = (\n callExpression: Readonly<es.CallExpression>\n): boolean => {\n if (callExpression.callee.type !== \"MemberExpression\") {\n return true;\n }\n\n const { object, property } = callExpression.callee;\n\n if (\n property.type === \"Identifier\" &&\n setHas(creatorMethodNames, property.name)\n ) {\n return false;\n }\n\n if (isNewArray(object)) {\n return false;\n }\n\n if (object.type === \"CallExpression\") {\n return mutatesReferencedArray(object);\n }\n\n return true;\n};\n\n/**\n * Disallow assigning arrays returned by mutating methods like `fill`,\n * `reverse`, and `sort`.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name=/^(?:fill|reverse|sort)$/]\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\") {\n return;\n }\n\n const { property } = callee;\n if (property.type !== \"Identifier\") {\n return;\n }\n\n if (\n callExpression.parent?.type ===\n \"ExpressionStatement\"\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (!isArrayLikeType(typeChecker, objectType)) {\n return;\n }\n\n if (!mutatesReferencedArray(callExpression)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: property,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow assigning values returned from mutating array methods.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-assign-mutated-array\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Assignment of mutated arrays is forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-assign-mutated-array\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing exactly from `@`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"@\"],\n description: \"disallow imports from @.\",\n name: \"no-at-sign-import\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing internal module paths under `@/`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"@/**\"],\n description: \"disallow internal imports under @/.\",\n name: \"no-at-sign-internal-import\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"LogicalExpression[operator='??'][left.type='ChainExpression']\";\n\n/**\n * Disallow mixing optional chaining expressions directly with nullish\n * coalescing.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow mixing chain and coalescence operators in a single expression.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-chain-coalescence-mixture\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not mix optional chaining and nullish coalescing in the same expression.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-chain-coalescence-mixture\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport parser from \"@typescript-eslint/parser\";\nimport { arrayFirst, arrayJoin, isDefined, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype CommentBlock = Readonly<{\n readonly content: string;\n readonly loc: es.SourceLocation;\n}>;\n\ntype MessageIds = \"forbidden\";\n\nconst parserOptions: Readonly<{\n readonly ecmaVersion: \"latest\";\n readonly sourceType: \"module\";\n}> = {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n};\n\nconst parseCommentProgram = (\n cache: ReadonlyMap<string, es.Program | null>,\n content: string\n): readonly [\n ReadonlyMap<string, es.Program | null>,\n (\n es.Program | undefined\n ),\n] => {\n const cached = cache.get(content);\n if (cached !== undefined) {\n return [cache, cached ?? undefined];\n }\n\n try {\n const parsed = parser.parse(content, parserOptions);\n const nextCache = new Map(cache);\n nextCache.set(content, parsed);\n return [nextCache, parsed];\n } catch {\n const nextCache = new Map(cache);\n nextCache.set(content, null);\n return [nextCache, undefined];\n }\n};\n\nconst isRegionComment = (content: string): boolean => {\n const normalized = content.trimStart().toLowerCase();\n return (\n normalized.startsWith(\"#endregion\") || normalized.startsWith(\"#region\")\n );\n};\n\nconst stripLeadingAsterisk = (line: string): string => {\n const trimmedLine = line.trimStart();\n if (!trimmedLine.startsWith(\"*\")) {\n return line;\n }\n\n return trimmedLine.slice(1);\n};\n\nconst normalizeBlockCommentContent = (content: string): string =>\n arrayJoin(\n stringSplit(content, \"\\n\").map((line) => stripLeadingAsterisk(line)),\n \"\\n\"\n );\n\nconst toLocCopy = (loc: Readonly<es.SourceLocation>): es.SourceLocation => ({\n end: loc.end,\n start: loc.start,\n});\n\nconst toCommentBlocks = (\n comments: readonly Readonly<es.Comment>[]\n): readonly CommentBlock[] => {\n let blocks: readonly CommentBlock[] = [];\n let previousLineComment: es.LineComment | null = null;\n\n for (const comment of comments) {\n if (comment.type === \"Block\") {\n blocks = [\n ...blocks,\n {\n content: normalizeBlockCommentContent(comment.value),\n loc: toLocCopy(comment.loc),\n },\n ];\n previousLineComment = null;\n continue;\n }\n\n const previousBlockIndex =\n previousLineComment?.loc.start.line === comment.loc.start.line - 1\n ? blocks.length - 1\n : -1;\n const previousBlock =\n previousBlockIndex >= 0 ? blocks[previousBlockIndex] : undefined;\n\n blocks = isDefined(previousBlock)\n ? [\n ...blocks.slice(0, previousBlockIndex),\n {\n content: `${previousBlock.content}\\n${comment.value}`,\n loc: {\n end: comment.loc.end,\n start: previousBlock.loc.start,\n },\n },\n ...blocks.slice(previousBlockIndex + 1),\n ]\n : [\n ...blocks,\n {\n content: comment.value,\n loc: toLocCopy(comment.loc),\n },\n ];\n\n previousLineComment = comment;\n }\n\n return blocks;\n};\n\nconst isExpressionOrIdentifierOrLiteral = (\n node: Readonly<es.Node>\n): boolean => {\n if (node.type === \"Identifier\" || node.type === \"Literal\") {\n return true;\n }\n\n if (node.type !== \"BinaryExpression\") {\n return false;\n }\n\n return (\n isExpressionOrIdentifierOrLiteral(node.left) &&\n isExpressionOrIdentifierOrLiteral(node.right)\n );\n};\n\nconst isTrivialProgram = (program: Readonly<es.Program>): boolean => {\n if (program.body.length === 0) {\n return true;\n }\n\n if (\n program.body.length === 1 &&\n arrayFirst(program.body)?.type === \"LabeledStatement\"\n ) {\n return true;\n }\n\n return program.body.every(\n (statement) =>\n statement.type === \"ExpressionStatement\" &&\n isExpressionOrIdentifierOrLiteral(statement.expression)\n );\n};\n\nconst getWrappedContent = (\n content: string,\n node: null | Readonly<es.Node>\n): string | undefined => {\n if (node === null) {\n return undefined;\n }\n\n if (node.type === \"ArrayExpression\") {\n return `const wrapper = [${content}]`;\n }\n\n if (node.type === \"ClassBody\") {\n return `class Wrapper { ${content} }`;\n }\n\n if (node.type === \"FunctionDeclaration\") {\n return `function wrapper(${content}) {}`;\n }\n\n if (node.type === \"ImportDeclaration\") {\n return `import { ${content} } from \"wrapper\"`;\n }\n\n if (node.type === \"ObjectExpression\") {\n return `const wrapper = { ${content} }`;\n }\n\n if (node.type === \"SwitchStatement\") {\n return `switch (wrapper) { ${content} }`;\n }\n\n if (node.type === \"TSInterfaceBody\") {\n return `interface Wrapper { ${content} }`;\n }\n\n if (node.type === \"TSTypeLiteral\") {\n return `type Wrapper = { ${content} }`;\n }\n\n return undefined;\n};\n\n/**\n * Disallow comment blocks that appear to contain executable or declaration\n * code.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n let parseCache: ReadonlyMap<string, es.Program | null> = new Map<\n string,\n es.Program | null\n >();\n\n return {\n Program: () => {\n const { sourceCode } = context;\n\n for (const block of toCommentBlocks(\n sourceCode.getAllComments()\n )) {\n if (isRegionComment(block.content)) {\n continue;\n }\n\n const [nextCacheAfterParse, parsedComment] =\n parseCommentProgram(parseCache, block.content);\n parseCache = nextCacheAfterParse;\n if (parsedComment !== undefined) {\n if (!isTrivialProgram(parsedComment)) {\n context.report({\n loc: block.loc,\n messageId: \"forbidden\",\n });\n }\n\n continue;\n }\n\n const index = sourceCode.getIndexFromLoc(\n block.loc.start\n );\n const node = sourceCode.getNodeByRangeIndex(index);\n const wrappedContent = getWrappedContent(\n block.content,\n node\n );\n if (!isDefined(wrappedContent)) {\n continue;\n }\n\n const [\n nextCacheAfterWrappedParse,\n parsedWrappedComment,\n ] = parseCommentProgram(parseCache, wrappedContent);\n parseCache = nextCacheAfterWrappedParse;\n\n if (parsedWrappedComment !== undefined) {\n context.report({\n loc: block.loc,\n messageId: \"forbidden\",\n });\n }\n }\n },\n };\n },\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow commented-out code blocks.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-commented-out-code\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Commented-out code is forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-commented-out-code\",\n });\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of eslint-plugin-no-commented-code/no-commented-code.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"no-commented-code\",\n url: \"https://www.npmjs.com/package/eslint-plugin-no-commented-code\",\n },\n rule: {\n name: \"no-commented-code\",\n url: \"https://www.npmjs.com/package/eslint-plugin-no-commented-code\",\n },\n }),\n ],\n ruleId: \"no-commented-out-code\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveConst\";\n\ntype Options = readonly [\n {\n readonly allowLocal?: boolean;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\nconst isExportedEnumDeclaration = (\n node: Readonly<es.TSEnumDeclaration>\n): boolean => node.parent?.type === \"ExportNamedDeclaration\";\n\nconst getConstToken = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.TSEnumDeclaration>\n) =>\n sourceCode.getFirstToken(node, {\n filter: (token): boolean => token.value === \"const\",\n }) ?? undefined;\n\n/**\n * Disallow `const enum` declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSEnumDeclaration: (node: Readonly<es.TSEnumDeclaration>) => {\n if (!node.const) {\n return;\n }\n\n const [{ allowLocal = false } = {}] = context.options;\n if (allowLocal && !isExportedEnumDeclaration(node)) {\n return;\n }\n\n const constToken = getConstToken(sourceCode, node);\n const fix: TSESLint.ReportFixFunction | undefined =\n constToken === undefined\n ? undefined\n : (fixer) => {\n let removeEnd = constToken.range[1];\n while (\n removeEnd < sourceCode.text.length &&\n (sourceCode.text.at(removeEnd) === \" \" ||\n sourceCode.text.at(removeEnd) === \"\\t\")\n ) {\n removeEnd += 1;\n }\n\n return fixer.removeRange([\n arrayFirst(constToken.range),\n removeEnd,\n ]);\n };\n\n context.report({\n messageId: \"forbidden\",\n node: node.id,\n ...(fix === undefined\n ? {}\n : {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveConst\",\n },\n ],\n }),\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow const enum declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-const-enum\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"`const enum` declarations are forbidden.\",\n suggestRemoveConst:\n \"Remove the const modifier from this enum declaration.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for allowing non-exported const enum declarations.\",\n properties: {\n allowLocal: {\n description:\n \"Allow const enum declarations when they are not exported.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-const-enum\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined, isEmpty } from \"ts-extras\";\n\nimport {\n compileIgnorePatterns,\n type IgnoreMode,\n type IgnorePatternBuckets,\n} from \"../_internal/ignore-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport {\n getIdentifierSymbol,\n getJsDocTagComments,\n isDeclarationIdentifier,\n isImportOrExportSpecifier,\n matchesAnyPattern,\n} from \"../_internal/symbol-usage.js\";\n\ntype MessageIds = \"forbidden\" | \"forbiddenWithComment\" | \"invalidIgnorePattern\";\n\ntype Options = readonly [\n {\n readonly ignored?: Readonly<Record<string, IgnoreMode>>;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\n/**\n * Disallow usages of symbols tagged with `@deprecated`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ ignored = {} } = {}] = context.options;\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n const compiledIgnorePatterns = compileIgnorePatterns(ignored);\n const ignorePatterns: IgnorePatternBuckets =\n compiledIgnorePatterns.patterns;\n\n return {\n Identifier: (node: Readonly<es.Identifier>) => {\n if (isImportOrExportSpecifier(node.parent)) {\n return;\n }\n\n if (isDeclarationIdentifier(node)) {\n return;\n }\n\n const symbol = getIdentifierSymbol(parserServices, node);\n if (!isDefined(symbol)) {\n return;\n }\n\n const symbolName = symbol.getName();\n if (matchesAnyPattern(symbolName, ignorePatterns.name)) {\n return;\n }\n\n const fullyQualifiedName =\n typeChecker.getFullyQualifiedName(symbol);\n if (\n matchesAnyPattern(fullyQualifiedName, ignorePatterns.path)\n ) {\n return;\n }\n\n const deprecatedComments = getJsDocTagComments(\n symbol,\n typeChecker,\n \"deprecated\"\n );\n if (isEmpty(deprecatedComments)) {\n return;\n }\n\n for (const comment of deprecatedComments) {\n if (!isDefined(comment)) {\n context.report({\n data: { name: symbolName },\n messageId: \"forbidden\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n comment,\n name: symbolName,\n },\n messageId: \"forbiddenWithComment\",\n node,\n });\n }\n },\n Program: (node: Readonly<es.Program>) => {\n for (const invalidPattern of compiledIgnorePatterns.invalidPatterns) {\n context.report({\n data: {\n pattern: invalidPattern,\n },\n messageId: \"invalidIgnorePattern\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow usage of APIs tagged with @deprecated.\",\n frozen: true,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-deprecated\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: '\"{{name}}\" is deprecated.',\n forbiddenWithComment: '\"{{name}}\" is deprecated: {{comment}}',\n invalidIgnorePattern:\n \"Invalid ignored regex pattern '{{pattern}}'. Update this rule option to a valid regular expression.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for ignoring deprecated symbols by name or declaration path pattern.\",\n properties: {\n ignored: {\n additionalProperties: {\n description:\n 'Match behavior for the pattern key. Use \"name\" to match symbol names or \"path\" to match fully-qualified declaration paths.',\n enum: [\"name\", \"path\"],\n type: \"string\",\n },\n description: \"Map of regex patterns to ignore mode.\",\n type: \"object\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-deprecated\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-deprecated.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-deprecated\",\n url: \"https://typescript-eslint.io/rules/no-deprecated\",\n },\n }),\n ],\n ruleId: \"no-deprecated\",\n});\n\nexport default deprecatedRule;\n", "import { objectEntries } from \"ts-extras\";\n\n/**\n * Compiled ignore-pattern result grouped by mode with invalid entries tracked.\n */\nexport type CompiledIgnorePatterns = Readonly<{\n readonly invalidPatterns: readonly string[];\n readonly patterns: IgnorePatternBuckets;\n}>;\n\n/**\n * Supported matching modes for symbol-ignore configuration.\n */\nexport type IgnoreMode = \"name\" | \"path\";\n\n/**\n * Compiled regex buckets for name- and path-based ignores.\n */\nexport type IgnorePatternBuckets = Readonly<{\n readonly name: readonly RegExp[];\n readonly path: readonly RegExp[];\n}>;\n\n/* eslint-disable security/detect-non-literal-regexp -- Rule options intentionally accept user-provided regex strings. */\n/**\n * Compile ignore-option regex patterns into mode buckets.\n *\n * Invalid regex patterns are returned for caller-side reporting so rule\n * configuration issues are never swallowed silently.\n */\nexport const compileIgnorePatterns = (\n ignored: Readonly<Record<string, IgnoreMode>>\n): CompiledIgnorePatterns => {\n let namePatterns: readonly RegExp[] = [];\n let pathPatterns: readonly RegExp[] = [];\n let invalidPatterns: readonly string[] = [];\n\n for (const [pattern, mode] of objectEntries(ignored)) {\n try {\n const regularExpression = new RegExp(pattern, \"u\");\n if (mode === \"name\") {\n namePatterns = [...namePatterns, regularExpression];\n } else {\n pathPatterns = [...pathPatterns, regularExpression];\n }\n } catch {\n invalidPatterns = [...invalidPatterns, pattern];\n }\n }\n\n return {\n invalidPatterns,\n patterns: {\n name: namePatterns,\n path: pathPatterns,\n },\n };\n};\n/* eslint-enable security/detect-non-literal-regexp -- Re-enable dynamic-regex checks outside option pattern compilation. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\nimport type { UnknownRecord } from \"type-fest\";\n\nimport { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { arrayJoin, isDefined, keyIn } from \"ts-extras\";\n\ntype JsDocTagInfo = Readonly<{\n readonly name: string;\n readonly text?: readonly JsDocTagTextPart[] | string;\n}>;\n\ntype JsDocTagTextPart = Readonly<{ readonly text: string }>;\n\ntype ParserServices = Readonly<\n Parameters<typeof getConstrainedTypeAtLocation>[0]\n>;\n\ntype SymbolWithJsDocTags = Readonly<{\n readonly getJsDocTags: (checker?: unknown) => readonly JsDocTagInfo[];\n}>;\n\n/**\n * Whether an identifier belongs to an import/export specifier position.\n */\nexport const isImportOrExportSpecifier = (\n parent: Readonly<es.Node> | undefined\n): boolean =>\n parent?.type === \"ExportSpecifier\" ||\n parent?.type === \"ImportDefaultSpecifier\" ||\n parent?.type === \"ImportNamespaceSpecifier\" ||\n parent?.type === \"ImportSpecifier\";\n\n/**\n * Whether an identifier is the declaration identifier for supported node types.\n */\nexport const isDeclarationIdentifier = (\n node: Readonly<es.Identifier>\n): boolean => {\n const { parent } = node;\n if (parent === undefined) {\n return false;\n }\n\n if (\n parent.type === \"TSInterfaceDeclaration\" ||\n parent.type === \"TSTypeAliasDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (\n parent.type === \"ClassDeclaration\" ||\n parent.type === \"FunctionDeclaration\" ||\n parent.type === \"TSDeclareFunction\" ||\n parent.type === \"TSEnumDeclaration\"\n ) {\n return parent.id === node;\n }\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id === node;\n }\n\n return false;\n};\n\nconst normalizeTagComment = (\n text: readonly JsDocTagTextPart[] | string | undefined\n): string | undefined => {\n if (!isDefined(text)) {\n return undefined;\n }\n\n if (typeof text === \"string\") {\n const normalized = text.trim().replaceAll(/\\s+/gu, \" \");\n return normalized.length > 0 ? normalized : undefined;\n }\n\n const normalized = arrayJoin(\n text.map((part) => part.text),\n \"\"\n )\n .replaceAll(/\\s+/gu, \" \")\n .trim();\n\n return normalized.length > 0 ? normalized : undefined;\n};\n\nconst isUnknownRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null;\n\nconst isSymbolWithJsDocTags = (\n symbol: unknown\n): symbol is SymbolWithJsDocTags => {\n if (!isUnknownRecord(symbol)) {\n return false;\n }\n\n if (!keyIn(symbol, \"getJsDocTags\")) {\n return false;\n }\n\n return typeof symbol[\"getJsDocTags\"] === \"function\";\n};\n\n/**\n * Collect normalized comment payloads for a specific JSDoc tag name.\n */\nexport const getJsDocTagComments = (\n symbol: unknown,\n checker: unknown,\n tagName: string\n): readonly (string | undefined)[] => {\n if (!isSymbolWithJsDocTags(symbol)) {\n return [];\n }\n\n const tags = symbol.getJsDocTags();\n const resolvedTags = tags.length > 0 ? tags : symbol.getJsDocTags(checker);\n\n return resolvedTags\n .filter((tag) => tag.name === tagName)\n .map((tag) => normalizeTagComment(tag.text));\n};\n\n/**\n * Return true when text matches any compiled regex pattern.\n */\nexport const matchesAnyPattern = (\n text: string,\n patterns: readonly Readonly<RegExp>[]\n): boolean => patterns.some((pattern) => pattern.test(text));\n\n/**\n * Resolve the symbol at identifier location, falling back to constrained type.\n */\nexport const getIdentifierSymbol = (\n parserServices: ParserServices,\n node: Readonly<es.Identifier>\n): ReturnType<ParserServices[\"getSymbolAtLocation\"]> | undefined => {\n const symbolFromLocation = parserServices.getSymbolAtLocation(node);\n if (isDefined(symbolFromLocation)) {\n return symbolFromLocation;\n }\n\n return getConstrainedTypeAtLocation(parserServices, node).getSymbol();\n};\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\n/**\n * Disallow TypeScript enum declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => ({\n TSEnumDeclaration: (node: Readonly<es.TSEnumDeclaration>) => {\n context.report({\n messageId: \"forbidden\",\n node: node.id,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow TypeScript enum declarations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-enum\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"`enum` declarations are forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-enum\",\n });\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, stringSplit } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst splitLines = (sourceText: string): readonly string[] =>\n stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n\nconst hasBlankLine = (text: string): boolean =>\n splitLines(text).some((line) => line.trim().length === 0);\n\nconst normalizeExpressionSource = (sourceText: string): string => {\n const lines = splitLines(sourceText).map((line) => line.trimEnd());\n\n return arrayJoin(\n lines.filter((line) => line.trim().length > 0),\n \"\\n\"\n );\n};\n\nconst createFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.ExpressionStatement>\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const sourceText = sourceCode.getText(node.expression);\n const replacement = `${normalizeExpressionSource(sourceText)};`;\n\n return fixer.replaceText(node, replacement);\n };\n\n/**\n * Disallow blank lines inside expression statements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ExpressionStatement: (node: Readonly<es.ExpressionStatement>): void => {\n const sourceText = context.sourceCode.getText(node.expression);\n if (!hasBlankLine(sourceText)) {\n return;\n }\n\n context.report({\n fix: createFix(context.sourceCode, node),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow blank lines inside expression statements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-expression-empty-lines\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Expression statement contains unnecessary blank lines.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-expression-empty-lines\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [\n {\n readonly types?: readonly string[];\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\nconst defaultTypes: readonly string[] = [\n \"Array\",\n \"Map\",\n \"NodeList\",\n \"Set\",\n];\n\nconst getConfiguredTypeNames = (\n configuredTypes: readonly string[]\n): ReadonlySet<string> => {\n const typeNames = new Set<string>();\n\n for (const configuredType of configuredTypes) {\n typeNames.add(configuredType);\n if (configuredType === \"Array\") {\n typeNames.add(\"ReadonlyArray\");\n }\n }\n\n return typeNames;\n};\n\nconst matchesConfiguredCollectionType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>,\n configuredTypeNames: ReadonlySet<string>\n): boolean => {\n if (setHas(configuredTypeNames, \"Array\")) {\n const apparentType = typeChecker.getApparentType(type);\n\n if (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker)\n ) {\n return true;\n }\n }\n\n return containsAllTypesByName(\n type,\n false,\n new Set(configuredTypeNames),\n true\n );\n};\n\n/**\n * Disallow calling `forEach` on configured collection types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n const [{ types = defaultTypes } = {}] = context.options;\n const configuredTypeNames = getConfiguredTypeNames(types);\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='forEach']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\") {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (\n !matchesConfiguredCollectionType(\n typeChecker,\n objectType,\n configuredTypeNames\n )\n ) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: callee.property,\n });\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow calling forEach on configured collection types.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-foreach\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Calling `forEach` is forbidden for this type.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for collection type names that are not allowed to use forEach.\",\n properties: {\n types: {\n description:\n \"Type names to disallow forEach on (for example Array, Map, NodeList, Set).\",\n items: {\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-foreach\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Returns true if the given node is a `BlockStatement` or a `Program` \u2014 i.e., a\n * node that has a `body` array of `Statement` nodes.\n */\nconst isStatementList = (\n node: Readonly<es.Node>\n): node is es.BlockStatement | es.Program =>\n node.type === \"BlockStatement\" || node.type === \"Program\";\n\nconst getLineStartIndex = (sourceText: string, index: number): number =>\n sourceText.lastIndexOf(\"\\n\", index - 1) + 1;\n\nconst getSafeFixRangeStart = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.FunctionDeclaration>\n): number => {\n const declarationStart = arrayFirst(node.range) ?? 0;\n const tokenBeforeDeclaration = sourceCode.getTokenBefore(node);\n const tokenBeforeEnd =\n tokenBeforeDeclaration === null\n ? 0\n : (arrayLast(tokenBeforeDeclaration.range) ?? 0);\n\n const commentsBeforeDeclaration = sourceCode\n .getCommentsBefore(node)\n .filter(\n (comment) =>\n (arrayFirst(comment.range) ?? 0) >= tokenBeforeEnd &&\n (arrayLast(comment.range) ?? 0) <= declarationStart\n );\n\n const firstLeadingComment = arrayFirst(commentsBeforeDeclaration);\n const firstMovableNodeStart =\n firstLeadingComment === undefined\n ? declarationStart\n : (arrayFirst(firstLeadingComment.range) ?? declarationStart);\n\n return getLineStartIndex(sourceCode.text, firstMovableNodeStart);\n};\n\nconst getSafeFixRangeEnd = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.FunctionDeclaration>\n): number => {\n const declarationEnd = arrayLast(node.range) ?? 0;\n const tokenAfterDeclaration = sourceCode.getTokenAfter(node);\n\n if (tokenAfterDeclaration === null) {\n return declarationEnd;\n }\n\n return getLineStartIndex(\n sourceCode.text,\n arrayFirst(tokenAfterDeclaration.range) ?? declarationEnd\n );\n};\n\n/**\n * Disallow function declarations that appear after a `return` statement in the\n * same block scope.\n *\n * JavaScript hoists function declarations to the top of their enclosing scope,\n * so placing a function declaration after a `return` works at runtime. However,\n * it hurts readability and confuses readers who are not aware of hoisting.\n *\n * Only `FunctionDeclaration` nodes are targeted. Arrow-function expressions,\n * function expressions assigned to variables, and any code that is genuinely\n * unreachable are not in scope for this rule \u2014 `no-unreachable` already covers\n * that case.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ReturnStatement(node: Readonly<es.ReturnStatement>): void {\n const parent = node.parent;\n\n // Only check return statements that live directly inside a block\n // (`BlockStatement`) or at the top level of a script/module\n // (`Program`). Return statements inside a `SwitchCase` consequent\n // do not have a traditional `body` array, so skip them.\n if (!isStatementList(parent)) {\n return;\n }\n\n const siblings = parent.body;\n const returnIndex = siblings.indexOf(node);\n\n // Scan every statement that follows this return in the same block.\n for (let i = returnIndex + 1; i < siblings.length; i++) {\n const sibling = siblings[i];\n\n if (sibling?.type !== \"FunctionDeclaration\") {\n continue;\n }\n\n // Capture in closure for the fix function.\n const functionDeclaration = sibling;\n const returnStatement = node;\n\n context.report({\n data: {\n name: functionDeclaration.id?.name ?? \"(anonymous)\",\n },\n fix(fixer) {\n const sourceCode = context.sourceCode;\n\n // Text of the function declaration to move.\n const declarationEnd =\n arrayLast(functionDeclaration.range) ?? 0;\n const fixRangeStart = getSafeFixRangeStart(\n sourceCode,\n functionDeclaration\n );\n const fixRangeEnd = getSafeFixRangeEnd(\n sourceCode,\n functionDeclaration\n );\n const functionAndLeadingCommentsText =\n sourceCode.text.slice(\n fixRangeStart,\n declarationEnd\n );\n\n if (\n functionAndLeadingCommentsText.trim().length === 0\n ) {\n return null;\n }\n\n // We want to insert before the return statement.\n // Determine the correct indentation by looking at the\n // token that starts the return statement.\n const returnToken =\n sourceCode.getFirstToken(returnStatement);\n const indentationEnd =\n arrayFirst(returnToken?.range ?? [0]) ?? 0;\n const returnLineStart = getLineStartIndex(\n sourceCode.text,\n indentationEnd\n );\n\n return [\n fixer.insertTextBeforeRange(\n [returnLineStart, returnLineStart],\n `${functionAndLeadingCommentsText}\\n`\n ),\n fixer.removeRange([fixRangeStart, fixRangeEnd]),\n ];\n },\n messageId: \"forbidden\",\n node: functionDeclaration,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow function declarations after a return statement.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-function-declare-after-return\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Function declaration '{{name}}' should be moved before the return statement for readability.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-function-declare-after-return\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isPromiseLike,\n} from \"@typescript-eslint/type-utils\";\nimport {\n type TSESTree as es,\n ESLintUtils,\n type TSESLint,\n} from \"@typescript-eslint/utils\";\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds =\n | \"explicitAny\"\n | \"implicitAny\"\n | \"narrowed\"\n | \"suggestExplicitUnknown\";\n\ntype Options = readonly [RuleOptions?];\n\ntype RuleOptions = Readonly<{\n readonly allowExplicitAny?: boolean;\n}>;\n\ntype TypedProgram = NonNullable<\n ReturnType<typeof ESLintUtils.getParserServices>[\"program\"]\n>;\n\nconst defaultOptions: Options = [{}];\n\nconst isPromiseRejectionCall = (\n callExpression: Readonly<es.CallExpression>,\n parserServices: Readonly<\n Parameters<typeof getConstrainedTypeAtLocation>[0]\n >,\n program: TypedProgram\n): boolean => {\n const { callee } = callExpression;\n if (callee.type !== \"MemberExpression\" || callee.object.type === \"Super\") {\n return false;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n\n return isPromiseLike(program, objectType);\n};\n\nconst isParenthesized = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const tokenBefore = sourceCode.getTokenBefore(node);\n const tokenAfter = sourceCode.getTokenAfter(node);\n if (tokenBefore === null || tokenAfter === null) {\n return false;\n }\n\n return (\n tokenBefore.value === \"(\" &&\n tokenBefore.range[1] <= arrayFirst(node.range) &&\n tokenAfter.value === \")\" &&\n arrayFirst(tokenAfter.range) >= node.range[1]\n );\n};\n\nconst replaceWithUnknownFix = (\n fixer: TSESLint.RuleFixer,\n typeAnnotation: Readonly<es.TSTypeAnnotation>\n): TSESLint.RuleFix => fixer.replaceText(typeAnnotation, \": unknown\");\n\nconst annotateImplicitParamFixes = (\n fixer: TSESLint.RuleFixer,\n sourceCode: Readonly<TSESLint.SourceCode>,\n parameter: Readonly<es.Identifier>\n): readonly TSESLint.RuleFix[] => {\n if (isParenthesized(sourceCode, parameter)) {\n return [fixer.insertTextAfter(parameter, \": unknown\")];\n }\n\n return [\n fixer.insertTextBefore(parameter, \"(\"),\n fixer.insertTextAfter(parameter, \": unknown)\"),\n ];\n};\n\n/**\n * Require explicit `unknown` (or optionally `any`) for Promise rejection\n * callbacks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const sourceCode = context.sourceCode;\n const [{ allowExplicitAny = false } = {}] = context.options;\n\n const checkRejectionCallback = (\n callExpression: Readonly<es.CallExpression>,\n callback: Readonly<es.CallExpressionArgument>\n ): void => {\n if (\n callback.type !== \"ArrowFunctionExpression\" &&\n callback.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const [parameter] = callback.params;\n if (parameter?.type !== \"Identifier\") {\n return;\n }\n\n if (\n !isPromiseRejectionCall(\n callExpression,\n parserServices,\n parserServices.program\n )\n ) {\n return;\n }\n\n if (parameter.typeAnnotation === undefined) {\n context.report({\n fix: (fixer) =>\n annotateImplicitParamFixes(\n fixer,\n sourceCode,\n parameter\n ),\n messageId: \"implicitAny\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n annotateImplicitParamFixes(\n fixer,\n sourceCode,\n parameter\n ),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n return;\n }\n\n const { typeAnnotation } = parameter;\n const annotationType = typeAnnotation.typeAnnotation.type;\n if (annotationType === \"TSUnknownKeyword\") {\n return;\n }\n\n if (annotationType === \"TSAnyKeyword\") {\n if (allowExplicitAny) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"explicitAny\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n return;\n }\n\n context.report({\n messageId: \"narrowed\",\n node: parameter,\n suggest: [\n {\n fix: (fixer) =>\n replaceWithUnknownFix(fixer, typeAnnotation),\n messageId: \"suggestExplicitUnknown\",\n },\n ],\n });\n };\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='catch']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const [callback] = callExpression.arguments;\n if (callback !== undefined) {\n checkRejectionCallback(callExpression, callback);\n }\n },\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='then']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const callback = callExpression.arguments[1];\n if (callback !== undefined) {\n checkRejectionCallback(callExpression, callback);\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit unknown for Promise rejection callback parameters.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n suggestion: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-implicit-any-catch\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n explicitAny: \"Explicit `any` in Promise rejection callback.\",\n implicitAny: \"Implicit `any` in Promise rejection callback.\",\n narrowed:\n \"Error type in Promise rejection callback must be `unknown` or `any`.\",\n suggestExplicitUnknown:\n \"Use `unknown` to force safe, explicit narrowing before access.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for Promise rejection callback annotation enforcement.\",\n properties: {\n allowExplicitAny: {\n description:\n \"Whether an explicit `any` annotation is allowed for rejection callback parameters.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"no-implicit-any-catch\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing from \".\".\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\".\"],\n description: \"disallow imports from the current directory root (.).\",\n name: \"no-index-import\",\n });\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing nested internal module paths.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\n \"./*/**\",\n \"[^@]*/**\",\n \"@?*/*/**\",\n ],\n description: \"disallow importing internal modules.\",\n name: \"no-internal-modules\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined, isEmpty } from \"ts-extras\";\n\nimport {\n compileIgnorePatterns,\n type IgnoreMode,\n type IgnorePatternBuckets,\n} from \"../_internal/ignore-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n getIdentifierSymbol,\n getJsDocTagComments,\n isDeclarationIdentifier,\n isImportOrExportSpecifier,\n matchesAnyPattern,\n} from \"../_internal/symbol-usage.js\";\n\ntype MessageIds = \"forbidden\" | \"forbiddenWithComment\" | \"invalidIgnorePattern\";\n\ntype Options = readonly [\n {\n readonly ignored?: Readonly<Record<string, IgnoreMode>>;\n }?,\n];\n\nconst defaultOptions: Options = [{}];\n\n/**\n * Disallow usages of symbols tagged with `@internal`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ ignored = {} } = {}] = context.options;\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n const compiledIgnorePatterns = compileIgnorePatterns(ignored);\n const ignorePatterns: IgnorePatternBuckets =\n compiledIgnorePatterns.patterns;\n\n return {\n Identifier: (node: Readonly<es.Identifier>) => {\n if (isImportOrExportSpecifier(node.parent)) {\n return;\n }\n\n if (isDeclarationIdentifier(node)) {\n return;\n }\n\n const symbol = getIdentifierSymbol(parserServices, node);\n if (!isDefined(symbol)) {\n return;\n }\n\n const symbolName = symbol.getName();\n if (matchesAnyPattern(symbolName, ignorePatterns.name)) {\n return;\n }\n\n const fullyQualifiedName =\n typeChecker.getFullyQualifiedName(symbol);\n if (\n matchesAnyPattern(fullyQualifiedName, ignorePatterns.path)\n ) {\n return;\n }\n\n const internalComments = getJsDocTagComments(\n symbol,\n typeChecker,\n \"internal\"\n );\n if (isEmpty(internalComments)) {\n return;\n }\n\n for (const comment of internalComments) {\n if (!isDefined(comment)) {\n context.report({\n data: { name: symbolName },\n messageId: \"forbidden\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n comment,\n name: symbolName,\n },\n messageId: \"forbiddenWithComment\",\n node,\n });\n }\n },\n Program: (node: Readonly<es.Program>) => {\n for (const invalidPattern of compiledIgnorePatterns.invalidPatterns) {\n context.report({\n data: {\n pattern: invalidPattern,\n },\n messageId: \"invalidIgnorePattern\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow usage of APIs tagged with @internal.\",\n frozen: false,\n recommended: true,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-internal\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: '\"{{name}}\" is internal.',\n forbiddenWithComment: '\"{{name}}\" is internal: {{comment}}',\n invalidIgnorePattern:\n \"Invalid ignored regex pattern '{{pattern}}'. Update this rule option to a valid regular expression.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for ignoring some internal symbols by name or declaration path pattern.\",\n properties: {\n ignored: {\n additionalProperties: {\n description:\n 'Match behavior for the pattern key. Use \"name\" to match symbol names or \"path\" to match fully-qualified declaration paths.',\n enum: [\"name\", \"path\"],\n type: \"string\",\n },\n description: \"Map of regex patterns to ignore mode.\",\n type: \"object\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-internal\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst languageMixPattern = String.raw`/\\w[\\d_]*[^\\u0000-\\xff]|[^\\u0000-\\xff][\\d_]*\\w/u`;\nconst disallowedSelector = arrayJoin(\n [\n `Literal[value=${languageMixPattern}]`,\n `TemplateElement[value.raw=${languageMixPattern}]`,\n ],\n \", \"\n);\n\n/**\n * Disallow mixing latin and non-latin letters within the same token.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow mixed-language tokens combining latin and non-latin letters.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-language-mixing\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Do not mix languages in a single token.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-language-mixing\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\nimport type * as ts from \"typescript\";\n\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"cannotInfer\" | \"canReplace\";\n\ntype Options = readonly [];\n\ntype TypeParameterUsageAnalysis = {\n readonly appearsInMultipleParameters: boolean;\n readonly usedInParameters: boolean;\n readonly usedInReturnOrExtends: boolean;\n};\n\ntype VariableInfo = NonNullable<ReturnType<VariableUsageMap[\"get\"]>>;\n\ntype VariableUsageMap = ReturnType<typeof tsutils.collectVariableUsage>;\n\ntype VariableUse = VariableInfo[\"uses\"][number];\n\nconst getVariableUses = (\n usageMap: Readonly<VariableUsageMap>,\n identifier: Readonly<ts.Identifier>\n): readonly VariableUse[] => usageMap.get(identifier)?.uses ?? [];\n\nconst toReportLocation = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n sourceFile: Readonly<ts.SourceFile>,\n node: Readonly<ts.Node>\n): es.SourceLocation => {\n const start = sourceCode.getLocFromIndex(node.getStart(sourceFile));\n const end = sourceCode.getLocFromIndex(node.getEnd());\n\n return {\n end: {\n column: end.column,\n line: end.line,\n },\n start: {\n column: start.column,\n line: start.line,\n },\n } satisfies es.SourceLocation;\n};\n\nconst isTypeUseInsideConstraint = (\n useLocation: Readonly<ts.Identifier>,\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[]\n): boolean =>\n typeParameters.some((typeParameter) => {\n const { constraint } = typeParameter;\n if (!isDefined(constraint)) {\n return false;\n }\n\n return (\n useLocation.pos >= constraint.pos &&\n useLocation.pos < constraint.end\n );\n });\n\nconst isConstrainedByAnotherTypeParameter = (\n currentTypeParameter: Readonly<ts.TypeParameterDeclaration>,\n allTypeParameters: readonly Readonly<ts.TypeParameterDeclaration>[],\n usageMap: Readonly<VariableUsageMap>\n): boolean => {\n const { constraint } = currentTypeParameter;\n if (!isDefined(constraint)) {\n return false;\n }\n\n return allTypeParameters.some((otherTypeParameter) => {\n if (otherTypeParameter === currentTypeParameter) {\n return false;\n }\n\n const uses = getVariableUses(usageMap, otherTypeParameter.name);\n\n return uses.some(\n (use) =>\n use.location.pos >= constraint.pos &&\n use.location.pos < constraint.end\n );\n });\n};\n\nconst isUseWithinParameterRange = (\n usePosition: number,\n signature: Readonly<ts.SignatureDeclaration>\n): boolean =>\n usePosition > signature.parameters.pos &&\n usePosition < signature.parameters.end;\n\nconst getTypeParameterReplacement = (\n sourceFile: Readonly<ts.SourceFile>,\n typeParameter: Readonly<ts.TypeParameterDeclaration>\n): string => {\n const { constraint } = typeParameter;\n if (!isDefined(constraint)) {\n return \"unknown\";\n }\n\n return constraint.getText(sourceFile);\n};\n\nconst analyzeTypeParameterUses = (\n uses: readonly Readonly<VariableUse>[],\n signature: Readonly<ts.SignatureDeclaration>,\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[]\n): TypeParameterUsageAnalysis => {\n let appearsInMultipleParameters = false;\n let usedInParameters = false;\n let usedInReturnOrExtends = tsutils.isFunctionWithBody(signature);\n\n for (const use of uses) {\n if (isUseWithinParameterRange(use.location.pos, signature)) {\n if (usedInParameters) {\n appearsInMultipleParameters = true;\n break;\n }\n\n usedInParameters = true;\n continue;\n }\n\n if (usedInReturnOrExtends) {\n continue;\n }\n\n usedInReturnOrExtends =\n use.location.pos > signature.parameters.end ||\n isTypeUseInsideConstraint(use.location, typeParameters);\n }\n\n return {\n appearsInMultipleParameters,\n usedInParameters,\n usedInReturnOrExtends,\n };\n};\n\n/**\n * Disallow type parameters that cannot be inferred or do not enforce\n * constraints.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n let usageMap: null | VariableUsageMap = null;\n\n const checkTypeParameters = (\n typeParameters: readonly Readonly<ts.TypeParameterDeclaration>[],\n signature: Readonly<ts.SignatureDeclaration>\n ): void => {\n usageMap ??= tsutils.collectVariableUsage(\n signature.getSourceFile()\n );\n\n const sourceFile = signature.getSourceFile();\n\n for (const typeParameter of typeParameters) {\n const uses = getVariableUses(usageMap, typeParameter.name);\n const usageAnalysis = analyzeTypeParameterUses(\n uses,\n signature,\n typeParameters\n );\n\n if (usageAnalysis.appearsInMultipleParameters) {\n continue;\n }\n\n if (!usageAnalysis.usedInParameters) {\n context.report({\n data: {\n name: typeParameter.name.text,\n },\n loc: toReportLocation(\n context.sourceCode,\n sourceFile,\n typeParameter\n ),\n messageId: \"cannotInfer\",\n });\n continue;\n }\n\n if (\n !usageAnalysis.usedInReturnOrExtends &&\n usageMap !== null &&\n !isConstrainedByAnotherTypeParameter(\n typeParameter,\n typeParameters,\n usageMap\n )\n ) {\n context.report({\n data: {\n name: typeParameter.name.text,\n replacement: getTypeParameterReplacement(\n sourceFile,\n typeParameter\n ),\n },\n loc: toReportLocation(\n context.sourceCode,\n sourceFile,\n typeParameter\n ),\n messageId: \"canReplace\",\n });\n }\n }\n };\n\n const checkSignature = (node: Readonly<es.Node>): void => {\n const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);\n if (\n !tsutils.isSignatureDeclaration(tsNode) ||\n !isDefined(tsNode.typeParameters)\n ) {\n return;\n }\n\n checkTypeParameters(tsNode.typeParameters, tsNode);\n };\n\n return {\n ArrowFunctionExpression: checkSignature,\n FunctionDeclaration: checkSignature,\n FunctionExpression: checkSignature,\n MethodDefinition: checkSignature,\n \"Program:exit\": () => {\n usageMap = null;\n },\n TSCallSignatureDeclaration: checkSignature,\n TSConstructorType: checkSignature,\n TSConstructSignatureDeclaration: checkSignature,\n TSDeclareFunction: checkSignature,\n TSFunctionType: checkSignature,\n TSIndexSignature: checkSignature,\n TSMethodSignature: checkSignature,\n TSPropertySignature: checkSignature,\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow type parameters that cannot be inferred or do not enforce constraints.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-misused-generics\",\n },\n hasSuggestions: false,\n messages: {\n cannotInfer:\n \"Type parameter '{{name}}' cannot be inferred from any parameter.\",\n canReplace:\n \"Type parameter '{{name}}' does not enforce a relation between types and can be replaced with '{{replacement}}'.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-misused-generics\",\n});\n\nexport default rule;\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-mixed-enums\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-mixed-enums\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-mixed-enums.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-mixed-enums\",\n url: \"https://typescript-eslint.io/rules/no-mixed-enums\",\n },\n }),\n ],\n ruleId: \"no-mixed-enums\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelectors: readonly string[] = [\n 'IfStatement > BinaryExpression[operator=\"!==\"]',\n 'IfStatement > UnaryExpression[operator=\"!\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"&&\"] > BinaryExpression.left[operator=\"!==\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"&&\"] > UnaryExpression.left[operator=\"!\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"||\"] > BinaryExpression[operator=\"!==\"]',\n ':not(LogicalExpression) > LogicalExpression[operator=\"||\"] > UnaryExpression[operator=\"!\"]',\n];\n\n/**\n * Disallow negated conditions in `if` and top-level logical expressions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [arrayJoin(disallowedSelectors, \", \")]: (\n node: Readonly<es.Node>\n ): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow negated conditions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-negated-conditions\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Negated conditions are forbidden.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-negated-conditions\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow importing Node.js built-in modules via the `node:` protocol.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"node:*\"],\n description: \"disallow imports from node: built-in module specifiers.\",\n name: \"no-nodejs-modules\",\n });\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\ntype Scope = TSESLint.Scope.Scope;\n\ntype SourceCode = TSESLint.SourceCode;\n\ntype Variable = TSESLint.Scope.Variable;\n\nconst getAssignmentTargetIdentifier = (\n node: Readonly<es.AssignmentExpression>\n): Readonly<es.Identifier> | undefined => {\n if (node.left.type === \"Identifier\") {\n return node.left;\n }\n\n return undefined;\n};\n\nconst getScopeVariable = (\n sourceCode: Readonly<SourceCode>,\n identifier: Readonly<es.Identifier>\n): Readonly<Variable> | undefined => {\n let scope: null | Scope = sourceCode.getScope(identifier);\n\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) {\n return variable;\n }\n\n scope = scope.upper;\n }\n\n return undefined;\n};\n\nconst isParameterVariable = (\n variable: Readonly<Variable> | undefined\n): boolean =>\n variable?.defs.some((definition) => definition.type === \"Parameter\") ??\n false;\n\nconst isInFirstFunctionExpressionStatement = (\n sourceCode: Readonly<SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const ancestors = sourceCode.getAncestors(node);\n let enclosingFunction:\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression\n | null = null;\n\n for (let index = ancestors.length - 1; index >= 0; index -= 1) {\n const ancestor = ancestors[index];\n if (ancestor === undefined) {\n continue;\n }\n\n if (\n ancestor.type === \"ArrowFunctionExpression\" ||\n ancestor.type === \"FunctionDeclaration\" ||\n ancestor.type === \"FunctionExpression\"\n ) {\n enclosingFunction = ancestor;\n break;\n }\n }\n\n if (enclosingFunction?.body.type !== \"BlockStatement\") {\n return false;\n }\n\n const [firstStatement] = enclosingFunction.body.body;\n if (firstStatement?.type !== \"ExpressionStatement\") {\n return false;\n }\n\n return (\n arrayFirst(node.range) >= arrayFirst(firstStatement.range) &&\n node.range[1] <= firstStatement.range[1]\n );\n};\n\n/**\n * Disallow parameter reassignment, except in the first expression statement of\n * a function body.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const { sourceCode } = context;\n\n const reportIfParameterReassignment = (\n identifier: Readonly<es.Identifier>\n ): void => {\n if (isInFirstFunctionExpressionStatement(sourceCode, identifier)) {\n return;\n }\n\n const variable = getScopeVariable(sourceCode, identifier);\n if (!isParameterVariable(variable)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: identifier,\n });\n };\n\n return {\n AssignmentExpression: (\n node: Readonly<es.AssignmentExpression>\n ): void => {\n const identifier = getAssignmentTargetIdentifier(node);\n if (identifier === undefined) {\n return;\n }\n\n reportIfParameterReassignment(identifier);\n },\n UpdateExpression: (node: Readonly<es.UpdateExpression>): void => {\n if (node.argument.type !== \"Identifier\") {\n return;\n }\n\n reportIfParameterReassignment(node.argument);\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow parameter reassignment except in the first expression statement of a function body.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-param-reassign\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not reassign function parameters outside the first expression statement in the function body.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-param-reassign\",\n});\n\nexport default rule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Disallow relative parent imports like `..` and `../foo`.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\n \"..\",\n \"../**\",\n \"../..\",\n \"../../**\",\n \"../../..\",\n \"../../../**\",\n \"../../../..\",\n \"../../../../**\",\n \"../../../../..\",\n \"../../../../../**\",\n ],\n description: \"disallow relative parent imports.\",\n name: \"no-relative-parent-import\",\n });\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/no-relative-parent-imports.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"no-relative-parent-imports\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md\",\n },\n }),\n ],\n ruleId: \"no-relative-parent-import\",\n});\n\nexport default deprecatedRule;\n", "import { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport {\n buildRestrictedSyntaxListeners,\n normalizeSyntaxSelector,\n type SyntaxSelectorOption,\n} from \"../_internal/syntax-selectors.js\";\n\ntype MessageIds = \"customMessage\" | \"forbidden\";\n\ntype Options = readonly [\n Readonly<{\n readonly selectors?: readonly SyntaxSelectorOption[];\n }>,\n];\n\n/**\n * Disallow syntax nodes matched by configured selectors.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const selectors = options.selectors ?? [];\n const entries = selectors.map((selector) =>\n normalizeSyntaxSelector(selector)\n );\n\n return buildRestrictedSyntaxListeners(entries, (node, entry) => {\n if (isDefined(entry.message)) {\n context.report({\n data: {\n message: entry.message,\n },\n messageId: \"customMessage\",\n node,\n });\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n });\n },\n meta: {\n defaultOptions: [{ selectors: [] }],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow syntax nodes selected by configured AST selectors.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-restricted-syntax\",\n },\n hasSuggestions: false,\n messages: {\n customMessage: \"{{message}}\",\n forbidden: \"Disallowed syntax.\",\n },\n schema: [\n {\n additionalProperties: false,\n description: \"Configuration for syntax selectors to disallow.\",\n properties: {\n selectors: {\n description:\n \"Selector list. Each entry can be a selector string or a selector/message object.\",\n items: {\n oneOf: [\n {\n minLength: 1,\n type: \"string\",\n },\n {\n additionalProperties: false,\n properties: {\n message: {\n minLength: 1,\n type: \"string\",\n },\n selector: {\n minLength: 1,\n type: \"string\",\n },\n },\n required: [\"selector\"],\n type: \"object\",\n },\n ],\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-restricted-syntax\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of ESLint core no-restricted-syntax.\",\n replacedBy: [\n createReplacementRuleInfo({\n rule: {\n name: \"no-restricted-syntax\",\n url: \"https://eslint.org/docs/latest/rules/no-restricted-syntax\",\n },\n }),\n ],\n ruleId: \"no-restricted-syntax\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined, keyIn } from \"ts-extras\";\n\n/**\n * Normalized selector entry used by syntax-based rules.\n */\nexport type SyntaxSelectorEntry = Readonly<{\n readonly message?: string;\n readonly selector: string;\n}>;\n\n/**\n * Supported selector option syntax accepted by rule options.\n */\nexport type SyntaxSelectorOption =\n | Readonly<{\n readonly message?: string;\n readonly selector: string;\n }>\n | string;\n\nconst isSelectorObject = (\n value: SyntaxSelectorOption\n): value is Readonly<{\n readonly message?: string;\n readonly selector: string;\n}> => typeof value === \"object\" && value !== null && keyIn(value, \"selector\");\n\n/**\n * Normalize a selector option into a selector entry object.\n */\nexport const normalizeSyntaxSelector = (\n selector: SyntaxSelectorOption\n): SyntaxSelectorEntry => {\n if (isSelectorObject(selector)) {\n if (!isDefined(selector.message)) {\n return {\n selector: selector.selector,\n };\n }\n\n return {\n message: selector.message,\n selector: selector.selector,\n };\n }\n\n return {\n selector,\n };\n};\n\n/**\n * Build ESLint selector listeners from selector entries.\n */\nexport const buildRestrictedSyntaxListeners = (\n entries: readonly SyntaxSelectorEntry[],\n report: (node: Readonly<es.Node>, entry: SyntaxSelectorEntry) => void\n): Readonly<Record<string, (node: Readonly<es.Node>) => void>> => {\n const listeners: Record<string, (node: Readonly<es.Node>) => void> = {};\n\n for (const entry of entries) {\n listeners[entry.selector] = (node: Readonly<es.Node>): void => {\n report(node, entry);\n };\n }\n\n return listeners;\n};\n", "import noSecretsPlugin from \"eslint-plugin-no-secrets\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n noSecretsPlugin,\n \"no-secrets\",\n \"eslint-plugin-no-secrets\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-secret\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of dedicated secret scanning tools such as Secretlint and detect-secrets.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"secretlint\",\n url: \"https://github.com/secretlint/secretlint\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"detect-secrets\",\n url: \"https://github.com/Yelp/detect-secrets\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"no-secrets\",\n url: \"https://github.com/nickdeis/eslint-plugin-no-secrets\",\n },\n rule: {\n name: \"no-secrets/no-secrets\",\n url: \"https://github.com/nickdeis/eslint-plugin-no-secrets\",\n },\n }),\n ],\n ruleId: \"no-secret\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { dirname, resolve } from \"node:path\";\nimport { arrayIncludes } from \"ts-extras\";\n\nimport { getImportSourceFromNode } from \"../_internal/import-patterns.js\";\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst importFileSuffixes = [\n \"\",\n \".ts\",\n \".tsx\",\n \".js\",\n \".mjs\",\n \".cjs\",\n \".d.ts\",\n \"/index.ts\",\n \"/index.tsx\",\n \"/index.js\",\n \"/index.mjs\",\n \"/index.cjs\",\n] as const;\n\nconst toResolvedCandidates = (\n baseDirectory: string,\n importSource: string\n): readonly string[] =>\n importFileSuffixes.map((suffix) =>\n resolve(baseDirectory, `${importSource}${suffix}`)\n );\n\n/**\n * Disallow importing the current file from itself.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const currentFilePath = context.filename;\n if (currentFilePath === \"<input>\") {\n return {};\n }\n\n const normalizedCurrentFilePath = resolve(currentFilePath);\n const currentFileDirectory = dirname(normalizedCurrentFilePath);\n\n return {\n \"ImportDeclaration, ExportNamedDeclaration[source], ExportAllDeclaration, ImportExpression\":\n (node: Readonly<es.Node>): void => {\n const sourceText = getImportSourceFromNode(node);\n if (sourceText?.startsWith(\".\") !== true) {\n return;\n }\n\n const candidatePaths = toResolvedCandidates(\n currentFileDirectory,\n sourceText\n );\n\n if (\n arrayIncludes(candidatePaths, normalizedCurrentFilePath)\n ) {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n }\n },\n };\n },\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow importing the current file from itself.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-self-import\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Do not import the current file from itself.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-self-import\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of import/no-self-import.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"import\",\n url: \"https://github.com/import-js/eslint-plugin-import\",\n },\n rule: {\n name: \"no-self-import\",\n url: \"https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md\",\n },\n }),\n ],\n ruleId: \"no-self-import\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\ntype Scope = TSESLint.Scope.Scope;\n\ntype Variable = TSESLint.Scope.Variable;\n\nconst shouldIgnoreVariable = (variable: Readonly<Variable>): boolean =>\n variable.defs.some(\n (definition) =>\n definition.node.type === \"TSEnumDeclaration\" ||\n definition.type.includes(\"Enum\")\n );\n\nconst findShadowedVariable = (\n scope: Readonly<Scope>,\n variableName: string\n): Readonly<Variable> | undefined => {\n let upperScope = scope.upper;\n\n while (upperScope !== null) {\n const upperVariable = upperScope.set.get(variableName);\n if (upperVariable !== undefined) {\n return upperVariable;\n }\n\n upperScope = upperScope.upper;\n }\n\n return undefined;\n};\n\nconst collectScopes = (scope: Readonly<Scope>): readonly Readonly<Scope>[] => [\n scope,\n ...scope.childScopes.flatMap((childScope) => collectScopes(childScope)),\n];\n\n/**\n * Disallow variable declarations that shadow identifiers from parent scopes,\n * excluding enum declarations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"Program:exit\": (node: Readonly<es.Program>): void => {\n const programScope = context.sourceCode.getScope(node);\n\n for (const scope of collectScopes(programScope)) {\n for (const variable of scope.variables) {\n if (shouldIgnoreVariable(variable)) {\n continue;\n }\n\n const [identifier] = variable.identifiers;\n if (identifier === undefined) {\n continue;\n }\n\n const shadowed = findShadowedVariable(scope, variable.name);\n if (\n shadowed === undefined ||\n shouldIgnoreVariable(shadowed)\n ) {\n continue;\n }\n\n context.report({\n data: {\n name: variable.name,\n },\n messageId: \"forbidden\",\n node: identifier,\n });\n }\n }\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow shadowed variables while ignoring enum declarations.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-shadow\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"'{{name}}' is already declared in an outer scope and should not be shadowed.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-shadow\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-shadow.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-shadow\",\n url: \"https://typescript-eslint.io/rules/no-shadow\",\n },\n }),\n ],\n ruleId: \"no-shadow\",\n});\n\nexport default deprecatedRule;\n", "import { createImportPatternRule } from \"../_internal/create-import-pattern-rule.js\";\n\n/**\n * Disallow sibling-file imports from the current directory.\n */\nconst rule: ReturnType<typeof createImportPatternRule> =\n createImportPatternRule({\n defaultDisallowPatterns: [\"./*\"],\n description: \"disallow sibling imports from the current directory.\",\n name: \"no-sibling-import\",\n });\n\nexport default rule;\n", "import type { TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestConvertToBlock\";\n\ntype Options = readonly [\n Readonly<{\n readonly allowDirectiveComments?: boolean;\n }>?,\n];\n\nconst directiveCommentPattern =\n /^(?:eslint(?:-|$)|global\\s|exported\\s|ts-(?:check|expect-error|ignore|nocheck))/u;\n\nconst isDirectiveComment = (commentText: string): boolean =>\n directiveCommentPattern.test(commentText.trimStart());\n\nconst createConvertToBlockSuggestionFix = (\n commentValue: string,\n commentRange: readonly [number, number]\n): TSESLint.ReportFixFunction | undefined => {\n if (commentValue.includes(\"*/\")) {\n return undefined;\n }\n\n return (fixer) =>\n fixer.replaceTextRange(commentRange, `/*${commentValue} */`);\n};\n\n/**\n * Disallow single-line comments except optionally allowed directive comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ allowDirectiveComments = true } = {}] = context.options;\n\n return {\n Program: () => {\n for (const comment of context.sourceCode.getAllComments()) {\n if (comment.type !== \"Line\") {\n continue;\n }\n\n if (\n allowDirectiveComments &&\n isDirectiveComment(comment.value)\n ) {\n continue;\n }\n\n const isDirective = isDirectiveComment(comment.value);\n const suggestionFix = isDirective\n ? undefined\n : createConvertToBlockSuggestionFix(\n comment.value,\n comment.range\n );\n\n context.report({\n ...(suggestionFix === undefined\n ? {}\n : {\n fix: suggestionFix,\n }),\n loc: comment.loc,\n messageId: \"forbidden\",\n ...(suggestionFix === undefined\n ? {}\n : {\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestConvertToBlock\",\n },\n ],\n }),\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ allowDirectiveComments: true }],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow single-line comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-single-line-comment\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Single-line comments are not allowed; use block comments instead.\",\n suggestConvertToBlock:\n \"Convert this single-line comment to a block comment.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for allowing directive line comments.\",\n properties: {\n allowDirectiveComments: {\n description:\n \"Whether to allow line comments used as lint/compiler directives.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"no-single-line-comment\",\n});\n\nexport default rule;\n", "/**\n * @license Use of this source code is governed by an MIT-style license that can\n * be found in the LICENSE file at\n * https://github.com/cartant/eslint-plugin-etc\n */\n\nimport type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\nconst defaultOptions: readonly {\n readonly prefix?: string;\n}[] = [{}];\n\ntype MessageIds = \"forbidden\" | \"prefix\";\n\n/**\n * Disallow non-descriptive single-character generic type parameter names.\n */\nconst rule: ReturnType<typeof ruleCreator<typeof defaultOptions, MessageIds>> =\n ruleCreator<typeof defaultOptions, MessageIds>({\n create: (context) => {\n const [{ prefix = \"\" } = {}] = context.options;\n return {\n \"TSTypeParameter > Identifier[name=/^.$/]\": (\n node: Readonly<es.Identifier>\n ) => {\n context.report({\n data: { name: node.name },\n messageId: \"forbidden\",\n node,\n });\n },\n \"TSTypeParameter > Identifier[name=/^.{2,}$/]\": (\n node: Readonly<es.Identifier>\n ) => {\n const { name } = node;\n if (prefix && !name.startsWith(prefix)) {\n context.report({\n data: { name, prefix },\n messageId: \"prefix\",\n node,\n });\n }\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow single-character type parameters.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-t\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Single-character type parameters are forbidden. Choose a more descriptive name for \"{{name}}\"',\n prefix: 'Type parameter \"{{name}}\" does not have prefix \"{{prefix}}\"',\n },\n schema: [\n {\n description:\n \"Configuration for enforced generic type parameter prefix.\",\n properties: {\n prefix: {\n description:\n \"Required prefix for type parameter names longer than one character.\",\n type: \"string\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-t\",\n });\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = arrayJoin(\n [\n \"ExportNamedDeclaration > FunctionDeclaration > Identifier.id[name=/^_/u]\",\n \"ExportNamedDeclaration > TSDeclareFunction > Identifier.id[name=/^_/u]\",\n \"ExportNamedDeclaration > VariableDeclaration > VariableDeclarator > Identifier.id[name=/^_/u]\",\n ],\n \", \"\n);\n\n/**\n * Disallow named exports whose identifier starts with an underscore.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow underscore-prefixed named exports.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-underscore-export\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"No underscore exports.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-underscore-export\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"VariableDeclarator > TSAsExpression[expression.properties.length=0] > TSTypeReference > Identifier[name='const'], VariableDeclarator[id.typeAnnotation] > TSAsExpression > TSTypeReference > Identifier[name='const']\";\n\nconst getAsConstExpression = (\n node: Readonly<es.Node>\n): Readonly<es.TSAsExpression> | undefined => {\n if (\n node.type !== \"Identifier\" ||\n node.parent?.type !== \"TSTypeReference\" ||\n node.parent.parent?.type !== \"TSAsExpression\"\n ) {\n return undefined;\n }\n\n return node.parent.parent;\n};\n\n/**\n * Disallow unnecessary `as const` assertions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n const asConstExpression = getAsConstExpression(node);\n if (asConstExpression === undefined) {\n return;\n }\n\n const replacementText = sourceCode.getText(\n asConstExpression.expression\n );\n\n context.report({\n fix: (fixer) =>\n fixer.replaceText(asConstExpression, replacementText),\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary as const assertions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-as-const\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Unnecessary as const assertion.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-as-const\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemove\";\n\ntype Options = readonly [];\n\nconst disallowedSelector = \"SwitchCase:last-child > BreakStatement.consequent\";\n\nconst createTrailingBreakRemovalFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.BreakStatement>\n): TSESLint.ReportFixFunction => {\n const previousToken = sourceCode.getTokenBefore(node);\n const previousTokenLine = previousToken?.loc.end.line;\n const breakLine = node.loc.start.line;\n const shouldRemoveLeadingWhitespace =\n isDefined(previousTokenLine) && previousTokenLine === breakLine;\n\n if (previousToken === null || !shouldRemoveLeadingWhitespace) {\n return (fixer) => fixer.remove(node);\n }\n\n const leadingText = sourceCode.text.slice(\n previousToken.range[1],\n arrayFirst(node.range)\n );\n const leadingWhitespaceLength =\n /^[\\t ]*/u.exec(leadingText)?.[0].length ?? 0;\n\n return (fixer) =>\n fixer.removeRange([\n arrayFirst(node.range) - leadingWhitespaceLength,\n node.range[1],\n ]);\n};\n\n/**\n * Disallow unnecessary trailing break statements in switch blocks.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"BreakStatement\" || node.label !== null) {\n return;\n }\n\n const fix = createTrailingBreakRemovalFix(sourceCode, node);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestRemove\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary trailing break statements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-break\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Unnecessary break statement at end of switch case list.\",\n suggestRemove:\n \"Remove the trailing break statement because it is unreachable.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-break\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"PropertyDefinition > Identifier.value[name='undefined'], VariableDeclarator > Identifier.init[name='undefined']\";\n\nconst getUndefinedInitializationRemovalRange = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): readonly [number, number] | undefined => {\n const equalsToken = sourceCode.getTokenBefore(node, {\n filter: (token): boolean => token.value === \"=\",\n });\n\n if (equalsToken === null) {\n return undefined;\n }\n\n let fixStartIndex = arrayFirst(equalsToken.range);\n const sourceText = sourceCode.text;\n\n while (fixStartIndex > 0) {\n const previousCharacter = sourceText.at(fixStartIndex - 1);\n if (previousCharacter !== \" \" && previousCharacter !== \"\\t\") {\n break;\n }\n\n fixStartIndex -= 1;\n }\n\n return [fixStartIndex, node.range[1]];\n};\n\n/**\n * Disallow explicit initialization to `undefined`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n const removalRange = getUndefinedInitializationRemovalRange(\n sourceCode,\n node\n );\n\n if (!isDefined(removalRange)) {\n return;\n }\n\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.removeRange(removalRange);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow unnecessary initialization to undefined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-initialization\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Unnecessary initialization to undefined.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-initialization\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TemplateLiteral[expressions.length=0] > TemplateElement\";\n\nconst toSafeStringLiteralText = (\n templateLiteral: Readonly<es.TemplateLiteral>\n): string =>\n JSON.stringify(\n arrayFirst(templateLiteral.quasis)?.value.cooked ??\n arrayFirst(templateLiteral.quasis)?.value.raw ??\n \"\"\n );\n\n/**\n * Disallow template literals with no expressions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n const templateLiteral =\n node.type === \"TemplateElement\" &&\n node.parent?.type === \"TemplateLiteral\"\n ? node.parent\n : undefined;\n\n if (templateLiteral === undefined) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n fixer.replaceText(\n templateLiteral,\n toSafeStringLiteralText(templateLiteral)\n ),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow template literals that have no interpolated expressions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unnecessary-template-literal\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use a string literal instead of an expression-free template literal.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"no-unnecessary-template-literal\",\n});\n\nexport default rule;\n", "import eslintCommentsPlugin from \"@eslint-community/eslint-plugin-eslint-comments\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `@eslint-community/eslint-comments/no-unused-disable`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n eslintCommentsPlugin,\n \"no-unused-disable\",\n \"@eslint-community/eslint-plugin-eslint-comments\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-unused-disable\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @eslint-community/eslint-comments/no-unused-disable.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@eslint-community/eslint-comments\",\n url: \"https://eslint-community.github.io/eslint-plugin-eslint-comments/\",\n },\n rule: {\n name: \"no-unused-disable\",\n url: \"https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html\",\n },\n }),\n ],\n ruleId: \"no-unused-disable\",\n});\n\nexport default deprecatedRule;\n", "/* eslint-disable @typescript-eslint/no-use-before-define, perfectionist/sort-modules -- helper declarations are grouped by concern; forward references are functionally harmless and keep inference code readable. */\n\nimport type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MemberKind = \"accessor\" | \"data\" | \"method\";\n\ntype MessageIds = \"forbidden\";\n\ntype NativeTypeInfo = Readonly<{\n readonly propertyKinds: ReadonlyMap<string, MemberKind>;\n}>;\n\ntype NativeTypeDefinition = Readonly<{\n readonly constructorRef?: object;\n readonly dataProperties?: readonly string[];\n readonly name: NativeTypeName;\n readonly prototypeRef?: object;\n}>;\n\ntype NativeTypeName =\n | \"Array\"\n | \"BigInt\"\n | \"Boolean\"\n | \"Date\"\n | \"Error\"\n | \"Function\"\n | \"Map\"\n | \"Number\"\n | \"Object\"\n | \"Promise\"\n | \"RegExp\"\n | \"Set\"\n | \"String\"\n | \"Symbol\"\n | \"WeakMap\"\n | \"WeakSet\";\n\ntype Options = readonly [];\n\nconst nativeTypeDefinitions: readonly NativeTypeDefinition[] = [\n {\n constructorRef: Array,\n dataProperties: [\"length\"],\n name: \"Array\",\n prototypeRef: Array.prototype,\n },\n {\n constructorRef: BigInt,\n name: \"BigInt\",\n prototypeRef: BigInt.prototype,\n },\n {\n constructorRef: Boolean,\n name: \"Boolean\",\n prototypeRef: Boolean.prototype,\n },\n {\n constructorRef: Date,\n name: \"Date\",\n prototypeRef: Date.prototype,\n },\n {\n constructorRef: Error,\n name: \"Error\",\n prototypeRef: Error.prototype,\n },\n {\n constructorRef: Function,\n name: \"Function\",\n prototypeRef: Function.prototype,\n },\n {\n constructorRef: Map,\n name: \"Map\",\n prototypeRef: Map.prototype,\n },\n {\n constructorRef: Number,\n name: \"Number\",\n prototypeRef: Number.prototype,\n },\n {\n constructorRef: Object,\n name: \"Object\",\n prototypeRef: Object.prototype,\n },\n {\n constructorRef: Promise,\n name: \"Promise\",\n prototypeRef: Promise.prototype,\n },\n {\n constructorRef: RegExp,\n dataProperties: [\"lastIndex\"],\n name: \"RegExp\",\n prototypeRef: RegExp.prototype,\n },\n {\n constructorRef: Set,\n name: \"Set\",\n prototypeRef: Set.prototype,\n },\n {\n constructorRef: String,\n dataProperties: [\"length\"],\n name: \"String\",\n prototypeRef: String.prototype,\n },\n {\n constructorRef: Symbol,\n name: \"Symbol\",\n prototypeRef: Symbol.prototype,\n },\n {\n constructorRef: WeakMap,\n name: \"WeakMap\",\n prototypeRef: WeakMap.prototype,\n },\n {\n constructorRef: WeakSet,\n name: \"WeakSet\",\n prototypeRef: WeakSet.prototype,\n },\n];\n\nconst nativeTypeNameSet = new Set<NativeTypeName>(\n nativeTypeDefinitions.map((definition) => definition.name)\n);\n\nfunction buildNativeTypeInfoByName(\n definitions: readonly NativeTypeDefinition[]\n): ReadonlyMap<NativeTypeName, NativeTypeInfo> {\n return new Map(\n definitions.map((definition) => [\n definition.name,\n {\n propertyKinds: collectPropertyKinds(definition),\n },\n ])\n );\n}\n\nfunction collectPropertyKinds(\n definition: Readonly<NativeTypeDefinition>\n): ReadonlyMap<string, MemberKind> {\n const propertyKinds = new Map<string, MemberKind>();\n const descriptorSources = [\n definition.prototypeRef,\n definition.constructorRef,\n ] as const;\n\n for (const descriptorSource of descriptorSources) {\n if (!isDefined(descriptorSource)) {\n continue;\n }\n\n const ownPropertyNames = Object.getOwnPropertyNames(descriptorSource);\n\n for (const propertyName of ownPropertyNames) {\n if (propertyKinds.has(propertyName)) {\n continue;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(\n descriptorSource,\n propertyName\n );\n\n if (!isDefined(descriptor)) {\n continue;\n }\n\n propertyKinds.set(propertyName, getMemberKind(descriptor));\n }\n }\n\n for (const dataPropertyName of definition.dataProperties ?? []) {\n if (!propertyKinds.has(dataPropertyName)) {\n propertyKinds.set(dataPropertyName, \"data\");\n }\n }\n\n return propertyKinds;\n}\n\nfunction unwrapExpression(\n node: Readonly<es.Expression>\n): Readonly<es.Expression> {\n if (node.type === \"TSAsExpression\" || node.type === \"TSTypeAssertion\") {\n return unwrapExpression(node.expression);\n }\n\n if (node.type === \"ChainExpression\") {\n return unwrapExpression(node.expression);\n }\n\n return node;\n}\n\nconst inferNativeType = (\n rawExpression: Readonly<es.Expression>\n): NativeTypeName | null => {\n const expression = unwrapExpression(rawExpression);\n\n if (expression.type === \"ArrayExpression\") {\n return \"Array\";\n }\n\n if (expression.type === \"ObjectExpression\") {\n return \"Object\";\n }\n\n if (expression.type === \"TemplateLiteral\") {\n return \"String\";\n }\n\n if (expression.type === \"Literal\") {\n return inferNativeTypeFromLiteral(expression);\n }\n\n if (expression.type === \"Identifier\" && isNativeTypeName(expression.name)) {\n return expression.name;\n }\n\n if (expression.type === \"BinaryExpression\") {\n return inferNativeTypeFromBinaryExpression(expression);\n }\n\n if (expression.type === \"MemberExpression\") {\n return inferNativeTypeFromMemberExpression(expression);\n }\n\n if (expression.type === \"NewExpression\") {\n return inferNativeTypeFromNewExpression(expression);\n }\n\n return null;\n};\n\nfunction inferNativeTypeFromBinaryExpression(\n expression: Readonly<es.BinaryExpression>\n): NativeTypeName | null {\n if (expression.operator !== \"+\") {\n return null;\n }\n\n const leftType = inferNativeType(expression.left);\n const rightType = inferNativeType(expression.right);\n\n if (leftType === \"String\" || rightType === \"String\") {\n return \"String\";\n }\n\n if (leftType === \"RegExp\" && rightType === \"RegExp\") {\n return \"String\";\n }\n\n return null;\n}\n\nfunction inferNativeTypeFromLiteral(\n expression: Readonly<es.Literal>\n): NativeTypeName | null {\n if (typeof expression.value === \"string\") {\n return \"String\";\n }\n\n if (typeof expression.value === \"number\") {\n return \"Number\";\n }\n\n if (typeof expression.value === \"boolean\") {\n return \"Boolean\";\n }\n\n if (typeof expression.value === \"bigint\") {\n return \"BigInt\";\n }\n\n if (expression.value instanceof RegExp) {\n return \"RegExp\";\n }\n\n return null;\n}\n\nfunction inferNativeTypeFromMemberExpression(\n expression: Readonly<es.MemberExpression>\n): NativeTypeName | null {\n if (\n expression.computed ||\n expression.property.type !== \"Identifier\" ||\n expression.property.name !== \"prototype\" ||\n expression.object.type !== \"Identifier\" ||\n !isNativeTypeName(expression.object.name)\n ) {\n return null;\n }\n\n return expression.object.name;\n}\n\nfunction inferNativeTypeFromNewExpression(\n expression: Readonly<es.NewExpression>\n): NativeTypeName | null {\n if (\n expression.callee.type !== \"Identifier\" ||\n !isNativeTypeName(expression.callee.name)\n ) {\n return null;\n }\n\n return expression.callee.name;\n}\n\nfunction getMemberKind(descriptor: Readonly<PropertyDescriptor>): MemberKind {\n if (typeof descriptor.value === \"function\") {\n return \"method\";\n }\n\n if (isDefined(descriptor.get) || isDefined(descriptor.set)) {\n return \"accessor\";\n }\n\n return \"data\";\n}\n\nconst getStaticMemberPropertyName = (\n node: Readonly<es.MemberExpression>\n): null | string => {\n if (node.computed || node.property.type !== \"Identifier\") {\n return null;\n }\n\n return node.property.name;\n};\n\nconst isCallUsage = (node: Readonly<es.MemberExpression>): boolean => {\n const parent = node.parent;\n\n return parent.type === \"CallExpression\" && parent.callee === node;\n};\n\nconst nativeTypeInfoByName: ReadonlyMap<NativeTypeName, NativeTypeInfo> =\n buildNativeTypeInfoByName(nativeTypeDefinitions);\n\nconst isNativeTypeName = (value: string): value is NativeTypeName =>\n setHas(nativeTypeNameSet, value as NativeTypeName);\n\n/**\n * Disallow using non-native members on built-in JavaScript types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n MemberExpression: (node: Readonly<es.MemberExpression>): void => {\n const propertyName = getStaticMemberPropertyName(node);\n\n if (propertyName === null || propertyName === \"prototype\") {\n return;\n }\n\n const nativeTypeName = inferNativeType(node.object);\n\n if (nativeTypeName === null) {\n return;\n }\n\n const nativeTypeInfo = nativeTypeInfoByName.get(nativeTypeName);\n\n if (!isDefined(nativeTypeInfo)) {\n return;\n }\n\n const memberKind = nativeTypeInfo.propertyKinds.get(propertyName);\n\n if (!isDefined(memberKind)) {\n context.report({\n data: {\n nativeTypeName,\n propertyName,\n },\n messageId: \"forbidden\",\n node,\n });\n\n return;\n }\n\n if (isCallUsage(node) && memberKind !== \"method\") {\n context.report({\n data: {\n nativeTypeName,\n propertyName,\n },\n messageId: \"forbidden\",\n node,\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow usage of non-native members on built-in JavaScript objects.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-use-extend-native\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Avoid using '{{nativeTypeName}}.{{propertyName}}' when it is not part of the native JavaScript API.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"no-use-extend-native\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/no-use-before-define, perfectionist/sort-modules -- Re-enable after this file-scoped exception block. */\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-unnecessary-type-parameters\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-useless-generics\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/no-unnecessary-type-parameters.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-unnecessary-type-parameters\",\n url: \"https://typescript-eslint.io/rules/no-unnecessary-type-parameters\",\n },\n }),\n ],\n ruleId: \"no-useless-generics\",\n});\n\nexport default deprecatedRule;\n", "import tsEslintPlugin from \"@typescript-eslint/eslint-plugin\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n tsEslintPlugin,\n \"no-base-to-string\",\n \"@typescript-eslint/eslint-plugin\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-value-tostring\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-base-to-string.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-base-to-string\",\n url: \"https://typescript-eslint.io/rules/no-base-to-string\",\n },\n }),\n ],\n ruleId: \"no-value-tostring\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\nimport type { Parameters as RecheckParameters } from \"recheck\";\nimport type { UnknownRecord } from \"type-fest\";\n\nimport { statSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { basename, dirname, join } from \"node:path\";\nimport { checkSync } from \"recheck\";\nimport { arrayFirst, isDefined, keyIn, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype ComplexityType = \"exponential\" | \"polynomial\";\n\ntype MessageIds = \"checkerError\" | \"vulnerable\";\n\ntype Options = readonly [RuleOption?];\n\ntype RecheckDiagnostics = ReturnType<typeof checkSync>;\n\ntype RecheckEnvironmentKey = \"RECHECK_BIN\" | \"RECHECK_JAR\";\n\ntype RecheckEnvironmentOverrides = Readonly<\n Partial<Record<RecheckEnvironmentKey, string>>\n>;\n\ntype RuleOption = Readonly<\n RecheckParameters & {\n readonly ignoreErrors?: boolean;\n readonly permittableComplexities?: readonly ComplexityType[];\n }\n>;\n\nconst requireFromWorkingDirectory = createRequire(\n join(process.cwd(), \"package.json\")\n);\n\nconst isUnknownRecord = (value: unknown): value is UnknownRecord =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst isModuleNotFoundError = (error: unknown): boolean => {\n if (!isUnknownRecord(error)) {\n return false;\n }\n\n return keyIn(error, \"code\") && error[\"code\"] === \"MODULE_NOT_FOUND\";\n};\n\nconst createRequireFromPluginPackage = (): ReturnType<typeof createRequire> => {\n try {\n return createRequire(\n requireFromWorkingDirectory.resolve(\n \"eslint-plugin-etc-misc/package.json\"\n )\n );\n } catch (error) {\n if (isModuleNotFoundError(error)) {\n return requireFromWorkingDirectory;\n }\n\n throw error;\n }\n};\n\nconst requireFromPluginPackage = createRequireFromPluginPackage();\n\nconst isExistingFile = (filePath: string): boolean => {\n try {\n return statSync(filePath).isFile();\n } catch {\n return false;\n }\n};\n\nconst shouldOverrideRuntimePath = (currentPath: string | undefined): boolean =>\n !isDefined(currentPath) ||\n !isExistingFile(currentPath) ||\n basename(currentPath).toLowerCase() === \"package.json\";\n\nconst resolvePackageSiblingFile = (\n packageJsonSpecifier: string,\n siblingFileName: string\n): null | string => {\n try {\n const packageJsonPath =\n requireFromPluginPackage.resolve(packageJsonSpecifier);\n\n return join(dirname(packageJsonPath), siblingFileName);\n } catch (error) {\n if (isModuleNotFoundError(error)) {\n return null;\n }\n\n throw error;\n }\n};\n\nconst resolveRecheckJarPath = (): null | string =>\n resolvePackageSiblingFile(\"recheck-jar/package.json\", \"recheck.jar\");\n\nconst resolveRecheckWindowsBinaryPath = (): null | string => {\n if (process.platform !== \"win32\" || process.arch !== \"x64\") {\n return null;\n }\n\n return resolvePackageSiblingFile(\n \"recheck-windows-x64/package.json\",\n \"recheck.exe\"\n );\n};\n\nconst recheckJarPath =\n process.platform === \"win32\" ? resolveRecheckJarPath() : null;\n\nconst recheckWindowsBinaryPath =\n process.platform === \"win32\" ? resolveRecheckWindowsBinaryPath() : null;\n\n/* eslint-disable n/no-process-env -- recheck exposes backend runtime paths only through environment variables, so the rule temporarily normalizes them while invoking the analyzer. */\n\nconst deleteRecheckEnvironmentValue = (key: RecheckEnvironmentKey): void => {\n if (key === \"RECHECK_BIN\") {\n delete process.env[\"RECHECK_BIN\"];\n\n return;\n }\n\n delete process.env[\"RECHECK_JAR\"];\n};\n\nconst getRecheckEnvironmentValue = (\n key: RecheckEnvironmentKey\n): string | undefined =>\n key === \"RECHECK_BIN\"\n ? process.env[\"RECHECK_BIN\"]\n : process.env[\"RECHECK_JAR\"];\n\nconst setRecheckEnvironmentValue = (\n key: RecheckEnvironmentKey,\n value: string\n): void => {\n if (key === \"RECHECK_BIN\") {\n process.env[\"RECHECK_BIN\"] = value;\n\n return;\n }\n\n process.env[\"RECHECK_JAR\"] = value;\n};\n\nconst getRecheckEnvironmentOverrides = (): RecheckEnvironmentOverrides => {\n if (process.platform !== \"win32\") {\n return {};\n }\n\n const overrides: Partial<Record<RecheckEnvironmentKey, string>> = {};\n\n if (\n recheckJarPath !== null &&\n isExistingFile(recheckJarPath) &&\n shouldOverrideRuntimePath(getRecheckEnvironmentValue(\"RECHECK_JAR\"))\n ) {\n overrides.RECHECK_JAR = recheckJarPath;\n }\n\n if (\n recheckWindowsBinaryPath !== null &&\n isExistingFile(recheckWindowsBinaryPath) &&\n shouldOverrideRuntimePath(getRecheckEnvironmentValue(\"RECHECK_BIN\"))\n ) {\n overrides.RECHECK_BIN = recheckWindowsBinaryPath;\n }\n\n return overrides;\n};\n\nconst restoreEnvironmentValue = (\n key: RecheckEnvironmentKey,\n value: string | undefined\n): void => {\n if (!isDefined(value)) {\n deleteRecheckEnvironmentValue(key);\n\n return;\n }\n\n setRecheckEnvironmentValue(key, value);\n};\n\nconst withRecheckEnvironmentOverrides = <TResult>(\n callback: () => TResult\n): TResult => {\n const overrides = getRecheckEnvironmentOverrides();\n const previousBin = getRecheckEnvironmentValue(\"RECHECK_BIN\");\n const previousJar = getRecheckEnvironmentValue(\"RECHECK_JAR\");\n\n if (isDefined(overrides.RECHECK_BIN)) {\n setRecheckEnvironmentValue(\"RECHECK_BIN\", overrides.RECHECK_BIN);\n }\n\n if (isDefined(overrides.RECHECK_JAR)) {\n setRecheckEnvironmentValue(\"RECHECK_JAR\", overrides.RECHECK_JAR);\n }\n\n try {\n return callback();\n } finally {\n restoreEnvironmentValue(\"RECHECK_BIN\", previousBin);\n restoreEnvironmentValue(\"RECHECK_JAR\", previousJar);\n }\n};\n\nconst runRecheck = (\n source: string,\n flags: string,\n parameters: Readonly<RecheckParameters>\n): RecheckDiagnostics =>\n withRecheckEnvironmentOverrides(() => checkSync(source, flags, parameters));\n\n/* eslint-enable n/no-process-env -- Re-enable after the recheck environment wrapper helpers. */\n\nconst getStaticStringValue = (node: Readonly<es.Expression>): null | string => {\n if (node.type === \"Literal\" && typeof node.value === \"string\") {\n return node.value;\n }\n\n if (\n node.type === \"TemplateLiteral\" &&\n node.expressions.length === 0 &&\n node.quasis.length === 1\n ) {\n return arrayFirst(node.quasis)?.value.cooked ?? null;\n }\n\n return null;\n};\n\nconst isNonSpreadArgument = (\n argument: Readonly<es.CallExpressionArgument>\n): argument is Readonly<es.Expression> => argument.type !== \"SpreadElement\";\n\nconst isRegExpConstructorCall = (\n node: Readonly<es.CallExpression | es.NewExpression>\n): boolean => {\n if (node.callee.type !== \"Identifier\" || node.callee.name !== \"RegExp\") {\n return false;\n }\n\n if (node.arguments.length === 0 || node.arguments.length > 2) {\n return false;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (!isDefined(sourceArgument) || !isNonSpreadArgument(sourceArgument)) {\n return false;\n }\n\n const sourceValue = getStaticStringValue(sourceArgument);\n\n if (sourceValue === null) {\n return false;\n }\n\n const flagsArgument = node.arguments[1];\n\n if (flagsArgument === undefined) {\n return true;\n }\n\n if (flagsArgument.type === \"SpreadElement\") {\n return false;\n }\n\n return isDefined(getStaticStringValue(flagsArgument));\n};\n\nconst getStaticFlagsValue = (\n argument: Readonly<es.CallExpressionArgument> | undefined\n): null | string => {\n if (!isDefined(argument)) {\n return \"\";\n }\n\n if (!isNonSpreadArgument(argument)) {\n return null;\n }\n\n return getStaticStringValue(argument);\n};\n\nconst getDiagnosticsErrorMessage = (\n error: Readonly<{\n readonly kind: string;\n readonly message?: string;\n }>\n): string => {\n if (keyIn(error, \"message\") && typeof error.message === \"string\") {\n return error.message;\n }\n\n return \"No additional details provided.\";\n};\n\nconst getThrownErrorMessage = (error: unknown): string => {\n if (error instanceof Error && error.message.length > 0) {\n return error.message;\n }\n\n if (typeof error === \"string\" && error.length > 0) {\n return error;\n }\n\n return \"No additional details provided.\";\n};\n\n/**\n * Detect ReDoS-vulnerable regular expressions using `recheck`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [rawOptions]) => {\n const options = rawOptions ?? {};\n const {\n ignoreErrors = true,\n permittableComplexities = [],\n ...recheckParameters\n } = options;\n const allowedComplexities = new Set(permittableComplexities);\n\n const reportDiagnostics = (\n node: Readonly<es.Node>,\n source: string,\n flags: string\n ): void => {\n const diagnostics = (() => {\n try {\n return runRecheck(source, flags, recheckParameters);\n } catch (error) {\n if (ignoreErrors) {\n return null;\n }\n\n context.report({\n data: {\n kind: \"unexpected\",\n message: getThrownErrorMessage(error),\n },\n messageId: \"checkerError\",\n node,\n });\n\n return null;\n }\n })();\n\n if (diagnostics === null) {\n return;\n }\n\n if (diagnostics.status === \"safe\") {\n return;\n }\n\n if (diagnostics.status === \"vulnerable\") {\n if (setHas(allowedComplexities, diagnostics.complexity.type)) {\n return;\n }\n\n context.report({\n data: {\n summary: diagnostics.complexity.summary,\n },\n messageId: \"vulnerable\",\n node,\n });\n\n return;\n }\n\n if (ignoreErrors) {\n return;\n }\n\n context.report({\n data: {\n kind: diagnostics.error.kind,\n message: getDiagnosticsErrorMessage(diagnostics.error),\n },\n messageId: \"checkerError\",\n node,\n });\n };\n\n return {\n CallExpression: (node: Readonly<es.CallExpression>): void => {\n if (!isRegExpConstructorCall(node)) {\n return;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (\n !isDefined(sourceArgument) ||\n !isNonSpreadArgument(sourceArgument)\n ) {\n return;\n }\n\n const source = getStaticStringValue(sourceArgument);\n const secondArgument = node.arguments[1];\n const flags = getStaticFlagsValue(secondArgument);\n\n if (source === null || flags === null) {\n return;\n }\n\n reportDiagnostics(node, source, flags);\n },\n Literal: (node: Readonly<es.Literal>): void => {\n if (!(node.value instanceof RegExp)) {\n return;\n }\n\n reportDiagnostics(node, node.value.source, node.value.flags);\n },\n NewExpression: (node: Readonly<es.NewExpression>): void => {\n if (!isRegExpConstructorCall(node)) {\n return;\n }\n\n const sourceArgument = arrayFirst(node.arguments);\n\n if (\n !isDefined(sourceArgument) ||\n !isNonSpreadArgument(sourceArgument)\n ) {\n return;\n }\n\n const source = getStaticStringValue(sourceArgument);\n const secondArgument = node.arguments[1];\n const flags = getStaticFlagsValue(secondArgument);\n\n if (source === null || flags === null) {\n return;\n }\n\n reportDiagnostics(node, source, flags);\n },\n };\n },\n meta: {\n defaultOptions: [{}],\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow ReDoS-vulnerable regular expressions.\",\n frozen: false,\n recommended: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-vulnerable\",\n },\n hasSuggestions: false,\n messages: {\n checkerError:\n \"ReDoS analysis failed ({{kind}}): {{message}}. Consider setting ignoreErrors to true for this pattern.\",\n vulnerable:\n \"Potential ReDoS-vulnerable regular expression detected ({{summary}}).\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for ReDoS analysis, including recheck parameters and local rule behavior flags.\",\n properties: {\n ignoreErrors: {\n description:\n \"Whether to suppress errors returned by the ReDoS analyzer.\",\n type: \"boolean\",\n },\n permittableComplexities: {\n description:\n \"List of vulnerable complexity categories to permit without reporting.\",\n items: {\n enum: [\"polynomial\", \"exponential\"],\n type: \"string\",\n },\n type: \"array\",\n uniqueItems: true,\n },\n timeout: {\n description:\n \"Maximum analysis time budget in milliseconds passed through to recheck.\",\n type: [\"number\", \"null\"],\n },\n },\n type: \"object\",\n },\n ],\n type: \"problem\",\n },\n name: \"no-vulnerable\",\n});\n\nexport default rule;\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\n\nconst externalRule = getCoreRule(\"accessor-pairs\");\n\n/**\n * Proxy of ESLint core `accessor-pairs` with plugin-local docs URL.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/no-writeonly\"\n);\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"inconsistent\";\n\ntype Options = readonly [\n Readonly<{\n readonly maxProperties?: number;\n }>,\n];\n\nconst isSingleLine = (node: Readonly<es.ObjectExpression>): boolean =>\n node.loc.start.line === node.loc.end.line;\n\n/**\n * Enforce object literal line format based on configured property count.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => ({\n ObjectExpression: (node: Readonly<es.ObjectExpression>): void => {\n const maxProperties = options.maxProperties ?? 1;\n if (node.properties.length <= 1) {\n return;\n }\n\n const shouldBeSingleLine = node.properties.length <= maxProperties;\n const singleLine = isSingleLine(node);\n if (singleLine === shouldBeSingleLine) {\n return;\n }\n\n context.report({\n data: {\n expected: shouldBeSingleLine ? \"single-line\" : \"multi-line\",\n },\n messageId: \"inconsistent\",\n node,\n });\n },\n }),\n meta: {\n defaultOptions: [{ maxProperties: 1 }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce object literal line format based on property count.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/object-format\",\n },\n hasSuggestions: false,\n messages: {\n inconsistent:\n \"Object literal should use {{expected}} formatting for this size.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for object literal line formatting thresholds.\",\n properties: {\n maxProperties: {\n description:\n \"Maximum number of properties allowed on one line.\",\n minimum: 0,\n type: \"number\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"layout\",\n },\n name: \"object-format\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [\n Readonly<{\n readonly names?: readonly string[];\n }>,\n];\n\nconst getExportedNames = (\n node: Readonly<es.ExportNamedDeclaration>\n): readonly string[] => {\n if (node.specifiers.length > 0) {\n return node.specifiers\n .filter(\n (specifier): specifier is es.ExportSpecifier =>\n specifier.type === \"ExportSpecifier\"\n )\n .flatMap((specifier) => {\n if (specifier.exported.type === \"Identifier\") {\n return [specifier.exported.name];\n }\n\n return [];\n });\n }\n\n const declaration = node.declaration;\n if (declaration === null) {\n return [];\n }\n\n if (\n declaration.type === \"FunctionDeclaration\" ||\n declaration.type === \"ClassDeclaration\"\n ) {\n return declaration.id === null ? [] : [declaration.id.name];\n }\n\n if (declaration.type === \"VariableDeclaration\") {\n let names: readonly string[] = [];\n\n for (const declarator of declaration.declarations) {\n if (declarator.id.type === \"Identifier\") {\n names = [...names, declarator.id.name];\n }\n }\n\n return names;\n }\n\n return [];\n};\n\n/**\n * Restrict exported names to a configured allow-list.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const allowedNames = new Set(options.names ?? [\"default\"]);\n\n return {\n ExportDefaultDeclaration: (\n node: Readonly<es.ExportDefaultDeclaration>\n ): void => {\n if (setHas(allowedNames, \"default\")) {\n return;\n }\n\n context.report({\n data: {\n name: \"default\",\n },\n messageId: \"forbidden\",\n node,\n });\n },\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n const exportedNames = getExportedNames(node);\n for (const name of exportedNames) {\n if (setHas(allowedNames, name)) {\n continue;\n }\n\n context.report({\n data: {\n name,\n },\n messageId: \"forbidden\",\n node,\n });\n\n return;\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ names: [\"default\"] }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow exported names that are not in a configured allow-list.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/only-export-name\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Export '{{name}}' is not allowed by only-export-name.\",\n },\n schema: [\n {\n additionalProperties: false,\n description: \"Configuration for the export name allow-list.\",\n properties: {\n names: {\n description:\n \"Allowed export names. Default is ['default'].\",\n items: {\n minLength: 1,\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"only-export-name\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"Property > FunctionExpression.value:not([params.0.name='this'])\";\n\n/**\n * Prefer arrow-function object properties over function-expression properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require arrow-function properties when `this` is not required.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-arrow-function-property\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer arrow function properties.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-arrow-function-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \":not(VariableDeclarator) > CallExpression > Identifier.callee[name='require']\";\n\n/**\n * Require `require(...)` calls to be assigned to a const variable.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require require() calls to be assigned to const.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-const-require\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Assign require() results to a const variable.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-const-require\",\n});\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"prefer-includes\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-includes\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/prefer-includes.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"prefer-includes\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md\",\n },\n }),\n ],\n ruleId: \"prefer-includes\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, arrayJoin, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\" | \"suggest\";\n\ntype Options = readonly [RuleOptions?];\n\ntype RuleOptions = Readonly<{\n readonly allowIntersection?: boolean;\n readonly allowLocal?: boolean;\n}>;\n\nconst defaultOptions: Options = [{}];\n\nconst isExportedTypeAlias = (\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>\n): boolean =>\n typeAliasDeclaration.parent?.type === \"ExportNamedDeclaration\" &&\n typeAliasDeclaration.parent.declaration === typeAliasDeclaration;\n\nconst getTypeAliasDeclarationParent = (\n node: Readonly<es.Node> | undefined\n): Readonly<es.TSTypeAliasDeclaration> | undefined =>\n node?.type === \"TSTypeAliasDeclaration\" ? node : undefined;\n\nconst formatTypeParameters = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeParameters:\n | Readonly<es.TSTypeParameterDeclaration>\n | Readonly<es.TSTypeParameterInstantiation>\n | undefined\n): string =>\n typeParameters === undefined ? \"\" : sourceCode.getText(typeParameters);\n\nconst createTypeLiteralFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n typeLiteralNode: Readonly<es.TSTypeLiteral>\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const literalText = sourceCode.getText(typeLiteralNode);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters} ${literalText}`;\n};\n\nconst createFunctionTypeFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n functionTypeNode: Readonly<es.TSFunctionType>\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const functionTypeParameters = formatTypeParameters(\n sourceCode,\n functionTypeNode.typeParameters\n );\n const parametersText = arrayJoin(\n functionTypeNode.params.map((parameter) =>\n sourceCode.getText(parameter)\n ),\n \", \"\n );\n const returnTypeText =\n functionTypeNode.returnType === undefined\n ? \"void\"\n : sourceCode.getText(functionTypeNode.returnType.typeAnnotation);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters} { ${functionTypeParameters}(${parametersText}): ${returnTypeText}; }`;\n};\n\nconst createIntersectionFixText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n literalNode: Readonly<es.TSTypeLiteral> | undefined,\n referenceNodes: readonly Readonly<es.TSTypeReference>[]\n): string => {\n const aliasTypeParameters = formatTypeParameters(\n sourceCode,\n typeAliasDeclaration.typeParameters\n );\n const baseTypesText = arrayJoin(\n referenceNodes.map((referenceNode) =>\n sourceCode.getText(referenceNode)\n ),\n \", \"\n );\n const extendsClause =\n baseTypesText.length > 0 ? ` extends ${baseTypesText}` : \"\";\n const bodyText =\n literalNode === undefined ? \"{}\" : sourceCode.getText(literalNode);\n\n return `interface ${typeAliasDeclaration.id.name}${aliasTypeParameters}${extendsClause} ${bodyText}`;\n};\n\nconst canSafelyConvertIntersection = (\n intersectionTypeNode: Readonly<es.TSIntersectionType>,\n parserServices: Readonly<Parameters<typeof getConstrainedTypeAtLocation>[0]>\n):\n | undefined\n | {\n readonly literals: readonly Readonly<es.TSTypeLiteral>[];\n readonly references: readonly Readonly<es.TSTypeReference>[];\n } => {\n let literals: readonly es.TSTypeLiteral[] = [];\n let references: readonly es.TSTypeReference[] = [];\n\n for (const intersectionMember of intersectionTypeNode.types) {\n if (intersectionMember.type === \"TSTypeLiteral\") {\n literals = [...literals, intersectionMember];\n continue;\n }\n\n if (intersectionMember.type === \"TSTypeReference\") {\n references = [...references, intersectionMember];\n continue;\n }\n\n return undefined;\n }\n\n if (literals.length > 1) {\n return undefined;\n }\n\n for (const reference of references) {\n const referenceType = getConstrainedTypeAtLocation(\n parserServices,\n reference\n );\n if (tsutils.unionTypeParts(referenceType).length > 1) {\n return undefined;\n }\n }\n\n return {\n literals,\n references,\n };\n};\n\nconst hasFullTypeInformation = (\n parserServices: Readonly<ReturnType<typeof ESLintUtils.getParserServices>>\n): parserServices is Parameters<typeof getConstrainedTypeAtLocation>[0] =>\n parserServices.program !== null;\n\nconst reportTypeAlias = (\n context: Readonly<TSESLint.RuleContext<MessageIds, Options>>,\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>,\n replacementText: string\n): void => {\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(typeAliasDeclaration, replacementText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAliasDeclaration.id,\n suggest: [\n {\n fix,\n messageId: \"suggest\",\n },\n ],\n });\n};\n\n/**\n * Prefer interface declarations when a type alias can be represented safely.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const [{ allowIntersection = true, allowLocal = false } = {}] =\n context.options;\n const sourceCode = context.sourceCode;\n const parserServices = ESLintUtils.getParserServices(context, true);\n const typedParserServices = hasFullTypeInformation(parserServices)\n ? parserServices\n : undefined;\n\n const shouldSkipForAllowLocal = (\n typeAliasDeclaration: Readonly<es.TSTypeAliasDeclaration>\n ): boolean => allowLocal && !isExportedTypeAlias(typeAliasDeclaration);\n\n return {\n \"TSTypeAliasDeclaration > TSFunctionType\": (\n functionTypeNode: Readonly<es.TSFunctionType>\n ) => {\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n functionTypeNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createFunctionTypeFixText(\n sourceCode,\n typeAliasDeclaration,\n functionTypeNode\n )\n );\n },\n \"TSTypeAliasDeclaration > TSIntersectionType\": (\n intersectionTypeNode: Readonly<es.TSIntersectionType>\n ) => {\n if (allowIntersection || typedParserServices === undefined) {\n return;\n }\n\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n intersectionTypeNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n const conversion = canSafelyConvertIntersection(\n intersectionTypeNode,\n typedParserServices\n );\n if (!isDefined(conversion)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createIntersectionFixText(\n sourceCode,\n typeAliasDeclaration,\n arrayFirst(conversion.literals),\n conversion.references\n )\n );\n },\n \"TSTypeAliasDeclaration > TSTypeLiteral\": (\n typeLiteralNode: Readonly<es.TSTypeLiteral>\n ) => {\n const typeAliasDeclaration = getTypeAliasDeclarationParent(\n typeLiteralNode.parent\n );\n if (typeAliasDeclaration === undefined) {\n return;\n }\n\n if (shouldSkipForAllowLocal(typeAliasDeclaration)) {\n return;\n }\n\n reportTypeAlias(\n context,\n typeAliasDeclaration,\n createTypeLiteralFixText(\n sourceCode,\n typeAliasDeclaration,\n typeLiteralNode\n )\n );\n },\n };\n },\n defaultOptions,\n meta: {\n defaultOptions: [{}],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow equivalent type aliases when an interface declaration can be used.\",\n frozen: true,\n recommended: false,\n suggestion: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-interface\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Type alias can be declared using an interface.\",\n suggest: \"Use an interface instead of a type alias.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Options for allowing local aliases and intersection aliases.\",\n properties: {\n allowIntersection: {\n description:\n \"Whether type aliases that use intersections are allowed.\",\n type: \"boolean\",\n },\n allowLocal: {\n description:\n \"Whether non-exported type aliases are allowed.\",\n type: \"boolean\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"prefer-interface\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/consistent-type-definitions.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"consistent-type-definitions\",\n url: \"https://typescript-eslint.io/rules/consistent-type-definitions\",\n },\n }),\n ],\n ruleId: \"prefer-interface\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbiddenGT\" | \"forbiddenGTE\" | \"suggestLT\" | \"suggestLTE\";\n\nconst createFixes = (\n fixer: Readonly<TSESLint.RuleFixer>,\n context: Readonly<TSESLint.RuleContext<MessageIds, readonly []>>,\n expression: Readonly<es.BinaryExpression>,\n operatorText: \"<\" | \"<=\"\n): readonly TSESLint.RuleFix[] => {\n const { left, right } = expression;\n const operatorToken = context.sourceCode.getTokenAfter(left);\n if (operatorToken === null) {\n return [];\n }\n\n return [\n fixer.replaceText(left, context.sourceCode.getText(right)),\n fixer.replaceTextRange(operatorToken.range, operatorText),\n fixer.replaceText(right, context.sourceCode.getText(left)),\n ];\n};\n\n/**\n * Disallow greater-than comparisons in favor of less-than comparisons.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => ({\n \"BinaryExpression[operator='>'], BinaryExpression[operator='>=']\": (\n expression: Readonly<es.BinaryExpression>\n ) => {\n const useLessThanOrEqual = expression.operator === \">=\";\n const fixOperator = useLessThanOrEqual ? \"<=\" : \"<\";\n const messageId = useLessThanOrEqual\n ? \"forbiddenGTE\"\n : \"forbiddenGT\";\n const suggestionMessageId = useLessThanOrEqual\n ? \"suggestLTE\"\n : \"suggestLT\";\n\n context.report({\n fix: (fixer) =>\n createFixes(fixer, context, expression, fixOperator),\n messageId,\n node: expression,\n suggest: [\n {\n fix: (fixer) =>\n createFixes(\n fixer,\n context,\n expression,\n fixOperator\n ),\n messageId: suggestionMessageId,\n },\n ],\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow greater-than comparisons.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-less-than\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbiddenGT: \"Greater-than comparisons are forbidden.\",\n forbiddenGTE:\n \"Greater-than-or-equal comparisons are forbidden.\",\n suggestLT: \"Use a less-than comparison instead.\",\n suggestLTE: \"Use a less-than-or-equal comparison instead.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-less-than\",\n });\n\nexport default rule;\n", "import { adaptExternalRule } from \"../_internal/create-external-rule.js\";\nimport { getCoreRule } from \"../_internal/get-core-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst externalRule = getCoreRule(\"prefer-object-has-own\");\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n externalRule,\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-object-has-own\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of ESLint core prefer-object-has-own.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"eslint\",\n url: \"https://eslint.org/docs/latest/rules/\",\n },\n rule: {\n name: \"prefer-object-has-own\",\n url: \"https://eslint.org/docs/latest/rules/prefer-object-has-own\",\n },\n }),\n ],\n ruleId: \"prefer-object-has-own\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"Program[body.length>1]:has(ExportDefaultDeclaration)\";\n\n/**\n * Disallow additional exports when a default export exists.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow additional exports alongside a default export.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/prefer-only-export\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Export default should be only export.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"prefer-only-export\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayLast, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype JSDocKind = \"arrow-function\" | \"class\" | \"function\" | \"method\" | \"type\";\n\ntype MessageIds = \"missing\";\n\ntype Options = readonly [\n Readonly<{\n readonly kinds?: readonly JSDocKind[];\n }>,\n];\n\nconst defaultKinds: readonly JSDocKind[] = [\n \"arrow-function\",\n \"class\",\n \"function\",\n \"method\",\n \"type\",\n];\n\ntype RuleContext = TSESLint.RuleContext<MessageIds, Options>;\n\ntype SourceCode = TSESLint.SourceCode;\n\nconst hasJSDocComment = (\n sourceCode: Readonly<SourceCode>,\n node: Readonly<es.Node>\n): boolean => {\n const comments = sourceCode.getCommentsBefore(node);\n\n const comment = arrayLast(comments);\n\n return comment?.type === \"Block\" && comment.value.startsWith(\"*\");\n};\n\nconst reportMissingJSDoc = (\n context: Readonly<RuleContext>,\n node: Readonly<es.Node>\n): void => {\n if (hasJSDocComment(context.sourceCode, node)) {\n return;\n }\n\n context.report({\n messageId: \"missing\",\n node,\n });\n};\n\n/**\n * Require JSDoc comments for configured declaration kinds.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const kinds = new Set(options.kinds ?? defaultKinds);\n\n return {\n ClassDeclaration: (node: Readonly<es.ClassDeclaration>): void => {\n if (!setHas(kinds, \"class\") || node.id === null) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n FunctionDeclaration: (\n node: Readonly<es.FunctionDeclaration>\n ): void => {\n if (!setHas(kinds, \"function\") || node.id === null) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n MethodDefinition: (node: Readonly<es.MethodDefinition>): void => {\n if (\n !setHas(kinds, \"method\") ||\n node.kind === \"constructor\" ||\n node.key.type !== \"Identifier\"\n ) {\n return;\n }\n\n reportMissingJSDoc(context, node);\n },\n \"TSTypeAliasDeclaration, TSInterfaceDeclaration\": (\n node: Readonly<es.Node>\n ): void => {\n if (!setHas(kinds, \"type\")) {\n return;\n }\n\n if (\n node.type === \"TSInterfaceDeclaration\" ||\n node.type === \"TSTypeAliasDeclaration\"\n ) {\n reportMissingJSDoc(context, node);\n }\n },\n VariableDeclarator: (\n node: Readonly<es.VariableDeclarator>\n ): void => {\n if (\n !setHas(kinds, \"arrow-function\") ||\n node.id.type !== \"Identifier\" ||\n node.init?.type !== \"ArrowFunctionExpression\" ||\n node.parent.type !== \"VariableDeclaration\" ||\n node.parent.kind !== \"const\"\n ) {\n return;\n }\n\n reportMissingJSDoc(context, node.parent);\n },\n };\n },\n meta: {\n defaultOptions: [{ kinds: defaultKinds }],\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require JSDoc comments for configured declaration kinds.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/require-jsdoc\",\n },\n hasSuggestions: false,\n messages: {\n missing: \"Missing JSDoc comment.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for declaration kinds that require JSDoc.\",\n properties: {\n kinds: {\n description:\n \"Declaration kinds that must have a leading JSDoc comment.\",\n items: {\n enum: [...defaultKinds],\n type: \"string\",\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"require-jsdoc\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of jsdoc/require-jsdoc.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"jsdoc\",\n url: \"https://github.com/gajus/eslint-plugin-jsdoc\",\n },\n rule: {\n name: \"require-jsdoc\",\n url: \"https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md\",\n },\n }),\n ],\n ruleId: \"require-jsdoc\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n normalizeSyntaxSelector,\n type SyntaxSelectorOption,\n} from \"../_internal/syntax-selectors.js\";\n\ntype MessageIds = \"customMessage\" | \"missing\";\n\ntype Options = readonly [\n Readonly<{\n readonly selectors?: readonly SyntaxSelectorOption[];\n }>,\n];\n\n/**\n * Require at least one occurrence of each configured syntax selector.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context, [options]) => {\n const entries = (options.selectors ?? []).map((selector) =>\n normalizeSyntaxSelector(selector)\n );\n const counters = entries.map(() => 0);\n\n let selectorListeners: Readonly<\n Record<string, (node: Readonly<es.Node>) => void>\n > = {};\n\n for (const [index, entry] of entries.entries()) {\n selectorListeners = {\n ...selectorListeners,\n [entry.selector]: (): void => {\n const count = counters[index] ?? 0;\n counters[index] = count + 1;\n },\n };\n }\n\n return {\n ...selectorListeners,\n \"Program:exit\": (node: Readonly<es.Program>): void => {\n for (const [index, entry] of entries.entries()) {\n const count = counters[index] ?? 0;\n if (count > 0) {\n continue;\n }\n\n if (isDefined(entry.message)) {\n context.report({\n data: {\n message: entry.message,\n },\n messageId: \"customMessage\",\n node,\n });\n continue;\n }\n\n context.report({\n data: {\n selector: entry.selector,\n },\n messageId: \"missing\",\n node,\n });\n }\n },\n };\n },\n meta: {\n defaultOptions: [{ selectors: [] }],\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require at least one match for each configured AST selector.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/require-syntax\",\n },\n hasSuggestions: false,\n messages: {\n customMessage: \"{{message}}\",\n missing: \"Required syntax '{{selector}}' was not found.\",\n },\n schema: [\n {\n additionalProperties: false,\n description:\n \"Configuration for syntax selectors that must appear at least once.\",\n properties: {\n selectors: {\n description:\n \"Selector list. Each entry can be a selector string or a selector/message object.\",\n items: {\n oneOf: [\n {\n minLength: 1,\n type: \"string\",\n },\n {\n additionalProperties: false,\n properties: {\n message: {\n minLength: 1,\n type: \"string\",\n },\n selector: {\n minLength: 1,\n type: \"string\",\n },\n },\n required: [\"selector\"],\n type: \"object\",\n },\n ],\n },\n type: \"array\",\n },\n },\n type: \"object\",\n },\n ],\n type: \"suggestion\",\n },\n name: \"require-syntax\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst disallowedSelector = String.raw`Identifier[name=/[^$\\w]/u]`;\n\n/**\n * Restrict identifiers to latin letters, digits, underscores, and dollar signs.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require identifiers to contain only english characters, digits, underscore, or dollar sign.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/restrict-identifier-characters\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Identifier must consist of english characters and dollar sign.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"restrict-identifier-characters\",\n});\n\nexport default rule;\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport {\n arrayAt,\n arrayFirst,\n arrayJoin,\n isDefined,\n isPresent,\n} from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst getSortableValue = (\n element: Readonly<es.Expression | es.SpreadElement>\n): string | undefined => {\n if (element.type === \"Literal\") {\n return String(element.value);\n }\n\n return undefined;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.ArrayExpression>,\n sorted: readonly (es.Expression | es.SpreadElement)[]\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const [first, last] = [\n arrayFirst(node.elements),\n arrayAt(node.elements, -1),\n ];\n if (!isPresent(first) || !isPresent(last)) {\n return fixer.replaceText(node, sourceCode.getText(node));\n }\n\n return fixer.replaceTextRange(\n [arrayFirst(first.range), last.range[1]],\n arrayJoin(\n sorted.map((element) => sourceCode.getText(element)),\n \", \"\n )\n );\n };\n\n/**\n * Enforce alphabetical sorting for literal array elements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ArrayExpression: (node: Readonly<es.ArrayExpression>): void => {\n let elements: readonly (es.Expression | es.SpreadElement)[] = [];\n for (const element of node.elements) {\n if (element !== null) {\n elements = [...elements, element];\n }\n }\n if (elements.length < 2) {\n return;\n }\n\n const sortKeys = elements.map((element) =>\n getSortableValue(element)\n );\n if (sortKeys.some((sortKey) => !isDefined(sortKey))) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...elements].sort((a, b) =>\n (getSortableValue(a) ?? \"\").localeCompare(\n getSortableValue(b) ?? \"\"\n )\n );\n const unchanged = elements.every(\n (element, index) => element === sorted[index]\n );\n if (unchanged) {\n return;\n }\n\n context.report({\n fix: buildFix(context.sourceCode, node, sorted),\n messageId: \"incorrectSorting\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical sorting for literal array elements.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-array\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Array literal elements should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-array\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"TSInterfaceBody > TSCallSignatureDeclaration:not(:first-child)\";\n\n/**\n * Require interface call signatures to appear before all other members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require call signatures to be the first member in interfaces.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-call-signature\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Call signature should be first.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-call-signature\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"incorrectSortingOrder\";\n\ntype Options = readonly [];\n\nconst memberName = (\n member: Readonly<es.MethodDefinition | es.PropertyDefinition>\n): string | undefined => {\n if (member.key.type === \"Identifier\") {\n return member.key.name;\n }\n\n if (member.key.type === \"Literal\" && typeof member.key.value === \"string\") {\n return member.key.value;\n }\n\n return undefined;\n};\n\n/**\n * Enforce alphabetical sorting of class members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ClassBody: (node: Readonly<es.ClassBody>): void => {\n let members: readonly (\n | es.MethodDefinition\n | es.PropertyDefinition\n )[] = [];\n for (const member of node.body) {\n if (\n member.type === \"PropertyDefinition\" ||\n member.type === \"MethodDefinition\"\n ) {\n members = [...members, member];\n }\n }\n\n let previousName = \"\";\n let hasPreviousName = false;\n for (const member of members) {\n const currentName = memberName(member);\n if (!isDefined(currentName)) {\n continue;\n }\n\n if (\n hasPreviousName &&\n currentName.localeCompare(previousName) < 0\n ) {\n context.report({\n messageId: \"incorrectSortingOrder\",\n node: member,\n });\n return;\n }\n\n previousName = currentName;\n hasPreviousName = true;\n }\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"enforce alphabetical sorting of class members.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-class-members\",\n },\n hasSuggestions: false,\n messages: {\n incorrectSortingOrder:\n \"Class members should appear in alphabetical order.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-class-members\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of sort-class-members/sort-class-members or perfectionist sorting rules.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"sort-class-members\",\n url: \"https://www.npmjs.com/package/eslint-plugin-sort-class-members\",\n },\n rule: {\n name: \"sort-class-members\",\n url: \"https://www.npmjs.com/package/eslint-plugin-sort-class-members\",\n },\n }),\n createReplacementRuleInfo({\n plugin: {\n name: \"perfectionist\",\n url: \"https://perfectionist.dev/\",\n },\n }),\n ],\n ruleId: \"sort-class-members\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst disallowedSelector =\n \"TSInterfaceBody > TSConstructSignatureDeclaration:not(:first-child)\";\n\n/**\n * Require interface construct signatures to appear before all other members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [disallowedSelector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require construct signatures to be the first member in interfaces.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-construct-signature\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Construct signature should be first.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-construct-signature\",\n});\n\nexport default rule;\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSortingOrder\";\n\ntype Options = readonly [];\n\nconst toName = (specifier: Readonly<es.ExportSpecifier>): string =>\n specifier.exported.type === \"Identifier\"\n ? specifier.exported.name\n : specifier.exported.value;\n\nconst buildFix = (\n fixer: TSESLint.RuleFixer,\n node: Readonly<es.ExportNamedDeclaration>,\n sourceCode: Readonly<TSESLint.SourceCode>,\n sorted: readonly es.ExportSpecifier[]\n): TSESLint.RuleFix => {\n const startRange = arrayFirst(node.specifiers)?.range ?? node.range;\n const endRange = arrayLast(node.specifiers)?.range ?? node.range;\n\n return fixer.replaceTextRange(\n [arrayFirst(startRange), arrayLast(endRange)],\n arrayJoin(\n sorted.map((specifier) => sourceCode.getText(specifier)),\n \", \"\n )\n );\n};\n\n/**\n * Enforce alphabetical sorting of named export specifiers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ExportNamedDeclaration: (\n node: Readonly<es.ExportNamedDeclaration>\n ): void => {\n let exportSpecifiers: readonly es.ExportSpecifier[] = [];\n for (const specifier of node.specifiers) {\n if (specifier.type === \"ExportSpecifier\") {\n exportSpecifiers = [...exportSpecifiers, specifier];\n }\n }\n if (exportSpecifiers.length < 2) {\n return;\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...exportSpecifiers].sort((a, b) =>\n toName(a).localeCompare(toName(b))\n );\n const unchanged = exportSpecifiers.every(\n (specifier, index) => specifier === sorted[index]\n );\n if (unchanged) {\n return;\n }\n\n context.report({\n fix: (fixer) =>\n buildFix(fixer, node, context.sourceCode, sorted),\n messageId: \"incorrectSortingOrder\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical sorting of named export specifiers.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-export-specifiers\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSortingOrder:\n \"Named export specifiers should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-export-specifiers\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast, isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst keyName = (property: Readonly<es.Property>): string | undefined => {\n if (property.key.type === \"Identifier\") {\n return property.key.name;\n }\n\n if (\n property.key.type === \"Literal\" &&\n typeof property.key.value === \"string\"\n ) {\n return property.key.value;\n }\n\n return undefined;\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n properties: readonly es.Property[]\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const first = arrayFirst(properties);\n\n const last = arrayLast(properties);\n if (first === undefined || last === undefined) {\n return fixer.insertTextAfterRange([0, 0], \"\");\n }\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...properties].sort((a, b) =>\n (keyName(a) ?? \"\").localeCompare(keyName(b) ?? \"\")\n );\n\n return fixer.replaceTextRange(\n [arrayFirst(first.range), last.range[1]],\n arrayJoin(\n sorted.map((property) => sourceCode.getText(property)),\n \", \"\n )\n );\n };\n\n/**\n * Enforce alphabetical sorting of object literal keys.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n ObjectExpression: (node: Readonly<es.ObjectExpression>): void => {\n let properties: readonly es.Property[] = [];\n for (const property of node.properties) {\n if (\n property.type === \"Property\" &&\n property.kind === \"init\" &&\n !property.computed\n ) {\n properties = [...properties, property];\n }\n }\n if (properties.length < 2) {\n return;\n }\n\n let previousName = \"\";\n let hasPreviousName = false;\n for (const property of properties) {\n const currentName = keyName(property);\n if (!isDefined(currentName)) {\n return;\n }\n\n if (\n hasPreviousName &&\n currentName.localeCompare(previousName) < 0\n ) {\n context.report({\n fix: buildFix(context.sourceCode, properties),\n messageId: \"incorrectSorting\",\n node: property,\n });\n return;\n }\n\n previousName = currentName;\n hasPreviousName = true;\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"enforce alphabetical sorting of object literal keys.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-keys\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Object keys should appear in alphabetical order.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-keys\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types -- ESLint fixer API callback signatures. */\n\nimport type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst, arrayJoin, arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"incorrectSorting\";\n\ntype Options = readonly [];\n\nconst commentText = (comment: Readonly<es.Comment>): string =>\n comment.value.trim();\n\nconst buildReplacement = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n comments: readonly es.Comment[]\n): string =>\n arrayJoin(\n comments\n .map((comment) => sourceCode.getText(comment))\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n .sort((a, b) => a.localeCompare(b)),\n \"\\n\"\n );\n\n/**\n * Enforce alphabetical ordering of top-of-file comments.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n Program: (node: Readonly<es.Program>): void => {\n const firstNode = arrayFirst(node.body);\n if (firstNode === undefined) {\n return;\n }\n\n const comments = context.sourceCode\n .getCommentsBefore(firstNode)\n .filter(\n (comment) => comment.loc.end.line < firstNode.loc.start.line\n );\n if (comments.length < 2) {\n return;\n }\n\n const firstComment = arrayFirst(comments);\n if (firstComment === undefined) {\n return;\n }\n\n const lastComment = arrayLast(comments) ?? firstComment;\n\n // eslint-disable-next-line unicorn/no-array-sort -- Node >=16.0 support baseline\n const sorted = [...comments].sort((a, b) =>\n commentText(a).localeCompare(commentText(b))\n );\n const isSorted = comments.every(\n (comment, index) => comment === sorted[index]\n );\n if (isSorted) {\n return;\n }\n\n context.report({\n fix: (fixer): TSESLint.RuleFix =>\n fixer.replaceTextRange(\n [arrayFirst(firstComment.range), lastComment.range[1]],\n buildReplacement(context.sourceCode, comments)\n ),\n messageId: \"incorrectSorting\",\n node: firstComment,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce alphabetical ordering of top-of-file comments.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/sort-top-comments\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n incorrectSorting:\n \"Top-level comments should be sorted alphabetically.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"sort-top-comments\",\n});\n\nexport default rule;\n\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types -- Re-enable after file-scoped fixer callback implementations. */\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayLast } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isValidCaseBody = (node: Readonly<es.SwitchCase>): boolean => {\n if (node.consequent.length === 0) {\n return true;\n }\n\n const [firstStatement] = node.consequent;\n const lastStatement = arrayLast(node.consequent);\n if (firstStatement === undefined || lastStatement === undefined) {\n return true;\n }\n\n const startsOnFollowingLine =\n firstStatement.loc.start.line > node.loc.start.line;\n const startsWithBlock = firstStatement.type === \"BlockStatement\";\n const endsWithBreak =\n lastStatement.type === \"BreakStatement\" || startsWithBlock;\n\n return (startsOnFollowingLine || startsWithBlock) && endsWithBreak;\n};\n\n/**\n * Enforce consistent spacing and break placement inside switch cases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n SwitchCase: (node: Readonly<es.SwitchCase>): void => {\n if (isValidCaseBody(node)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"enforce consistent spacing and break placement in switch cases.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/switch-case-spacing\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Case body should start on a new line and end with break.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"switch-case-spacing\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @stylistic/switch-colon-spacing.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@stylistic\",\n url: \"https://eslint.style/\",\n },\n rule: {\n name: \"switch-colon-spacing\",\n url: \"https://eslint.style/rules/switch-colon-spacing\",\n },\n }),\n ],\n ruleId: \"switch-case-spacing\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport {\n arrayFirst,\n arrayJoin,\n arrayLast,\n isEmpty,\n stringSplit,\n} from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"invalidFormat\";\n\ntype Options = readonly [];\n\nconst isMultilineTemplate = (node: Readonly<es.TemplateLiteral>): boolean =>\n node.loc.start.line !== node.loc.end.line;\n\nconst hasExpectedBoundaryNewlines = (\n node: Readonly<es.TemplateLiteral>\n): boolean => {\n const first = arrayFirst(node.quasis)?.value.raw ?? \"\";\n const last = arrayLast(node.quasis)?.value.raw ?? \"\";\n\n return first.startsWith(\"\\n\") && last.endsWith(\"\\n\");\n};\n\nconst normalizeTemplate = (sourceText: string): string => {\n const lines = stringSplit(sourceText.replaceAll(/\\r\\n?/gu, \"\\n\"), \"\\n\");\n const contentLines = lines.slice(1, -1);\n const indents = contentLines\n .filter((line) => line.trim().length > 0)\n .map((line) => /^\\s*/u.exec(line)?.[0].length ?? 0);\n const minIndent = isEmpty(indents) ? 0 : Math.min(...indents);\n\n const normalizedContent = arrayJoin(\n contentLines\n .map((line) =>\n line.length >= minIndent ? line.slice(minIndent) : line\n )\n .map((line) => ` ${line}`),\n \"\\n\"\n );\n\n const lastLine = arrayLast(lines) ?? \"\";\n\n return arrayJoin(\n [\n arrayFirst(lines),\n normalizedContent,\n lastLine,\n ],\n \"\\n\"\n );\n};\n\nconst buildFix =\n (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.TemplateLiteral>\n ): TSESLint.ReportFixFunction =>\n (fixer): TSESLint.RuleFix => {\n const text = sourceCode.getText(node);\n return fixer.replaceText(node, normalizeTemplate(text));\n };\n\n/**\n * Enforce newline boundary formatting for multiline template literals.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TemplateLiteral: (node: Readonly<es.TemplateLiteral>): void => {\n if (\n !isMultilineTemplate(node) ||\n hasExpectedBoundaryNewlines(node)\n ) {\n return;\n }\n\n context.report({\n fix: buildFix(context.sourceCode, node),\n messageId: \"invalidFormat\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce newline boundary formatting for multiline template literals.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/template-literal-format\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n invalidFormat:\n \"Multiline template literals must start and end on their own lines.\",\n },\n schema: [],\n type: \"layout\",\n },\n name: \"template-literal-format\",\n});\n\nexport default rule;\n", "import type ts from \"typescript\";\n\nimport {\n getConstrainedTypeAtLocation,\n isBuiltinSymbolLike,\n isErrorLike,\n isTypeAnyType,\n isTypeUnknownType,\n} from \"@typescript-eslint/type-utils\";\nimport {\n type TSESTree as es,\n ESLintUtils,\n type TSESLint,\n} from \"@typescript-eslint/utils\";\nimport { arrayFirst, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestWrapInError\";\n\ntype Options = readonly [];\n\nconst isAllowedThrowableVariant = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n isTypeAnyType(type) ||\n isTypeUnknownType(type) ||\n isErrorLike(program, type);\n\nconst couldBeAllowedThrowableType = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n tsutils\n .unionTypeParts(type)\n .every((typeVariant) =>\n isAllowedThrowableVariant(typeVariant, program)\n );\n\nconst couldBePromiseConstructorType = (\n type: Readonly<ts.Type>,\n program: Readonly<ts.Program>\n): boolean =>\n tsutils\n .unionTypeParts(type)\n .some((typeVariant) =>\n isBuiltinSymbolLike(program, typeVariant, \"PromiseConstructor\")\n );\n\nconst isPromiseIdentifier = (node: Readonly<es.Expression>): boolean =>\n node.type === \"Identifier\" && node.name === \"Promise\";\n\nconst createWrapLiteralInErrorSuggestionFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n node: Readonly<es.Node>\n): TSESLint.ReportFixFunction | undefined => {\n if (node.type !== \"Literal\") {\n return undefined;\n }\n\n return (fixer) =>\n fixer.replaceText(node, `new Error(${sourceCode.getText(node)})`);\n};\n\n/**\n * Disallow throwing or rejecting values that are not Error-like.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const sourceCode = context.sourceCode;\n const { program } = parserServices;\n\n const reportIfNonErrorLike = (\n node: Readonly<es.Node>,\n usage: \"Rejecting with\" | \"Throwing\"\n ): void => {\n const type = getConstrainedTypeAtLocation(parserServices, node);\n\n if (couldBeAllowedThrowableType(type, program)) {\n return;\n }\n\n const suggestionFix = createWrapLiteralInErrorSuggestionFix(\n sourceCode,\n node\n );\n\n context.report({\n data: { usage },\n messageId: \"forbidden\",\n node,\n ...(suggestionFix === undefined\n ? {}\n : {\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestWrapInError\",\n },\n ],\n }),\n });\n };\n\n const checkRejectionCall = (\n callExpression: Readonly<es.CallExpression>\n ): void => {\n const rejectionValue = arrayFirst(callExpression.arguments);\n if (rejectionValue === undefined) {\n return;\n }\n\n reportIfNonErrorLike(rejectionValue, \"Rejecting with\");\n };\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='reject']\":\n (callExpression: Readonly<es.CallExpression>) => {\n const { callee } = callExpression;\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type === \"Super\"\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (\n !couldBePromiseConstructorType(objectType, program) &&\n !isPromiseIdentifier(callee.object)\n ) {\n return;\n }\n\n checkRejectionCall(callExpression);\n },\n \"NewExpression[callee.type='Identifier'][callee.name='Promise'] > ArrowFunctionExpression, NewExpression[callee.type='Identifier'][callee.name='Promise'] > FunctionExpression\":\n (\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n ) => {\n const rejectParameter = callback.params[1];\n if (rejectParameter?.type !== \"Identifier\") {\n return;\n }\n\n const rejectVariable = arrayFirst(\n context.sourceCode\n .getDeclaredVariables(callback)\n .filter(\n (declaredVariable) =>\n declaredVariable.name ===\n rejectParameter.name\n )\n );\n\n if (!isDefined(rejectVariable)) {\n return;\n }\n\n for (const reference of rejectVariable.references) {\n const { identifier } = reference;\n const parent = identifier.parent;\n if (\n parent?.type === \"CallExpression\" &&\n parent.callee === identifier\n ) {\n checkRejectionCall(parent);\n }\n }\n },\n ThrowStatement: (throwStatement: Readonly<es.ThrowStatement>) => {\n const { argument } = throwStatement;\n if (argument === null) {\n return;\n }\n\n reportIfNonErrorLike(argument, \"Throwing\");\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow throwing or rejecting values that are not Error-like.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/throw-error\",\n },\n hasSuggestions: true,\n messages: {\n forbidden: \"{{usage}} non-`Error` values is forbidden.\",\n suggestWrapInError:\n \"Wrap this value in an Error constructor before throwing or rejecting.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"throw-error\",\n});\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"throw-new-error\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/throw-new-error\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/throw-new-error.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"throw-new-error\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md\",\n },\n }),\n ],\n ruleId: \"throw-new-error\",\n});\n\nexport default deprecatedRule;\n", "import type ts from \"typescript\";\n\nimport {\n containsAllTypesByName,\n getConstrainedTypeAtLocation,\n isTypeArrayTypeOrUnionOfArrayTypes,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, setHas } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst arrayCallbackMethodNames = new Set<string>([\n \"every\",\n \"find\",\n \"findIndex\",\n \"findLast\",\n \"findLastIndex\",\n \"flatMap\",\n \"forEach\",\n \"map\",\n \"some\",\n]);\n\nconst readonlyArrayTypeNames = new Set([\"ReadonlyArray\"]);\n\nconst callbackSelector =\n \"CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'] > :matches(FunctionExpression, ArrowFunctionExpression):not([returnType])\";\n\nconst isArrayLikeType = (\n typeChecker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n const apparentType = typeChecker.getApparentType(type);\n\n return (\n typeChecker.isArrayType(apparentType) ||\n typeChecker.isTupleType(apparentType) ||\n isTypeArrayTypeOrUnionOfArrayTypes(type, typeChecker) ||\n containsAllTypesByName(type, false, readonlyArrayTypeNames, true)\n );\n};\n\nconst isFirstCallbackArgument = (\n callExpression: Readonly<es.CallExpression>,\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n): boolean => arrayFirst(callExpression.arguments) === callback;\n\n/**\n * Require explicit return types for array callback functions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const typeChecker = parserServices.program.getTypeChecker();\n\n return {\n [callbackSelector]: (\n callback:\n | Readonly<es.ArrowFunctionExpression>\n | Readonly<es.FunctionExpression>\n ) => {\n const parentNode = callback.parent;\n if (parentNode?.type !== \"CallExpression\") {\n return;\n }\n\n if (!isFirstCallbackArgument(parentNode, callback)) {\n return;\n }\n\n const { callee } = parentNode;\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type === \"Super\" ||\n callee.property.type !== \"Identifier\" ||\n !setHas(arrayCallbackMethodNames, callee.property.name)\n ) {\n return;\n }\n\n const objectType = getConstrainedTypeAtLocation(\n parserServices,\n callee.object\n );\n if (!isArrayLikeType(typeChecker, objectType)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: callback,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit return types for array callback functions.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-array-callback-return-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Specify the callback return type explicitly.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/array-callback-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, objectEntries, objectHasOwn } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isNode = (value: unknown): value is Readonly<es.Node> =>\n typeof value === \"object\" && value !== null && objectHasOwn(value, \"type\");\n\nconst collectNodeChildren = (\n node: Readonly<es.Node>\n): readonly Readonly<es.Node>[] => {\n let children: readonly Readonly<es.Node>[] = [];\n\n const addNode = (value: unknown): void => {\n if (isNode(value)) {\n children = [...children, value];\n }\n };\n\n for (const [key, child] of objectEntries(node)) {\n if (key === \"loc\" || key === \"parent\" || key === \"range\") {\n continue;\n }\n\n if (Array.isArray(child)) {\n for (const item of child) {\n addNode(item);\n }\n continue;\n }\n\n addNode(child);\n }\n\n return children;\n};\n\nconst containsThisExpression = (root: Readonly<es.Node>): boolean => {\n let stack: readonly es.Node[] = [root];\n\n while (stack.length > 0) {\n const node = arrayAt(stack, -1);\n stack = stack.slice(0, -1);\n if (node === undefined) {\n continue;\n }\n\n if (node.type === \"ThisExpression\") {\n return true;\n }\n\n stack = [...stack, ...collectNodeChildren(node)];\n }\n\n return false;\n};\n\nconst hasThisParameter = (node: Readonly<es.MethodDefinition>): boolean => {\n const [firstParameter] = node.value.params;\n\n return (\n firstParameter?.type === \"Identifier\" && firstParameter.name === \"this\"\n );\n};\n\nconst usesThisExpression = (node: Readonly<es.MethodDefinition>): boolean =>\n node.value.body === null ? false : containsThisExpression(node.value.body);\n\nconst shouldSkipMethod = (node: Readonly<es.MethodDefinition>): boolean =>\n node.kind !== \"method\" ||\n node.static ||\n node.value.body === null ||\n hasThisParameter(node) ||\n usesThisExpression(node);\n\n/**\n * Require non-static class methods to reference `this`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n MethodDefinition: (node: Readonly<es.MethodDefinition>): void => {\n if (shouldSkipMethod(node)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require non-static class methods to reference `this`.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-class-methods-use-this\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Class method should use `this` or declare a `this` parameter.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/class-methods-use-this\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/class-methods-use-this.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"class-methods-use-this\",\n url: \"https://typescript-eslint.io/rules/class-methods-use-this\",\n },\n }),\n ],\n ruleId: \"typescript/class-methods-use-this\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`:matches(TSTypeAliasDeclaration[typeAnnotation.type='TSArrayType'], TSTypeAliasDeclaration[typeAnnotation.type='TSTupleType'], TSTypeAliasDeclaration[typeAnnotation.type='TSTypeReference']:has(TSTypeReference > Identifier[name='Array'])) > Identifier.id:not([name=/^(?:[A-Z][a-z\\d]*)+(?:Array|s)$/u])`;\n\n/**\n * Require array-like type aliases to end with `Array` or `s`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce consistent naming for array-like type aliases.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-consistent-array-type-name\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Use a name ending with \"Array\" or \"s\" for array-like type aliases.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/consistent-array-type-name\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"AssignmentExpression > MemberExpression.left > Identifier.object\";\n\n/**\n * Require defining function properties in a single statement.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require defining function properties in a single statement.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-define-function-in-one-statement\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use `Object.assign` to define function properties in one statement.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/define-function-in-one-statement\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"SwitchStatement[cases.length>1]:not(:has(SwitchCase[test=null]))\";\n\n/**\n * Require a default case in non-trivial switch statements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"require a default case in switch statements with multiple branches.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-exhaustive-switch\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Add a default case to make this switch exhaustive.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/exhaustive-switch\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message:\n \"Deprecated in favor of @typescript-eslint/switch-exhaustiveness-check.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"switch-exhaustiveness-check\",\n url: \"https://typescript-eslint.io/rules/switch-exhaustiveness-check\",\n },\n }),\n ],\n ruleId: \"typescript/exhaustive-switch\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=true]\",\n \"TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=false]\",\n ],\n \", \"\n);\n\n/**\n * Disallow optional boolean literal property types.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Literal\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"boolean\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow optional boolean literal types in property signatures.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-boolean-literal-type\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: 'Use \"boolean\" type instead.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-boolean-literal-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"VariableDeclarator:not([id.typeAnnotation], [init.expression.properties.length=0]) > Identifier.id\";\n\n/**\n * Disallow complex inferred declarator types without annotation.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow complex inferred declarator types without explicit annotation.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-complex-declarator-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Add a type annotation (or `as const`) for this complex declarator.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-complex-declarator-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"ArrowFunctionExpression[returnType=undefined] > :matches(TSAsExpression, TSTypeAssertion) > :matches(FunctionExpression, ArrowFunctionExpression, ObjectExpression, ClassExpression)\";\n\n/**\n * Disallow inferred complex return types for arrow functions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow complex inferred arrow-function return types without explicit annotation.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-complex-return-type\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Add an explicit return type annotation for complex return expressions.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-complex-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Disallow empty interfaces without extends clauses.\n */\nconst selector =\n \"TSInterfaceDeclaration[body.body.length=0][extends.length=0] > Identifier.id\";\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description: \"disallow empty interfaces without extends clauses.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-empty-interfaces\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Empty interface is not allowed.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-empty-interfaces\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-empty-object-type.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-empty-object-type\",\n url: \"https://typescript-eslint.io/rules/no-empty-object-type\",\n },\n }),\n ],\n ruleId: \"typescript/no-empty-interfaces\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"PropertyDefinition[value.type='Literal'] > TSTypeAnnotation\",\n \"VariableDeclarator[init.type='Literal'] > Identifier.id > TSTypeAnnotation\",\n ],\n \", \"\n);\n\n/**\n * Disallow explicit primitive type annotations when they are inferrable.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: true,\n docs: {\n deprecated: true,\n description:\n \"disallow explicit primitive type annotations when they are inferrable from literals.\",\n frozen: true,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-inferrable-types\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Type annotation can be inferred from the assigned literal value.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-inferrable-types\",\n});\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of @typescript-eslint/no-inferrable-types.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-inferrable-types\",\n url: \"https://typescript-eslint.io/rules/no-inferrable-types\",\n },\n }),\n ],\n ruleId: \"typescript/no-inferrable-types\",\n});\n\nexport default deprecatedRule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTupleType > TSUnionType:not([types.length=1])\";\n\n/**\n * Disallow union element types directly inside tuple elements.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow union element types directly inside tuple element positions.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-multi-type-tuples\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Avoid multi-type tuple elements; extract a named alias instead.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-multi-type-tuples\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isTypeNeverType,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst isTypeAliasNeverIdentifier = (node: Readonly<es.Identifier>): boolean =>\n node.parent.type === \"TSTypeAliasDeclaration\" &&\n node.parent.id === node &&\n node.parent.typeAnnotation.type === \"TSNeverKeyword\";\n\n/**\n * Disallow inferred `never` types on identifiers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n\n return {\n Identifier: (node: Readonly<es.Identifier>): void => {\n if (isTypeAliasNeverIdentifier(node)) {\n return;\n }\n\n const type = getConstrainedTypeAtLocation(parserServices, node);\n\n if (!isTypeNeverType(type)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"disallow inferred identifiers with `never` type.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-never\",\n },\n hasSuggestions: false,\n messages: {\n forbidden: \"Unexpected `never` type on this identifier.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-never\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst getTypeAnnotationFromDeclarator = (\n declarator: Readonly<es.VariableDeclarator>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n declarator.id.type === \"Identifier\" ||\n declarator.id.type === \"ArrayPattern\" ||\n declarator.id.type === \"ObjectPattern\"\n ) {\n return declarator.id.typeAnnotation;\n }\n\n return undefined;\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\n/**\n * Disallow redundant `undefined` unions on const declarations with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n 'VariableDeclaration[kind=\"const\"] > VariableDeclarator': (\n node: Readonly<es.Node>\n ): void => {\n if (node.type !== \"VariableDeclarator\") {\n return;\n }\n\n if (node.init === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(node.init)) {\n return;\n }\n\n const typeAnnotation = getTypeAnnotationFromDeclarator(node);\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in const declaration union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-const\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Const declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this const declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-const\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getAssignmentPatternFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.AssignmentPattern> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return pattern;\n }\n\n if (pattern.type === \"RestElement\") {\n return undefined;\n }\n\n return undefined;\n};\n\nconst getAssignmentPatternFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.AssignmentPattern> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getAssignmentPatternFromPattern(parameter.parameter);\n }\n\n return getAssignmentPatternFromPattern(parameter);\n};\n\nconst getTypeAnnotationFromAssignmentPattern = (\n assignmentPattern: Readonly<es.AssignmentPattern>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n assignmentPattern.left.type !== \"ArrayPattern\" &&\n assignmentPattern.left.type !== \"Identifier\" &&\n assignmentPattern.left.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return assignmentPattern.left.typeAnnotation;\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on default parameters with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const assignmentPattern =\n getAssignmentPatternFromParameter(parameter);\n\n if (assignmentPattern === undefined) {\n continue;\n }\n\n if (\n !isDefinitelyDefinedExpression(assignmentPattern.right)\n ) {\n continue;\n }\n\n const typeAnnotation =\n getTypeAnnotationFromAssignmentPattern(\n assignmentPattern\n );\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n continue;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n continue;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in default parameter union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-default-parameter\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Default parameters with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this default parameter type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-default-parameter\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst isNeverReassigned = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n declarator: Readonly<es.VariableDeclarator>\n): boolean => {\n const [declaredVariable] = sourceCode.getDeclaredVariables(declarator);\n\n if (declaredVariable === undefined) {\n return false;\n }\n\n return !declaredVariable.references.some(\n (reference) => reference.isWrite() && reference.init !== true\n );\n};\n\n/**\n * Disallow redundant `undefined` unions on `let` declarations that are never\n * reassigned and initialized with definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"VariableDeclaration[kind='let'] > VariableDeclarator[id.type='Identifier']\":\n (node: Readonly<es.VariableDeclarator>): void => {\n const initializer = node.init;\n\n if (initializer === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(initializer)) {\n return;\n }\n\n if (!isNeverReassigned(sourceCode, node)) {\n return;\n }\n\n const id = node.id;\n\n if (id.type !== \"Identifier\") {\n return;\n }\n\n const typeAnnotation = id.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in `let` type unions when declarations are never reassigned and initialized with definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-let\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Never-reassigned `let` declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this `let` declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-let\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \"Identifier[optional=true] > TSTypeAnnotation > TSUnionType\",\n \"TSNamedTupleMember[optional=true] > TSUnionType\",\n \"TSOptionalType > TSUnionType\",\n ],\n \", \"\n);\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\n/**\n * Disallow redundant `undefined` unions on optional parameters and tuple\n * members.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(sourceCode, node);\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix => fixer.replaceText(node, fixedTypeText);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in optional parameter and tuple member union types.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-optional\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Optional parameters and tuple members should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this optional union type.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-optional\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, arrayFirst, arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\ntype ReturnableFunctionNode =\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression;\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ConditionalExpression\") {\n return (\n isDefinitelyDefinedExpression(unwrappedExpression.consequent) &&\n isDefinitelyDefinedExpression(unwrappedExpression.alternate)\n );\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (\n unwrappedExpression.type === \"LogicalExpression\" &&\n unwrappedExpression.operator === \"??\"\n ) {\n return isDefinitelyDefinedExpression(unwrappedExpression.right);\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"SequenceExpression\") {\n const lastExpression = arrayAt(unwrappedExpression.expressions, -1);\n\n return (\n lastExpression !== undefined &&\n isDefinitelyDefinedExpression(lastExpression)\n );\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst hasDefinitelyDefinedReturnValue = (\n node: Readonly<ReturnableFunctionNode>\n): boolean => {\n const body = node.body;\n\n if (body.type !== \"BlockStatement\") {\n return isDefinitelyDefinedExpression(body);\n }\n\n if (body.body.length !== 1) {\n return false;\n }\n\n const statement = arrayFirst(body.body);\n\n if (statement === undefined) {\n return false;\n }\n\n if (statement.type !== \"ReturnStatement\") {\n return false;\n }\n\n if (statement.argument === null) {\n return false;\n }\n\n return isDefinitelyDefinedExpression(statement.argument);\n};\n\nconst getPromiseValueUnionType = (\n returnType: Readonly<es.TSTypeAnnotation>\n): Readonly<es.TSUnionType> | undefined => {\n const annotation = returnType.typeAnnotation;\n\n if (annotation.type !== \"TSTypeReference\") {\n return undefined;\n }\n\n if (annotation.typeName.type !== \"Identifier\") {\n return undefined;\n }\n\n if (annotation.typeName.name !== \"Promise\") {\n return undefined;\n }\n\n const typeArguments = annotation.typeArguments;\n\n if (typeArguments?.params.length !== 1) {\n return undefined;\n }\n\n const [promiseValueType] = typeArguments.params;\n\n if (promiseValueType === undefined) {\n return undefined;\n }\n\n if (promiseValueType.type !== \"TSUnionType\") {\n return undefined;\n }\n\n return promiseValueType;\n};\n\n/**\n * Disallow redundant `undefined` inside Promise return type unions for async\n * functions that deterministically return definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)[async=true]\":\n (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"ArrowFunctionExpression\" &&\n node.type !== \"FunctionDeclaration\" &&\n node.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const returnType = node.returnType;\n\n if (returnType === undefined) {\n return;\n }\n\n const promiseValueUnionType =\n getPromiseValueUnionType(returnType);\n\n if (promiseValueUnionType === undefined) {\n return;\n }\n\n if (!hasDefinitelyDefinedReturnValue(node)) {\n return;\n }\n\n const fixedPromiseValueTypeText = buildFixedTypeText(\n sourceCode,\n promiseValueUnionType\n );\n\n if (!isDefined(fixedPromiseValueTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n promiseValueUnionType,\n fixedPromiseValueTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: promiseValueUnionType,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in Promise return value unions for async functions that deterministically return definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-promise-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Async Promise return value unions should not redundantly include `undefined` when the function deterministically returns definitely-defined values.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this Promise return value union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-promise-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\n/**\n * Disallow redundant `undefined` unions on readonly class properties with\n * definitely-defined initializers.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"PropertyDefinition[readonly=true][optional!=true]\": (\n node: Readonly<es.Node>\n ): void => {\n if (node.type !== \"PropertyDefinition\") {\n return;\n }\n\n if (node.declare) {\n return;\n }\n\n if (node.value === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(node.value)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in readonly property union types when the initializer is definitely defined.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-readonly-property\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Readonly properties with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this readonly property type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-readonly-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayAt, arrayFirst, arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\ntype ReturnableFunctionNode =\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression;\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ConditionalExpression\") {\n return (\n isDefinitelyDefinedExpression(unwrappedExpression.consequent) &&\n isDefinitelyDefinedExpression(unwrappedExpression.alternate)\n );\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (\n unwrappedExpression.type === \"LogicalExpression\" &&\n unwrappedExpression.operator === \"??\"\n ) {\n return isDefinitelyDefinedExpression(unwrappedExpression.right);\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"SequenceExpression\") {\n const lastExpression = arrayAt(unwrappedExpression.expressions, -1);\n\n return (\n lastExpression !== undefined &&\n isDefinitelyDefinedExpression(lastExpression)\n );\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst hasDefinitelyDefinedReturnValue = (\n node: Readonly<ReturnableFunctionNode>\n): boolean => {\n const body = node.body;\n\n if (body.type !== \"BlockStatement\") {\n return isDefinitelyDefinedExpression(body);\n }\n\n if (body.body.length !== 1) {\n return false;\n }\n\n const statement = arrayFirst(body.body);\n\n if (statement === undefined) {\n return false;\n }\n\n if (statement.type !== \"ReturnStatement\") {\n return false;\n }\n\n if (statement.argument === null) {\n return false;\n }\n\n return isDefinitelyDefinedExpression(statement.argument);\n};\n\n/**\n * Disallow redundant `undefined` in return type unions when the function body\n * deterministically returns a definitely-defined value.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)\":\n (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"ArrowFunctionExpression\" &&\n node.type !== \"FunctionDeclaration\" &&\n node.type !== \"FunctionExpression\"\n ) {\n return;\n }\n\n const returnType = node.returnType;\n\n if (returnType === undefined) {\n return;\n }\n\n if (returnType.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n if (!hasDefinitelyDefinedReturnValue(node)) {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n returnType.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n returnType.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: returnType.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in return type unions when the function deterministically returns a definitely-defined value.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Return types should not redundantly include `undefined` when the function deterministically returns a definitely-defined value.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this return type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin, isDefined, isEmpty } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRemoveRedundantUndefined\";\n\ntype Options = readonly [];\n\nconst buildFixedTypeText = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n unionType: Readonly<es.TSUnionType>\n): string | undefined => {\n let nonUndefinedTypeTexts: readonly string[] = [];\n\n for (const typeNode of unionType.types) {\n if (typeNode.type === \"TSUndefinedKeyword\") {\n continue;\n }\n\n nonUndefinedTypeTexts = [\n ...nonUndefinedTypeTexts,\n sourceCode.getText(typeNode),\n ];\n }\n\n if (\n isEmpty(nonUndefinedTypeTexts) ||\n nonUndefinedTypeTexts.length === unionType.types.length\n ) {\n return undefined;\n }\n\n return arrayJoin(nonUndefinedTypeTexts, \" | \");\n};\n\nconst unwrapExpression = (\n expression: Readonly<es.Expression>\n): Readonly<es.Expression> => {\n if (\n expression.type === \"TSAsExpression\" ||\n expression.type === \"TSSatisfiesExpression\" ||\n expression.type === \"TSNonNullExpression\" ||\n expression.type === \"TSTypeAssertion\"\n ) {\n return unwrapExpression(expression.expression);\n }\n\n return expression;\n};\n\nconst isDefinitelyDefinedExpression = (\n expression: Readonly<es.Expression>\n): boolean => {\n const unwrappedExpression = unwrapExpression(expression);\n\n if (unwrappedExpression.type === \"ArrayExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ArrowFunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ClassExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"FunctionExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"Literal\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"NewExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"ObjectExpression\") {\n return true;\n }\n\n if (unwrappedExpression.type === \"TemplateLiteral\") {\n return true;\n }\n\n return false;\n};\n\nconst isNeverReassigned = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n declarator: Readonly<es.VariableDeclarator>\n): boolean => {\n const [declaredVariable] = sourceCode.getDeclaredVariables(declarator);\n\n if (declaredVariable === undefined) {\n return false;\n }\n\n return !declaredVariable.references.some(\n (reference) => reference.isWrite() && reference.init !== true\n );\n};\n\n/**\n * Disallow redundant `undefined` unions on `var` declarations that are never\n * reassigned and initialized with definitely-defined values.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"VariableDeclaration[kind='var'] > VariableDeclarator[id.type='Identifier']\":\n (node: Readonly<es.VariableDeclarator>): void => {\n const initializer = node.init;\n\n if (initializer === null) {\n return;\n }\n\n if (!isDefinitelyDefinedExpression(initializer)) {\n return;\n }\n\n if (!isNeverReassigned(sourceCode, node)) {\n return;\n }\n\n const id = node.id;\n\n if (id.type !== \"Identifier\") {\n return;\n }\n\n const typeAnnotation = id.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n if (typeAnnotation.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n const fixedTypeText = buildFixedTypeText(\n sourceCode,\n typeAnnotation.typeAnnotation\n );\n\n if (!isDefined(fixedTypeText)) {\n return;\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n typeAnnotation.typeAnnotation,\n fixedTypeText\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: typeAnnotation.typeAnnotation,\n suggest: [\n {\n fix,\n messageId: \"suggestRemoveRedundantUndefined\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow redundant `undefined` in `var` type unions when declarations are never reassigned and initialized with definitely-defined values.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-redundant-undefined-var\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Never-reassigned `var` declarations with definitely-defined initializers should not redundantly include `undefined` in their type union.\",\n suggestRemoveRedundantUndefined:\n \"Remove redundant `undefined` from this `var` declaration type union.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/no-redundant-undefined-var\",\n});\n\nexport default rule;\n", "import {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\nimport noRestrictedSyntaxRule from \"./no-restricted-syntax.js\";\n\n/**\n * TypeScript-prefixed alias for selector-based restricted syntax checks.\n */\nconst typescriptNoRestrictedSyntaxRule: typeof noRestrictedSyntaxRule = {\n ...noRestrictedSyntaxRule,\n meta: {\n deprecated: true,\n ...noRestrictedSyntaxRule.meta,\n docs: {\n deprecated: true,\n frozen: true,\n recommended: false,\n ...noRestrictedSyntaxRule.meta.docs,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-restricted-syntax\",\n } as NonNullable<typeof noRestrictedSyntaxRule.meta.docs>,\n },\n};\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof typescriptNoRestrictedSyntaxRule =\n withDeprecatedRuleLifecycle(typescriptNoRestrictedSyntaxRule, {\n message:\n \"Deprecated in favor of @typescript-eslint/no-restricted-syntax.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"@typescript-eslint\",\n url: \"https://typescript-eslint.io/\",\n },\n rule: {\n name: \"no-restricted-syntax\",\n url: \"https://typescript-eslint.io/rules/no-restricted-syntax\",\n },\n }),\n ],\n ruleId: \"typescript/no-restricted-syntax\",\n });\n\nexport default deprecatedRule;\n", "import { getConstrainedTypeAtLocation } from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport * as tsutils from \"tsutils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n/**\n * Disallow Object.assign into targets with readonly properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const checker = parserServices.program.getTypeChecker();\n\n const hasReadonlyProperty = (\n type: ReturnType<typeof checker.getTypeAtLocation>\n ): boolean =>\n type\n .getProperties()\n .some((property) =>\n tsutils.isPropertyReadonlyInType(\n type,\n property.getEscapedName(),\n checker\n )\n );\n\n return {\n \"CallExpression[callee.type='MemberExpression'][callee.object.type='Identifier'][callee.object.name='Object'][callee.property.type='Identifier'][callee.property.name='assign']\":\n (node: Readonly<es.CallExpression>): void => {\n const [target] = node.arguments;\n if (target === undefined) {\n return;\n }\n\n const targetType = getConstrainedTypeAtLocation(\n parserServices,\n target\n );\n if (!hasReadonlyProperty(targetType)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow Object.assign calls that mutate readonly-typed targets.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-unsafe-object-assign\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Do not use Object.assign on targets with readonly properties.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/no-unsafe-object-assign\",\n});\n\nexport default rule;\n", "import coreNoUnsafeObjectAssignRule from \"./typescript-no-unsafe-object-assign.js\";\n\n/**\n * TypeScript-prefixed alias for Object.assign readonly-target safety checks.\n */\nconst rule: typeof coreNoUnsafeObjectAssignRule = {\n ...coreNoUnsafeObjectAssignRule,\n meta: {\n deprecated: false,\n ...coreNoUnsafeObjectAssignRule.meta,\n docs: {\n deprecated: false,\n frozen: false,\n recommended: false,\n ...coreNoUnsafeObjectAssignRule.meta.docs,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-unsafe-object-assignment\",\n } as NonNullable<typeof coreNoUnsafeObjectAssignRule.meta.docs>,\n },\n};\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\n// eslint-disable-next-line etc-misc/no-unnecessary-template-literal -- String.raw preserves selector escapes.\nconst selector = String.raw`TSTypeAliasDeclaration > Identifier.id:matches([parent.typeAnnotation.type='TSArrayType'], [parent.typeAnnotation.type='TSTupleType']):not([name=/^(?:[A-Z][a-z\\d]*)+(?:Array|s)$/u])`;\n\n/**\n * Prefer reusable named aliases for array and tuple type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require reusable alias names for array and tuple type aliases.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-array-type-alias\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n 'Prefer a named alias ending in \"Array\" or \"s\" for array/tuple type aliases.',\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-array-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector =\n \"PropertyDefinition:not([typeAnnotation]) > ArrowFunctionExpression\";\n\n/**\n * Prefer class methods over untyped arrow-function class properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n context.report({\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require class methods over untyped arrow-function class properties.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-class-method\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Use a class method instead of an untyped function property.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-class-method\",\n});\n\nexport default rule;\n", "import {\n getConstrainedTypeAtLocation,\n isTypeFlagSet,\n} from \"@typescript-eslint/type-utils\";\nimport { type TSESTree as es, ESLintUtils } from \"@typescript-eslint/utils\";\nimport { arrayFirst, isDefined } from \"ts-extras\";\nimport * as tsutils from \"tsutils\";\nimport ts from \"typescript\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds =\n | \"preferEnumComparison\"\n | \"preferEnumReturn\"\n | \"preferEnumUnion\";\n\ntype Options = readonly [];\n\nconst isEnumLikeOrUndefinedType = (\n checker: Readonly<ts.TypeChecker>,\n type: Readonly<ts.Type>\n): boolean => {\n let hasEnumLike = false;\n\n for (const typeVariant of tsutils.unionTypeParts(type)) {\n const apparentType = checker.getApparentType(typeVariant);\n\n if (isTypeFlagSet(typeVariant, ts.TypeFlags.Undefined)) {\n continue;\n }\n\n if (\n isTypeFlagSet(typeVariant, ts.TypeFlags.EnumLike) ||\n isTypeFlagSet(apparentType, ts.TypeFlags.EnumLike)\n ) {\n hasEnumLike = true;\n continue;\n }\n\n return false;\n }\n\n return hasEnumLike;\n};\n\nconst isStringLiteral = (node: Readonly<es.Node>): node is es.Literal =>\n node.type === \"Literal\" && typeof node.value === \"string\";\n\n/**\n * Prefer enums over string literal comparisons and unions.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const parserServices = ESLintUtils.getParserServices(context);\n const checker = parserServices.program.getTypeChecker();\n\n return {\n BinaryExpression: (node: Readonly<es.BinaryExpression>): void => {\n const isEqualityOperator =\n node.operator === \"==\" ||\n node.operator === \"===\" ||\n node.operator === \"!=\" ||\n node.operator === \"!==\";\n if (!isEqualityOperator) {\n return;\n }\n\n let literalNode: es.Literal | null = null;\n if (isStringLiteral(node.left)) {\n literalNode = node.left;\n } else if (isStringLiteral(node.right)) {\n literalNode = node.right;\n }\n const expressionNode =\n literalNode === node.left ? node.right : node.left;\n if (literalNode === null) {\n return;\n }\n\n const expressionType = getConstrainedTypeAtLocation(\n parserServices,\n expressionNode\n );\n if (!isEnumLikeOrUndefinedType(checker, expressionType)) {\n return;\n }\n\n context.report({\n messageId: \"preferEnumComparison\",\n node: literalNode,\n });\n },\n ReturnStatement: (node: Readonly<es.ReturnStatement>): void => {\n if (node.argument === null || !isStringLiteral(node.argument)) {\n return;\n }\n\n let functionNode:\n | es.ArrowFunctionExpression\n | es.FunctionDeclaration\n | es.FunctionExpression\n | null = null;\n for (const ancestor of context.sourceCode.getAncestors(node)) {\n if (\n ancestor.type === \"ArrowFunctionExpression\" ||\n ancestor.type === \"FunctionDeclaration\" ||\n ancestor.type === \"FunctionExpression\"\n ) {\n functionNode = ancestor;\n }\n }\n if (functionNode === null) {\n return;\n }\n\n const signature = arrayFirst(\n getConstrainedTypeAtLocation(\n parserServices,\n functionNode\n ).getCallSignatures()\n );\n const returnType = isDefined(signature)\n ? checker.getReturnTypeOfSignature(signature)\n : undefined;\n if (!isDefined(returnType)) {\n return;\n }\n\n if (!isEnumLikeOrUndefinedType(checker, returnType)) {\n return;\n }\n\n context.report({\n messageId: \"preferEnumReturn\",\n node: node.argument,\n });\n },\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n if (node.typeAnnotation.type !== \"TSUnionType\") {\n return;\n }\n\n let literalCount = 0;\n for (const typeNode of node.typeAnnotation.types) {\n if (\n typeNode.type === \"TSLiteralType\" &&\n typeNode.literal.type === \"Literal\" &&\n typeof typeNode.literal.value === \"string\"\n ) {\n literalCount += 1;\n }\n }\n if (\n literalCount > 1 &&\n literalCount === node.typeAnnotation.types.length\n ) {\n context.report({\n messageId: \"preferEnumUnion\",\n node,\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"enforce enums over string literal comparisons and pure string unions.\",\n frozen: false,\n recommended: false,\n requiresTypeChecking: true,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-enum\",\n },\n hasSuggestions: false,\n messages: {\n preferEnumComparison:\n \"Use enum members instead of string literals in enum comparisons.\",\n preferEnumReturn:\n \"Return enum members instead of string literals from enum-returning functions.\",\n preferEnumUnion:\n \"Prefer an enum declaration instead of a pure string-literal union type.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-enum\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestPreferNamedTupleMembers\";\n\ntype Options = readonly [];\n\nconst isUnnamedTupleElement = (\n tupleElement: Readonly<es.TypeNode>\n): boolean => {\n if (tupleElement.type === \"TSNamedTupleMember\") {\n return false;\n }\n\n if (\n tupleElement.type === \"TSRestType\" &&\n tupleElement.typeAnnotation.type === \"TSNamedTupleMember\"\n ) {\n return false;\n }\n\n return true;\n};\n\nconst generateUniqueTupleMemberName = (\n preferredName: string,\n usedNames: Readonly<{\n readonly add: (value: string) => unknown;\n readonly has: (value: string) => boolean;\n }>\n): string => {\n if (!usedNames.has(preferredName)) {\n usedNames.add(preferredName);\n\n return preferredName;\n }\n\n let suffix = 2;\n\n while (usedNames.has(`${preferredName}_${suffix}`)) {\n suffix += 1;\n }\n\n const generatedName = `${preferredName}_${suffix}`;\n\n usedNames.add(generatedName);\n\n return generatedName;\n};\n\nconst getTupleMemberReplacementText = (\n tupleElement: Readonly<es.TypeNode>,\n memberName: string,\n sourceCode: Readonly<TSESLint.SourceCode>\n): string => {\n if (tupleElement.type === \"TSOptionalType\") {\n return `${memberName}?: ${sourceCode.getText(tupleElement.typeAnnotation)}`;\n }\n\n if (tupleElement.type === \"TSRestType\") {\n if (tupleElement.typeAnnotation.type === \"TSNamedTupleMember\") {\n return sourceCode.getText(tupleElement);\n }\n\n return `...${memberName}: ${sourceCode.getText(tupleElement.typeAnnotation)}`;\n }\n\n return `${memberName}: ${sourceCode.getText(tupleElement)}`;\n};\n\n/**\n * Prefer named tuple members for readability.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSTupleType: (node: Readonly<es.TSTupleType>): void => {\n const hasUnnamedTupleElements = node.elementTypes.some(\n (tupleElement) => isUnnamedTupleElement(tupleElement)\n );\n\n if (!hasUnnamedTupleElements) {\n return;\n }\n\n const usedNames = new Set<string>(\n node.elementTypes.flatMap((tupleElement) => {\n if (tupleElement.type !== \"TSNamedTupleMember\") {\n return [];\n }\n\n if (tupleElement.label.type !== \"Identifier\") {\n return [];\n }\n\n return [tupleElement.label.name];\n })\n );\n\n let fixesByElement: readonly Readonly<{\n readonly replacementText: string;\n readonly tupleElement: es.TypeNode;\n }>[] = [];\n\n for (const [\n index,\n tupleElement,\n ] of node.elementTypes.entries()) {\n if (!isUnnamedTupleElement(tupleElement)) {\n continue;\n }\n\n const preferredName = `item${index + 1}`;\n const memberName = generateUniqueTupleMemberName(\n preferredName,\n usedNames\n );\n const replacementText = getTupleMemberReplacementText(\n tupleElement,\n memberName,\n sourceCode\n );\n\n fixesByElement = [\n ...fixesByElement,\n { replacementText, tupleElement },\n ];\n }\n\n const fix = (\n fixer: Readonly<TSESLint.RuleFixer>\n ): readonly TSESLint.RuleFix[] =>\n fixesByElement.map(({ replacementText, tupleElement }) =>\n fixer.replaceText(tupleElement, replacementText)\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n suggest: [\n {\n fix,\n messageId: \"suggestPreferNamedTupleMembers\",\n },\n ],\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit names for tuple members in TypeScript tuple types.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-named-tuple-members\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden:\n \"Prefer named tuple members for readability and API clarity.\",\n suggestPreferNamedTupleMembers:\n \"Add generated names to unnamed tuple members.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-named-tuple-members\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestPreferReadonlyArrayParameter\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Prefer readonly array-like parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestPreferReadonlyArrayParameter\",\n },\n ],\n });\n }\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-array-parameter\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like parameter types.\",\n suggestPreferReadonlyArrayParameter:\n \"Convert this parameter type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-array-parameter\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayJoin } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = arrayJoin(\n [\n \":not(TSTypeOperator[operator='readonly']) > :matches(TSArrayType, TSTupleType)\",\n \"TSTypeReference > Identifier[name='Array']\",\n ],\n \", \"\n);\n\n/**\n * Require readonly array and tuple type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"Identifier\" &&\n node.type !== \"TSArrayType\" &&\n node.type !== \"TSTupleType\"\n ) {\n return;\n }\n\n const fix =\n node.type === \"Identifier\"\n ? (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\")\n : (\n fixer: Readonly<TSESLint.RuleFixer>\n ): TSESLint.RuleFix =>\n fixer.replaceText(\n node,\n `readonly ${sourceCode.getText(node)}`\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node,\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly array and tuple type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-array\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly array or tuple types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-array\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSIndexSignature[readonly!=true]\";\n\n/**\n * Require readonly index signatures.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"TSIndexSignature\" || node.readonly) {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.insertTextBefore(node, \"readonly \"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly index signatures.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-index-signature\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly index signatures.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-index-signature\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Map']\";\n\n/**\n * Require ReadonlyMap in place of Map type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"ReadonlyMap\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require ReadonlyMap instead of Map in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-map\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly map types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-map\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAddReadonly\";\n\ntype Options = readonly [];\n\nconst selector =\n \":matches(PropertyDefinition, TSPropertySignature)[readonly!=true]\";\n\n/**\n * Require readonly modifiers on class and interface properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (\n node.type !== \"PropertyDefinition\" &&\n node.type !== \"TSPropertySignature\"\n ) {\n return;\n }\n\n const keyNode = node.key;\n\n const fix =\n keyNode.type === \"Identifier\" ||\n keyNode.type === \"PrivateIdentifier\" ||\n keyNode.type === \"Literal\"\n ? (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.insertTextBefore(keyNode, \"readonly \")\n : undefined;\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(isDefined(fix)\n ? {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestAddReadonly\",\n },\n ],\n }\n : {}),\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require readonly for class and interface properties.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-property\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly property declarations.\",\n suggestAddReadonly:\n \"Insert readonly modifier for this property declaration.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-property\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Record']\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const parent = typeReference.parent;\n\n if (parent?.type !== \"TSTypeParameterInstantiation\") {\n return false;\n }\n\n const maybeReadonlyTypeReference = parent.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\n/**\n * Require readonly wrappers around bare Record type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n const typeReference = node.parent;\n\n if (\n typeReference?.type !== \"TSTypeReference\" ||\n typeReference.typeName.type !== \"Identifier\" ||\n typeReference.typeName.name !== \"Record\" ||\n isReadonlyWrappedRecord(typeReference)\n ) {\n return;\n }\n\n context.report({\n fix: (fixer) => [\n fixer.replaceText(node, \"Readonly<Record\"),\n fixer.insertTextAfter(typeReference, \">\"),\n ],\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> instead of Record<...> in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-record\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly record types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-record\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\ntype Options = readonly [];\n\nconst selector = \"TSTypeReference > Identifier[name='Set']\";\n\n/**\n * Require ReadonlySet in place of Set type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"Identifier\") {\n return;\n }\n\n context.report({\n fix: (fixer) => fixer.replaceText(node, \"ReadonlySet\"),\n messageId: \"forbidden\",\n node,\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require ReadonlySet instead of Set in type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-prefer-readonly-set\",\n },\n fixable: \"code\",\n hasSuggestions: false,\n messages: {\n forbidden: \"Prefer readonly set types.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/prefer-readonly-set\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { isDefined } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAnnotateUnknown\";\n\ntype Options = readonly [];\n\nconst selector = \"PropertyDefinition[typeAnnotation=undefined][value=null]\";\n\n/**\n * Require explicit type annotations for uninitialized class properties.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"PropertyDefinition\") {\n return;\n }\n\n const canProvideSafeSuggestion =\n !node.computed &&\n node.key.type === \"Identifier\" &&\n !node.optional &&\n !node.definite;\n\n const fix = canProvideSafeSuggestion\n ? (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.insertTextAfter(node.key, \": unknown\")\n : undefined;\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(isDefined(fix)\n ? {\n fix,\n suggest: [\n {\n fix,\n messageId: \"suggestAnnotateUnknown\",\n },\n ],\n }\n : {}),\n });\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require explicit type annotations for class properties without initializers.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-prop-type-annotation\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Expecting a type annotation for this property.\",\n suggestAnnotateUnknown:\n \"Add an explicit ': unknown' type annotation.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/require-prop-type-annotation\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayPropertyType\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly array-like property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayPropertyType\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like property types.\",\n suggestRequireReadonlyArrayPropertyType:\n \"Convert this property type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayReturnType\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Require readonly array-like return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayReturnType\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like return types.\",\n suggestRequireReadonlyArrayReturnType:\n \"Convert this return type to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyArrayTypeAlias\";\n\ntype MutableArrayLikeTypeNode = es.Identifier | es.TSArrayType | es.TSTupleType;\n\ntype Options = readonly [];\n\nconst isArrayTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Array\";\n\nconst collectMutableArrayLikeTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableArrayLikeTypeNode[] => {\n if (typeNode.type === \"TSArrayType\" || typeNode.type === \"TSTupleType\") {\n return [typeNode];\n }\n\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableArrayLikeTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type === \"TSTypeReference\") {\n if (!isArrayTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n }\n\n return [];\n};\n\nconst buildReadonlyArrayLikeFix = (\n node: Readonly<MutableArrayLikeTypeNode>,\n sourceCode: Readonly<TSESLint.SourceCode>\n): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) => {\n if (node.type === \"Identifier\") {\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyArray\");\n }\n\n return (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);\n};\n\n/**\n * Require readonly array-like type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableArrayLikeTypeNodes =\n collectMutableArrayLikeTypeNodes(node.typeAnnotation);\n\n for (const mutableArrayLikeTypeNode of mutableArrayLikeTypeNodes) {\n const fix = buildReadonlyArrayLikeFix(\n mutableArrayLikeTypeNode,\n sourceCode\n );\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableArrayLikeTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyArrayTypeAlias\",\n },\n ],\n });\n }\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require readonly array and tuple type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-array-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly array-like type aliases.\",\n suggestRequireReadonlyArrayTypeAlias:\n \"Convert this type alias annotation to a readonly array-like form.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-array-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapParameterType\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyMapParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map parameter types.\",\n suggestRequireReadonlyMapParameterType:\n \"Convert this parameter type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapPropertyType\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly map property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map property types.\",\n suggestRequireReadonlyMapPropertyType:\n \"Convert this property type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapReturnType\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly es.Identifier[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<es.Identifier>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map return types.\",\n suggestRequireReadonlyMapReturnType:\n \"Convert this return type to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyMapTypeAlias\";\n\ntype MutableMapTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isMapTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Map\";\n\nconst collectMutableMapTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableMapTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableMapTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isMapTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlyMapFix =\n (\n node: Readonly<MutableMapTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlyMap\");\n\n/**\n * Require readonly map type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableMapTypeNodes = collectMutableMapTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableMapTypeNode of mutableMapTypeNodes) {\n const fix = buildReadonlyMapFix(mutableMapTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableMapTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyMapTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlyMap type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-map-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly map type aliases.\",\n suggestRequireReadonlyMapTypeAlias:\n \"Convert this type alias annotation to ReadonlyMap.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-map-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordParameterType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyRecordParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record parameter types.\",\n suggestRequireReadonlyRecordParameterType:\n \"Convert this parameter type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordPropertyType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly record property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlyRecordPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record property types.\",\n suggestRequireReadonlyRecordPropertyType:\n \"Convert this property type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordReturnType\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyRecordReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record return types.\",\n suggestRequireReadonlyRecordReturnType:\n \"Convert this return type to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlyRecordTypeAlias\";\n\ntype MutableRecordTypeReference = es.TSTypeReference & {\n readonly typeName: es.Identifier;\n};\n\ntype Options = readonly [];\n\nconst isRecordTypeReference = (\n typeNode: Readonly<es.TypeNode>\n): typeNode is Readonly<MutableRecordTypeReference> =>\n typeNode.type === \"TSTypeReference\" &&\n typeNode.typeName.type === \"Identifier\" &&\n typeNode.typeName.name === \"Record\";\n\nconst isReadonlyWrappedRecord = (\n typeReference: Readonly<es.TSTypeReference>\n): boolean => {\n const maybeTypeParameterInstantiation = typeReference.parent;\n\n if (\n maybeTypeParameterInstantiation?.type !== \"TSTypeParameterInstantiation\"\n ) {\n return false;\n }\n\n const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;\n\n return (\n maybeReadonlyTypeReference?.type === \"TSTypeReference\" &&\n maybeReadonlyTypeReference.typeName.type === \"Identifier\" &&\n maybeReadonlyTypeReference.typeName.name === \"Readonly\"\n );\n};\n\nconst collectMutableRecordTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableRecordTypeReference[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableRecordTypeNodes(subTypeNode)\n );\n }\n\n if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord(typeNode)) {\n return [];\n }\n\n return [typeNode];\n};\n\nconst buildReadonlyRecordFix =\n (\n node: Readonly<MutableRecordTypeReference>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => readonly TSESLint.RuleFix[]) =>\n (fixer: Readonly<TSESLint.RuleFixer>): readonly TSESLint.RuleFix[] => [\n fixer.replaceText(node.typeName, \"Readonly<Record\"),\n fixer.insertTextAfter(node, \">\"),\n ];\n\n/**\n * Require readonly record type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableRecordTypeNodes = collectMutableRecordTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableRecordTypeNode of mutableRecordTypeNodes) {\n const fix = buildReadonlyRecordFix(mutableRecordTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableRecordTypeNode.typeName,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlyRecordTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require Readonly<Record<...>> type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-record-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly record type aliases.\",\n suggestRequireReadonlyRecordTypeAlias:\n \"Convert this type alias annotation to Readonly<Record<...>>.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-record-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetParameterType\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getParametersFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<readonly es.Parameter[]> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.params;\n }\n\n return undefined;\n};\n\nconst getTypeAnnotationFromPattern = (\n pattern: Readonly<es.AssignmentPattern | es.BindingName | es.RestElement>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (pattern.type === \"AssignmentPattern\") {\n return getTypeAnnotationFromPattern(pattern.left);\n }\n\n if (pattern.type === \"RestElement\") {\n if (pattern.typeAnnotation !== undefined) {\n return pattern.typeAnnotation;\n }\n\n const argument = pattern.argument;\n\n if (\n argument.type !== \"ArrayPattern\" &&\n argument.type !== \"Identifier\" &&\n argument.type !== \"ObjectPattern\"\n ) {\n return undefined;\n }\n\n return argument.typeAnnotation;\n }\n\n return pattern.typeAnnotation;\n};\n\nconst getTypeAnnotationFromParameter = (\n parameter: Readonly<es.Parameter>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (parameter.type === \"TSParameterProperty\") {\n return getTypeAnnotationFromPattern(parameter.parameter);\n }\n\n return getTypeAnnotationFromPattern(parameter);\n};\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set parameter type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const parameters = getParametersFromFunctionLikeNode(node);\n\n if (parameters === undefined) {\n return;\n }\n\n for (const parameter of parameters) {\n const typeAnnotation =\n getTypeAnnotationFromParameter(parameter);\n\n if (typeAnnotation === undefined) {\n continue;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId:\n \"suggestRequireReadonlySetParameterType\",\n },\n ],\n });\n }\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet parameter type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-parameter-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set parameter types.\",\n suggestRequireReadonlySetParameterType:\n \"Convert this parameter type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-parameter-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetPropertyType\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\nconst isTopLevelPropertySignature = (\n node: Readonly<es.TSPropertySignature>\n): boolean => {\n const parent = node.parent;\n\n if (parent?.type === \"TSInterfaceBody\") {\n return true;\n }\n\n if (parent?.type !== \"TSTypeLiteral\") {\n return false;\n }\n\n const maybeTypeAliasDeclaration = parent.parent;\n\n return maybeTypeAliasDeclaration?.type === \"TSTypeAliasDeclaration\";\n};\n\n/**\n * Require readonly set property type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n \"TSPropertySignature[typeAnnotation!=null]\": (\n node: Readonly<es.TSPropertySignature>\n ): void => {\n if (!isTopLevelPropertySignature(node)) {\n return;\n }\n\n const typeAnnotation = node.typeAnnotation;\n\n if (typeAnnotation === undefined) {\n return;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n typeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetPropertyType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet property type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-property-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set property types.\",\n suggestRequireReadonlySetPropertyType:\n \"Convert this property type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-property-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetReturnType\";\n\ntype Options = readonly [];\n\nconst functionLikeNodeSelector =\n \":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)\";\n\nconst getReturnTypeAnnotationFromFunctionLikeNode = (\n node: Readonly<es.Node>\n): Readonly<es.TSTypeAnnotation> | undefined => {\n if (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"TSCallSignatureDeclaration\" ||\n node.type === \"TSConstructSignatureDeclaration\" ||\n node.type === \"TSConstructorType\" ||\n node.type === \"TSDeclareFunction\" ||\n node.type === \"TSEmptyBodyFunctionExpression\" ||\n node.type === \"TSFunctionType\" ||\n node.type === \"TSMethodSignature\"\n ) {\n return node.returnType;\n }\n\n return undefined;\n};\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly es.Identifier[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<es.Identifier>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set return type annotations.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n [functionLikeNodeSelector]: (node: Readonly<es.Node>): void => {\n const returnTypeAnnotation =\n getReturnTypeAnnotationFromFunctionLikeNode(node);\n\n if (returnTypeAnnotation === undefined) {\n return;\n }\n\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n returnTypeAnnotation.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetReturnType\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet return type annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-return-type\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set return types.\",\n suggestRequireReadonlySetReturnType:\n \"Convert this return type to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-return-type\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestRequireReadonlySetTypeAlias\";\n\ntype MutableSetTypeNode = es.Identifier;\n\ntype Options = readonly [];\n\nconst isSetTypeReference = (\n node: Readonly<es.TSTypeReference>\n): node is Readonly<\n es.TSTypeReference & { readonly typeName: es.Identifier }\n> => node.typeName.type === \"Identifier\" && node.typeName.name === \"Set\";\n\nconst collectMutableSetTypeNodes = (\n typeNode: Readonly<es.TypeNode>\n): readonly MutableSetTypeNode[] => {\n if (\n typeNode.type === \"TSIntersectionType\" ||\n typeNode.type === \"TSUnionType\"\n ) {\n return typeNode.types.flatMap((subTypeNode) =>\n collectMutableSetTypeNodes(subTypeNode)\n );\n }\n\n if (typeNode.type !== \"TSTypeReference\" || !isSetTypeReference(typeNode)) {\n return [];\n }\n\n return [typeNode.typeName];\n};\n\nconst buildReadonlySetFix =\n (\n node: Readonly<MutableSetTypeNode>\n ): ((fixer: Readonly<TSESLint.RuleFixer>) => TSESLint.RuleFix) =>\n (fixer: Readonly<TSESLint.RuleFixer>): TSESLint.RuleFix =>\n fixer.replaceText(node, \"ReadonlySet\");\n\n/**\n * Require readonly set type aliases.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => ({\n TSTypeAliasDeclaration: (\n node: Readonly<es.TSTypeAliasDeclaration>\n ): void => {\n const mutableSetTypeNodes = collectMutableSetTypeNodes(\n node.typeAnnotation\n );\n\n for (const mutableSetTypeNode of mutableSetTypeNodes) {\n const fix = buildReadonlySetFix(mutableSetTypeNode);\n\n context.report({\n fix,\n messageId: \"forbidden\",\n node: mutableSetTypeNode,\n suggest: [\n {\n fix,\n messageId: \"suggestRequireReadonlySetTypeAlias\",\n },\n ],\n });\n }\n },\n }),\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description: \"require ReadonlySet type alias annotations.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-readonly-set-type-alias\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: \"Prefer readonly set type aliases.\",\n suggestRequireReadonlySetTypeAlias:\n \"Convert this type alias annotation to ReadonlySet.\",\n },\n schema: [],\n type: \"suggestion\",\n },\n name: \"typescript/require-readonly-set-type-alias\",\n});\n\nexport default rule;\n", "import type { TSESTree as es, TSESLint } from \"@typescript-eslint/utils\";\n\nimport { arrayFirst } from \"ts-extras\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\" | \"suggestAddThisVoid\";\n\ntype Options = readonly [];\n\nconst selector =\n \"MethodDefinition[static=true] > FunctionExpression:not([params.0.name='this'][params.0.typeAnnotation.typeAnnotation.type='TSVoidKeyword'])\";\n\nconst createThisVoidSuggestionFix = (\n sourceCode: Readonly<TSESLint.SourceCode>,\n functionExpression: Readonly<es.FunctionExpression>\n): TSESLint.ReportFixFunction | undefined => {\n const firstParameter = arrayFirst(functionExpression.params);\n\n if (\n firstParameter?.type === \"Identifier\" &&\n firstParameter.name === \"this\"\n ) {\n const existingTypeAnnotation = firstParameter.typeAnnotation;\n\n if (existingTypeAnnotation === undefined) {\n return (fixer) => fixer.insertTextAfter(firstParameter, \": void\");\n }\n\n return (fixer) => fixer.replaceText(existingTypeAnnotation, \": void\");\n }\n\n const openingParenthesisToken =\n sourceCode.getFirstToken(functionExpression);\n if (openingParenthesisToken?.value !== \"(\") {\n return undefined;\n }\n\n return (fixer) =>\n fixer.insertTextAfter(\n openingParenthesisToken,\n firstParameter === undefined ? \"this: void\" : \"this: void, \"\n );\n};\n\n/**\n * Require static class methods to declare `this: void`.\n */\nconst rule: ReturnType<typeof ruleCreator<Options, MessageIds>> = ruleCreator<\n Options,\n MessageIds\n>({\n create: (context) => {\n const sourceCode = context.sourceCode;\n\n return {\n [selector]: (node: Readonly<es.Node>): void => {\n if (node.type !== \"FunctionExpression\") {\n return;\n }\n\n const suggestionFix = createThisVoidSuggestionFix(\n sourceCode,\n node\n );\n\n context.report({\n messageId: \"forbidden\",\n node,\n ...(suggestionFix === undefined\n ? {}\n : {\n fix: suggestionFix,\n suggest: [\n {\n fix: suggestionFix,\n messageId: \"suggestAddThisVoid\",\n },\n ],\n }),\n });\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"require static class methods to declare `this: void`.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-require-this-void\",\n },\n fixable: \"code\",\n hasSuggestions: true,\n messages: {\n forbidden: 'Add \"this: void\" to static method signatures.',\n suggestAddThisVoid: 'Insert \"this: void\" parameter in signature.',\n },\n schema: [],\n type: \"problem\",\n },\n name: \"typescript/require-this-void\",\n});\n\nexport default rule;\n", "import type { TSESTree as es } from \"@typescript-eslint/utils\";\n\nimport { ruleCreator } from \"../_internal/rule-creator.js\";\n\ntype MessageIds = \"forbidden\";\n\nconst internalTagPattern = /@internal\\b/u;\n\nconst isNonUnderscoreIdentifier = (\n identifier: Readonly<es.Identifier>\n): boolean => !identifier.name.startsWith(\"_\");\n\nconst isExportDeclaration = (\n node: null | Readonly<es.Node> | undefined\n): node is es.ExportDefaultDeclaration | es.ExportNamedDeclaration =>\n node?.type === \"ExportDefaultDeclaration\" ||\n node?.type === \"ExportNamedDeclaration\";\n\n/**\n * Enforce underscore prefixes for declarations marked with `@internal`.\n */\nconst rule: ReturnType<typeof ruleCreator<readonly [], MessageIds>> =\n ruleCreator<readonly [], MessageIds>({\n create: (context) => {\n const hasInternalTag = (node: Readonly<es.Node>): boolean => {\n let commentTargets: readonly es.Node[] = [node];\n if (isExportDeclaration(node.parent)) {\n commentTargets = [...commentTargets, node.parent];\n }\n\n return commentTargets.some((commentTarget) =>\n context.sourceCode\n .getCommentsBefore(commentTarget)\n .some((comment) =>\n internalTagPattern.test(comment.value)\n )\n );\n };\n\n const reportIfInternal = (\n nameIdentifier: Readonly<es.Identifier>,\n commentTarget: Readonly<es.Node>\n ): void => {\n if (!isNonUnderscoreIdentifier(nameIdentifier)) {\n return;\n }\n\n if (!hasInternalTag(commentTarget)) {\n return;\n }\n\n context.report({\n messageId: \"forbidden\",\n node: nameIdentifier,\n });\n };\n\n return {\n \"ClassDeclaration[id.type='Identifier']\": (\n node: Readonly<es.ClassDeclaration>\n ) => {\n if (node.id === null) {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"FunctionDeclaration[id.type='Identifier']\": (\n node: Readonly<es.FunctionDeclaration>\n ) => {\n if (node.id === null) {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"MethodDefinition[key.type='Identifier']\": (\n node: Readonly<es.MethodDefinition>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"PropertyDefinition[key.type='Identifier']\": (\n node: Readonly<es.PropertyDefinition>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSEnumDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSEnumDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"TSEnumMember[id.type='Identifier']\": (\n node: Readonly<es.TSEnumMember>\n ) => {\n if (node.id.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.id, node);\n },\n \"TSInterfaceDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSInterfaceDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"TSMethodSignature[key.type='Identifier']\": (\n node: Readonly<es.TSMethodSignature>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSPropertySignature[key.type='Identifier']\": (\n node: Readonly<es.TSPropertySignature>\n ) => {\n if (node.key.type !== \"Identifier\") {\n return;\n }\n\n reportIfInternal(node.key, node);\n },\n \"TSTypeAliasDeclaration[id.type='Identifier']\": (\n node: Readonly<es.TSTypeAliasDeclaration>\n ) => {\n reportIfInternal(node.id, node);\n },\n \"VariableDeclarator[id.type='Identifier']\": (\n node: Readonly<es.VariableDeclarator>\n ) => {\n if (node.id.type !== \"Identifier\") {\n return;\n }\n\n const declaration = node.parent;\n if (declaration?.type !== \"VariableDeclaration\") {\n return;\n }\n\n reportIfInternal(node.id, declaration);\n },\n };\n },\n meta: {\n deprecated: false,\n docs: {\n deprecated: false,\n description:\n \"disallow internal APIs that are not prefixed with underscores.\",\n frozen: false,\n recommended: false,\n url: \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/underscore-internal\",\n },\n hasSuggestions: false,\n messages: {\n forbidden:\n \"Internal APIs not prefixed with underscores are forbidden.\",\n },\n schema: [],\n type: \"problem\",\n },\n name: \"underscore-internal\",\n });\n\nexport default rule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `unicorn/no-unused-properties`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"no-unused-properties\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/unused-internal-properties\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/no-unused-properties.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"no-unused-properties\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md\",\n },\n }),\n ],\n ruleId: \"unused-internal-properties\",\n});\n\nexport default deprecatedRule;\n", "import unicornPlugin from \"eslint-plugin-unicorn\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `unicorn/no-unreadable-iife`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n unicornPlugin,\n \"no-unreadable-iife\",\n \"eslint-plugin-unicorn\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/uppercase-iife\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of unicorn/no-unreadable-iife.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"unicorn\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn\",\n },\n rule: {\n name: \"no-unreadable-iife\",\n url: \"https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md\",\n },\n }),\n ],\n ruleId: \"uppercase-iife\",\n});\n\nexport default deprecatedRule;\n", "import writeGoodCommentsPlugin from \"eslint-plugin-write-good-comments-2\";\n\nimport {\n adaptExternalRule,\n getExternalRuleFromPlugin,\n} from \"../_internal/create-external-rule.js\";\nimport {\n createReplacementRuleInfo,\n withDeprecatedRuleLifecycle,\n} from \"../_internal/rule-deprecation.js\";\n\n/**\n * Proxy of external `write-good-comments/write-good-comments`.\n */\nconst rule: ReturnType<typeof adaptExternalRule> = adaptExternalRule(\n getExternalRuleFromPlugin(\n writeGoodCommentsPlugin,\n \"write-good-comments\",\n \"eslint-plugin-write-good-comments-2\"\n ),\n \"https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/words\"\n);\n\n/**\n * Wrapper rule with explicit lifecycle metadata and replacement mapping.\n */\nconst deprecatedRule: typeof rule = withDeprecatedRuleLifecycle(rule, {\n message: \"Deprecated in favor of write-good-comments/write-good-comments.\",\n replacedBy: [\n createReplacementRuleInfo({\n plugin: {\n name: \"write-good-comments\",\n url: \"https://github.com/Nick2bad4u/eslint-plugin-write-good-comments-2\",\n },\n rule: {\n name: \"write-good-comments\",\n url: \"https://github.com/Nick2bad4u/eslint-plugin-write-good-comments-2\",\n },\n }),\n ],\n ruleId: \"words\",\n});\n\nexport default deprecatedRule;\n", "/* eslint-disable canonical/no-reassign-imports -- Rule entry map intentionally references imported plugin rules object. */\n\nimport { objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\n\ntype AllConfig = {\n readonly name: \"etc-misc/all\";\n readonly rules: Readonly<Record<string, RuleSeverity>>;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst getAllPresetSeverity = (\n ruleModule: Readonly<(typeof pluginRules)[string]>\n): RuleSeverity => {\n if (ruleModule.meta.deprecated !== false) {\n return \"warn\";\n }\n\n return ruleModule.meta.type === \"problem\" ? \"error\" : \"warn\";\n};\n\nconst allRuleEntries = objectEntries(pluginRules).map(\n ([ruleName, ruleModule]) =>\n [`etc-misc/${ruleName}`, getAllPresetSeverity(ruleModule)] as const\n);\n\nconst allRules = objectFromEntries(allRuleEntries) as Readonly<\n Record<string, RuleSeverity>\n>;\n\n/**\n * Flat config preset enabling every available plugin rule.\n */\nexport const all: AllConfig = {\n name: \"etc-misc/all\",\n rules: allRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "/**\n * Minimal starter preset: `recommended` without the `prefer-readonly*` rules.\n */\nexport const minimal = {\n name: \"etc-misc/minimal\",\n rules: {\n \"etc-misc/consistent-optional-props\": \"warn\",\n \"etc-misc/no-assign-mutated-array\": \"error\",\n \"etc-misc/no-const-enum\": \"warn\",\n \"etc-misc/no-function-declare-after-return\": \"warn\",\n \"etc-misc/no-implicit-any-catch\": \"error\",\n \"etc-misc/no-internal\": \"error\",\n \"etc-misc/no-t\": \"error\",\n \"etc-misc/no-unnecessary-as-const\": \"warn\",\n \"etc-misc/no-unnecessary-break\": \"warn\",\n \"etc-misc/no-unnecessary-initialization\": \"warn\",\n \"etc-misc/no-unnecessary-template-literal\": \"warn\",\n \"etc-misc/no-vulnerable\": \"error\",\n \"etc-misc/throw-error\": \"error\",\n \"etc-misc/typescript/no-boolean-literal-type\": \"error\",\n \"etc-misc/typescript/require-readonly-array-return-type\": \"warn\",\n \"etc-misc/typescript/require-this-void\": \"warn\",\n },\n} as const;\n", "/**\n * Opinionated starter preset for the plugin.\n */\nexport const recommended = {\n name: \"etc-misc/recommended\",\n rules: {\n \"etc-misc/consistent-optional-props\": \"warn\",\n \"etc-misc/no-assign-mutated-array\": \"error\",\n \"etc-misc/no-const-enum\": \"warn\",\n \"etc-misc/no-function-declare-after-return\": \"warn\",\n \"etc-misc/no-implicit-any-catch\": \"error\",\n \"etc-misc/no-internal\": \"error\",\n \"etc-misc/no-t\": \"error\",\n \"etc-misc/no-unnecessary-as-const\": \"warn\",\n \"etc-misc/no-unnecessary-break\": \"warn\",\n \"etc-misc/no-unnecessary-initialization\": \"warn\",\n \"etc-misc/no-unnecessary-template-literal\": \"warn\",\n \"etc-misc/no-vulnerable\": \"error\",\n \"etc-misc/throw-error\": \"error\",\n \"etc-misc/typescript/no-boolean-literal-type\": \"error\",\n \"etc-misc/typescript/prefer-readonly-array\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-array-parameter\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-index-signature\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-map\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-property\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-record\": \"warn\",\n \"etc-misc/typescript/prefer-readonly-set\": \"warn\",\n \"etc-misc/typescript/require-readonly-array-return-type\": \"warn\",\n \"etc-misc/typescript/require-this-void\": \"warn\",\n },\n} as const;\n", "/* eslint-disable canonical/no-reassign-imports -- Flat-config strict type-checked preset intentionally inspects imported plugin rule metadata. */\n\nimport { keyIn, objectEntries, objectFromEntries } from \"ts-extras\";\n\nimport { rules as pluginRules } from \"../rules.js\";\nimport { strict } from \"./strict.js\";\n\ntype RuleDocsMetadata = Readonly<{\n readonly requiresTypeChecking?: boolean;\n}>;\n\ntype StrictTypeCheckedConfig = {\n readonly languageOptions: Readonly<{\n readonly parserOptions: Readonly<{\n readonly projectService: true;\n }>;\n }>;\n readonly name: \"etc-misc/strict-type-checked\";\n readonly rules: Readonly<Record<string, \"error\">>;\n};\n\nconst additionalTypeCheckedRuleEntries: readonly (readonly [\n string,\n \"error\",\n])[] = objectEntries(pluginRules).flatMap(([ruleName, ruleModule]) => {\n if (ruleModule.meta.deprecated !== false) {\n return [];\n }\n\n const docsMetadata = ruleModule.meta.docs as RuleDocsMetadata | undefined;\n\n if (docsMetadata?.requiresTypeChecking !== true) {\n return [];\n }\n\n const qualifiedRuleName = `etc-misc/${ruleName}`;\n\n if (keyIn(strict.rules, qualifiedRuleName)) {\n return [];\n }\n\n return [[qualifiedRuleName, \"error\"] as const];\n});\n\nconst strictTypeCheckedRules = {\n ...strict.rules,\n ...objectFromEntries(additionalTypeCheckedRuleEntries),\n} satisfies Readonly<Record<string, \"error\">>;\n\n/**\n * Strict preset augmented with every non-deprecated rule that requires type\n * information.\n */\nexport const strictTypeChecked: StrictTypeCheckedConfig = {\n languageOptions: {\n parserOptions: {\n projectService: true,\n },\n },\n name: \"etc-misc/strict-type-checked\",\n rules: strictTypeCheckedRules,\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions for the remainder of the file. */\n", "import { objectFromEntries, objectKeys, safeCastTo } from \"ts-extras\";\n\nimport { recommended } from \"./recommended.js\";\n\ntype StrictConfig = {\n readonly name: \"etc-misc/strict\";\n readonly rules: StrictRules;\n};\n\ntype StrictRules = Readonly<{\n readonly [TRuleName in keyof typeof recommended.rules]: \"error\";\n}>;\n\nconst recommendedRuleNames = safeCastTo<\n readonly (keyof typeof recommended.rules)[]\n>(objectKeys(recommended.rules));\n\nconst strictRules = objectFromEntries(\n recommendedRuleNames.map((ruleName) => [ruleName, \"error\"] as const)\n) as StrictRules;\n\n/**\n * Strict preset that promotes every recommended rule to `error`.\n */\nexport const strict: StrictConfig = {\n name: \"etc-misc/strict\",\n rules: strictRules,\n};\n", "/* eslint-disable canonical/no-reassign-imports -- Flat-config preset object intentionally references imported preset modules. */\n\nimport { pluginMeta } from \"./_internal/plugin-meta.js\";\nimport { allStrict as allStrictConfig } from \"./configs/all-strict.js\";\nimport { all as allConfig } from \"./configs/all.js\";\nimport { minimal as minimalConfig } from \"./configs/minimal.js\";\nimport { recommended as recommendedConfig } from \"./configs/recommended.js\";\nimport { strictTypeChecked as strictTypeCheckedConfig } from \"./configs/strict-type-checked.js\";\nimport { strict as strictConfig } from \"./configs/strict.js\";\nimport { rules } from \"./rules.js\";\n\ntype PluginReference = {\n readonly meta: typeof pluginMeta;\n readonly rules: typeof rules;\n};\n\ntype PresetWithPlugin<\n TName extends string,\n TRules extends Readonly<Record<string, RuleSeverity>>,\n> = {\n readonly name: TName;\n readonly plugins: Readonly<\n Record<typeof pluginMeta.namespace, PluginReference>\n >;\n readonly rules: TRules;\n};\n\ntype RuleSeverity = \"error\" | \"warn\";\n\nconst pluginReference: PluginReference = {\n meta: pluginMeta,\n rules,\n};\n\nconst withPluginReference = <\n TName extends string,\n TRules extends Readonly<Record<string, RuleSeverity>>,\n>(\n config: Readonly<{ readonly name: TName; readonly rules: TRules }>\n): PresetWithPlugin<TName, TRules> => ({\n name: config.name,\n plugins: {\n [pluginMeta.namespace]: pluginReference,\n },\n rules: config.rules,\n});\n\n/**\n * Available flat-config presets exported by the plugin.\n */\nexport type PluginConfigs = {\n readonly all: PresetWithPlugin<\n typeof allConfig.name,\n typeof allConfig.rules\n >;\n readonly allStrict: PresetWithPlugin<\n typeof allStrictConfig.name,\n typeof allStrictConfig.rules\n >;\n readonly minimal: PresetWithPlugin<\n typeof minimalConfig.name,\n typeof minimalConfig.rules\n >;\n readonly recommended: PresetWithPlugin<\n typeof recommendedConfig.name,\n typeof recommendedConfig.rules\n >;\n readonly strict: PresetWithPlugin<\n typeof strictConfig.name,\n typeof strictConfig.rules\n >;\n readonly strictTypeChecked: PresetWithPlugin<\n typeof strictTypeCheckedConfig.name,\n typeof strictTypeCheckedConfig.rules\n > & {\n readonly languageOptions: typeof strictTypeCheckedConfig.languageOptions;\n };\n};\n\n/**\n * Plugin configuration presets.\n */\nexport const configs: PluginConfigs = {\n all: withPluginReference(allConfig),\n allStrict: withPluginReference(allStrictConfig),\n minimal: withPluginReference(minimalConfig),\n recommended: withPluginReference(recommendedConfig),\n strict: withPluginReference(strictConfig),\n strictTypeChecked: {\n ...withPluginReference(strictTypeCheckedConfig),\n languageOptions: strictTypeCheckedConfig.languageOptions,\n },\n};\n\n/* eslint-enable canonical/no-reassign-imports -- Re-enable canonical import reassignment restrictions outside this intentional assembly block. */\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACGO,IAAM,aAAa;EACtB,MAAM;EACN,WAAW;EACX,SAAS;;;;ACJb,IAAAA,qBAAiD;;;ACCjD,IAAAC,qBAA8D;;;ACiB9D,IAAM,uBAAuB,CAAC,iBAC1B,GAAG,YAAY,GAAG,SAAS,GAAG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ACrC,MAAM;EACN;;AAGJ,IAAM,sBAAsB,CAIxB,YACmC;EACnC,MAAM,OAAO;EACb,SAAS;IACL,CAAC,WAAW,SAAS,GAAG;;EAE5B,OAAO,OAAO;;AAsCX,IAAM,UAAyB;EAClC,KAAK,oBAAoB,GAAS;EAClC,WAAW,oBAAoB,SAAe;EAC9C,SAAS,oBAAoB,OAAa;EAC1C,aAAa,oBAAoB,WAAiB;EAClD,QAAQ,oBAAoB,MAAY;EACxC,mBAAmB;IACf,GAAG,oBAAoB,iBAAuB;IAC9C,iBAAiB,kBAAwB;;;;;A1J5EjD,IAAM,SAAuB;EACzB;EACA,MAAM;EACN,YAAY,CAAA;EACZ;;AAGJ,IAAA,iBAAe;",
|
|
6
|
+
"names": ["import_ts_extras", "import_ts_extras", "plugin", "rules", "externalRule", "import_ts_extras", "rule", "tsEslintPlugin", "rule", "import_ts_extras", "rule", "import_ts_extras", "isEmpty", "rule", "rule", "import_ts_extras", "import_ts_extras", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "rule", "import_ts_extras", "selector", "rule", "rule", "deprecatedRule", "disallowedSelector", "rule", "import_ts_extras", "rule", "import_ts_extras", "rule", "import_node_path", "import_ts_extras", "rule", "exports", "import_node_path", "import_ts_extras", "selector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_utils", "import_ts_extras", "rule", "rule", "rule", "disallowedSelector", "rule", "import_ts_extras", "parser", "rule", "deprecatedRule", "import_ts_extras", "defaultOptions", "rule", "import_utils", "import_ts_extras", "import_ts_extras", "import_type_utils", "import_ts_extras", "normalized", "matchesAnyPattern", "defaultOptions", "rule", "matchesAnyPattern", "deprecatedRule", "rule", "import_ts_extras", "splitLines", "rule", "import_type_utils", "import_utils", "import_ts_extras", "defaultOptions", "rule", "import_ts_extras", "rule", "import_type_utils", "import_utils", "import_ts_extras", "defaultOptions", "rule", "rule", "rule", "import_utils", "import_ts_extras", "defaultOptions", "rule", "matchesAnyPattern", "import_ts_extras", "disallowedSelector", "rule", "import_utils", "import_ts_extras", "rule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_ts_extras", "rule", "rule", "import_ts_extras", "rule", "rule", "deprecatedRule", "import_ts_extras", "import_ts_extras", "selector", "rule", "selector", "deprecatedRule", "rule", "noSecretsPlugin", "deprecatedRule", "import_node_path", "import_ts_extras", "rule", "deprecatedRule", "rule", "deprecatedRule", "rule", "commentText", "rule", "defaultOptions", "rule", "import_ts_extras", "disallowedSelector", "rule", "disallowedSelector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_ts_extras", "disallowedSelector", "rule", "import_ts_extras", "selector", "rule", "rule", "eslintCommentsPlugin", "deprecatedRule", "import_ts_extras", "rule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_eslint_plugin", "rule", "tsEslintPlugin", "deprecatedRule", "import_node_path", "import_ts_extras", "isUnknownRecord", "rule", "externalRule", "rule", "rule", "import_ts_extras", "rule", "disallowedSelector", "rule", "disallowedSelector", "rule", "rule", "unicornPlugin", "deprecatedRule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "defaultOptions", "rule", "deprecatedRule", "rule", "externalRule", "rule", "deprecatedRule", "selector", "rule", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "rule", "selector", "disallowedSelector", "rule", "import_ts_extras", "buildFix", "rule", "disallowedSelector", "rule", "import_ts_extras", "rule", "deprecatedRule", "disallowedSelector", "rule", "import_ts_extras", "buildFix", "rule", "import_ts_extras", "buildFix", "rule", "import_ts_extras", "rule", "import_ts_extras", "rule", "deprecatedRule", "import_ts_extras", "buildFix", "rule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "rule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "import_type_utils", "import_utils", "import_ts_extras", "readonlyArrayTypeNames", "isArrayLikeType", "rule", "import_ts_extras", "rule", "deprecatedRule", "selector", "rule", "selector", "rule", "selector", "rule", "deprecatedRule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "selector", "rule", "deprecatedRule", "import_ts_extras", "selector", "rule", "deprecatedRule", "selector", "rule", "import_type_utils", "import_utils", "rule", "import_ts_extras", "unwrapExpression", "rule", "import_ts_extras", "unwrapExpression", "isDefinitelyDefinedExpression", "buildFixedTypeText", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "selector", "buildFixedTypeText", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "hasDefinitelyDefinedReturnValue", "rule", "import_ts_extras", "buildFixedTypeText", "unwrapExpression", "isDefinitelyDefinedExpression", "isNeverReassigned", "rule", "deprecatedRule", "import_type_utils", "import_utils", "tsutils", "rule", "rule", "selector", "rule", "selector", "rule", "import_type_utils", "import_utils", "import_ts_extras", "tsutils", "ts", "rule", "memberName", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "rule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "import_ts_extras", "selector", "rule", "selector", "rule", "selector", "rule", "import_ts_extras", "selector", "rule", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "functionLikeNodeSelector", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "isArrayTypeReference", "collectMutableArrayLikeTypeNodes", "buildReadonlyArrayLikeFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "rule", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "rule", "isMapTypeReference", "collectMutableMapTypeNodes", "buildReadonlyMapFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "isReadonlyWrappedRecord", "rule", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "rule", "isRecordTypeReference", "isReadonlyWrappedRecord", "collectMutableRecordTypeNodes", "buildReadonlyRecordFix", "rule", "functionLikeNodeSelector", "getParametersFromFunctionLikeNode", "getTypeAnnotationFromPattern", "getTypeAnnotationFromParameter", "rule", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "isTopLevelPropertySignature", "rule", "functionLikeNodeSelector", "getReturnTypeAnnotationFromFunctionLikeNode", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "rule", "isSetTypeReference", "collectMutableSetTypeNodes", "buildReadonlySetFix", "rule", "import_ts_extras", "selector", "rule", "rule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "import_eslint_plugin_unicorn", "rule", "unicornPlugin", "deprecatedRule", "rule", "writeGoodCommentsPlugin", "deprecatedRule", "import_ts_extras", "import_ts_extras", "import_ts_extras", "recommendedRuleNames"]
|
|
7
7
|
}
|