eslint-plugin-etc-misc 1.1.3 → 1.1.5

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.
Files changed (287) hide show
  1. package/dist/_internal/casing.js +1 -1
  2. package/dist/_internal/casing.js.map +1 -1
  3. package/dist/_internal/create-external-rule.d.ts +2 -1
  4. package/dist/_internal/create-external-rule.d.ts.map +1 -1
  5. package/dist/_internal/create-external-rule.js +56 -7
  6. package/dist/_internal/create-external-rule.js.map +1 -1
  7. package/dist/_internal/get-core-rule.d.ts +1 -5
  8. package/dist/_internal/get-core-rule.d.ts.map +1 -1
  9. package/dist/_internal/get-core-rule.js.map +1 -1
  10. package/dist/_internal/identifier-blocks.js +3 -3
  11. package/dist/_internal/import-patterns.d.ts.map +1 -1
  12. package/dist/_internal/import-patterns.js +6 -5
  13. package/dist/_internal/import-patterns.js.map +1 -1
  14. package/dist/_internal/rule-creator.d.ts +7 -7
  15. package/dist/_internal/rule-creator.d.ts.map +1 -1
  16. package/dist/_internal/rule-creator.js +2 -1
  17. package/dist/_internal/rule-creator.js.map +1 -1
  18. package/dist/_internal/symbol-usage.d.ts.map +1 -1
  19. package/dist/_internal/symbol-usage.js +15 -14
  20. package/dist/_internal/symbol-usage.js.map +1 -1
  21. package/dist/_internal/syntax-selectors.js +1 -1
  22. package/dist/_internal/syntax-selectors.js.map +1 -1
  23. package/dist/configs/all-strict.d.ts +2 -2
  24. package/dist/configs/all-strict.d.ts.map +1 -1
  25. package/dist/configs/all-strict.js +9 -6
  26. package/dist/configs/all-strict.js.map +1 -1
  27. package/dist/configs/all.d.ts +2 -2
  28. package/dist/configs/all.d.ts.map +1 -1
  29. package/dist/configs/all.js +9 -3
  30. package/dist/configs/all.js.map +1 -1
  31. package/dist/configs/strict-type-checked.d.ts +2 -2
  32. package/dist/configs/strict-type-checked.d.ts.map +1 -1
  33. package/dist/configs/strict-type-checked.js +5 -4
  34. package/dist/configs/strict-type-checked.js.map +1 -1
  35. package/dist/configs/strict.d.ts +2 -2
  36. package/dist/configs/strict.d.ts.map +1 -1
  37. package/dist/configs/strict.js +6 -1
  38. package/dist/configs/strict.js.map +1 -1
  39. package/dist/configs.d.ts +6 -6
  40. package/dist/configs.d.ts.map +1 -1
  41. package/dist/plugin.cjs +752 -527
  42. package/dist/plugin.cjs.map +3 -3
  43. package/dist/plugin.d.cts +2 -2
  44. package/dist/plugin.d.ts +2 -2
  45. package/dist/plugin.d.ts.map +1 -1
  46. package/dist/rules/class-match-filename.js +3 -3
  47. package/dist/rules/class-match-filename.js.map +1 -1
  48. package/dist/rules/comment-spacing.d.ts.map +1 -1
  49. package/dist/rules/comment-spacing.js +6 -3
  50. package/dist/rules/comment-spacing.js.map +1 -1
  51. package/dist/rules/consistent-empty-lines.js +1 -1
  52. package/dist/rules/consistent-import.d.ts.map +1 -1
  53. package/dist/rules/consistent-import.js +4 -3
  54. package/dist/rules/consistent-import.js.map +1 -1
  55. package/dist/rules/consistent-optional-props.d.ts.map +1 -1
  56. package/dist/rules/consistent-optional-props.js +3 -2
  57. package/dist/rules/consistent-optional-props.js.map +1 -1
  58. package/dist/rules/export-matching-filename-only.d.ts.map +1 -1
  59. package/dist/rules/export-matching-filename-only.js +13 -14
  60. package/dist/rules/export-matching-filename-only.js.map +1 -1
  61. package/dist/rules/match-filename.d.ts.map +1 -1
  62. package/dist/rules/match-filename.js +4 -3
  63. package/dist/rules/match-filename.js.map +1 -1
  64. package/dist/rules/no-assign-mutated-array.d.ts.map +1 -1
  65. package/dist/rules/no-assign-mutated-array.js +14 -14
  66. package/dist/rules/no-assign-mutated-array.js.map +1 -1
  67. package/dist/rules/no-commented-out-code.d.ts.map +1 -1
  68. package/dist/rules/no-commented-out-code.js +15 -13
  69. package/dist/rules/no-commented-out-code.js.map +1 -1
  70. package/dist/rules/no-const-enum.d.ts.map +1 -1
  71. package/dist/rules/no-const-enum.js +2 -1
  72. package/dist/rules/no-const-enum.js.map +1 -1
  73. package/dist/rules/no-expression-empty-lines.js +1 -1
  74. package/dist/rules/no-foreach.d.ts.map +1 -1
  75. package/dist/rules/no-foreach.js +2 -2
  76. package/dist/rules/no-foreach.js.map +1 -1
  77. package/dist/rules/no-function-declare-after-return.d.ts.map +1 -1
  78. package/dist/rules/no-function-declare-after-return.js +17 -12
  79. package/dist/rules/no-function-declare-after-return.js.map +1 -1
  80. package/dist/rules/no-implicit-any-catch.d.ts.map +1 -1
  81. package/dist/rules/no-implicit-any-catch.js +8 -7
  82. package/dist/rules/no-implicit-any-catch.js.map +1 -1
  83. package/dist/rules/no-misused-generics.d.ts.map +1 -1
  84. package/dist/rules/no-misused-generics.js +0 -1
  85. package/dist/rules/no-misused-generics.js.map +1 -1
  86. package/dist/rules/no-param-reassign.d.ts.map +1 -1
  87. package/dist/rules/no-param-reassign.js +9 -9
  88. package/dist/rules/no-param-reassign.js.map +1 -1
  89. package/dist/rules/no-self-import.js +11 -11
  90. package/dist/rules/no-self-import.js.map +1 -1
  91. package/dist/rules/no-shadow.d.ts.map +1 -1
  92. package/dist/rules/no-shadow.js +2 -1
  93. package/dist/rules/no-shadow.js.map +1 -1
  94. package/dist/rules/no-single-line-comment.d.ts.map +1 -1
  95. package/dist/rules/no-single-line-comment.js +3 -2
  96. package/dist/rules/no-single-line-comment.js.map +1 -1
  97. package/dist/rules/no-unnecessary-as-const.d.ts.map +1 -1
  98. package/dist/rules/no-unnecessary-as-const.js +4 -3
  99. package/dist/rules/no-unnecessary-as-const.js.map +1 -1
  100. package/dist/rules/no-unnecessary-break.d.ts.map +1 -1
  101. package/dist/rules/no-unnecessary-break.js +4 -2
  102. package/dist/rules/no-unnecessary-break.js.map +1 -1
  103. package/dist/rules/no-unnecessary-template-literal.d.ts.map +1 -1
  104. package/dist/rules/no-unnecessary-template-literal.js +3 -2
  105. package/dist/rules/no-unnecessary-template-literal.js.map +1 -1
  106. package/dist/rules/no-use-extend-native.d.ts.map +1 -1
  107. package/dist/rules/no-use-extend-native.js +23 -19
  108. package/dist/rules/no-use-extend-native.js.map +1 -1
  109. package/dist/rules/no-vulnerable.d.ts.map +1 -1
  110. package/dist/rules/no-vulnerable.js +145 -7
  111. package/dist/rules/no-vulnerable.js.map +1 -1
  112. package/dist/rules/only-export-name.d.ts.map +1 -1
  113. package/dist/rules/only-export-name.js +7 -8
  114. package/dist/rules/only-export-name.js.map +1 -1
  115. package/dist/rules/prefer-includes.js +2 -2
  116. package/dist/rules/prefer-includes.js.map +1 -1
  117. package/dist/rules/prefer-interface.d.ts.map +1 -1
  118. package/dist/rules/prefer-interface.js +6 -5
  119. package/dist/rules/prefer-interface.js.map +1 -1
  120. package/dist/rules/require-jsdoc.d.ts.map +1 -1
  121. package/dist/rules/require-jsdoc.js +8 -7
  122. package/dist/rules/require-jsdoc.js.map +1 -1
  123. package/dist/rules/sort-array.d.ts.map +1 -1
  124. package/dist/rules/sort-array.js +2 -1
  125. package/dist/rules/sort-array.js.map +1 -1
  126. package/dist/rules/sort-class-members.d.ts.map +1 -1
  127. package/dist/rules/sort-class-members.js +6 -4
  128. package/dist/rules/sort-class-members.js.map +1 -1
  129. package/dist/rules/sort-export-specifiers.d.ts.map +1 -1
  130. package/dist/rules/sort-export-specifiers.js +3 -4
  131. package/dist/rules/sort-export-specifiers.js.map +1 -1
  132. package/dist/rules/sort-keys.d.ts.map +1 -1
  133. package/dist/rules/sort-keys.js +4 -3
  134. package/dist/rules/sort-keys.js.map +1 -1
  135. package/dist/rules/switch-case-spacing.d.ts.map +1 -1
  136. package/dist/rules/switch-case-spacing.js +3 -2
  137. package/dist/rules/switch-case-spacing.js.map +1 -1
  138. package/dist/rules/template-literal-format.js +2 -2
  139. package/dist/rules/throw-error.d.ts.map +1 -1
  140. package/dist/rules/throw-error.js +7 -10
  141. package/dist/rules/throw-error.js.map +1 -1
  142. package/dist/rules/throw-new-error.js +2 -2
  143. package/dist/rules/throw-new-error.js.map +1 -1
  144. package/dist/rules/typescript-array-callback-return-type.d.ts.map +1 -1
  145. package/dist/rules/typescript-array-callback-return-type.js +5 -5
  146. package/dist/rules/typescript-array-callback-return-type.js.map +1 -1
  147. package/dist/rules/typescript-class-methods-use-this.d.ts.map +1 -1
  148. package/dist/rules/typescript-class-methods-use-this.js +4 -2
  149. package/dist/rules/typescript-class-methods-use-this.js.map +1 -1
  150. package/dist/rules/typescript-no-boolean-literal-type.d.ts.map +1 -1
  151. package/dist/rules/typescript-no-boolean-literal-type.js +2 -1
  152. package/dist/rules/typescript-no-boolean-literal-type.js.map +1 -1
  153. package/dist/rules/typescript-no-never.d.ts.map +1 -1
  154. package/dist/rules/typescript-no-never.js +3 -3
  155. package/dist/rules/typescript-no-never.js.map +1 -1
  156. package/dist/rules/typescript-no-redundant-undefined-const.d.ts.map +1 -1
  157. package/dist/rules/typescript-no-redundant-undefined-const.js +18 -23
  158. package/dist/rules/typescript-no-redundant-undefined-const.js.map +1 -1
  159. package/dist/rules/typescript-no-redundant-undefined-default-parameter.d.ts.map +1 -1
  160. package/dist/rules/typescript-no-redundant-undefined-default-parameter.js +35 -36
  161. package/dist/rules/typescript-no-redundant-undefined-default-parameter.js.map +1 -1
  162. package/dist/rules/typescript-no-redundant-undefined-let.d.ts.map +1 -1
  163. package/dist/rules/typescript-no-redundant-undefined-let.js +17 -15
  164. package/dist/rules/typescript-no-redundant-undefined-let.js.map +1 -1
  165. package/dist/rules/typescript-no-redundant-undefined-optional.d.ts.map +1 -1
  166. package/dist/rules/typescript-no-redundant-undefined-optional.js +3 -2
  167. package/dist/rules/typescript-no-redundant-undefined-optional.js.map +1 -1
  168. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.d.ts.map +1 -1
  169. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js +25 -24
  170. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js.map +1 -1
  171. package/dist/rules/typescript-no-redundant-undefined-readonly-property.d.ts.map +1 -1
  172. package/dist/rules/typescript-no-redundant-undefined-readonly-property.js +17 -15
  173. package/dist/rules/typescript-no-redundant-undefined-readonly-property.js.map +1 -1
  174. package/dist/rules/typescript-no-redundant-undefined-return-type.d.ts.map +1 -1
  175. package/dist/rules/typescript-no-redundant-undefined-return-type.js +24 -22
  176. package/dist/rules/typescript-no-redundant-undefined-return-type.js.map +1 -1
  177. package/dist/rules/typescript-no-redundant-undefined-var.d.ts.map +1 -1
  178. package/dist/rules/typescript-no-redundant-undefined-var.js +17 -15
  179. package/dist/rules/typescript-no-redundant-undefined-var.js.map +1 -1
  180. package/dist/rules/typescript-no-restricted-syntax.d.ts +4 -3
  181. package/dist/rules/typescript-no-restricted-syntax.d.ts.map +1 -1
  182. package/dist/rules/typescript-no-restricted-syntax.js +8 -4
  183. package/dist/rules/typescript-no-restricted-syntax.js.map +1 -1
  184. package/dist/rules/typescript-no-unsafe-object-assignment.d.ts +4 -3
  185. package/dist/rules/typescript-no-unsafe-object-assignment.d.ts.map +1 -1
  186. package/dist/rules/typescript-no-unsafe-object-assignment.js +8 -4
  187. package/dist/rules/typescript-no-unsafe-object-assignment.js.map +1 -1
  188. package/dist/rules/typescript-prefer-enum.d.ts.map +1 -1
  189. package/dist/rules/typescript-prefer-enum.js +15 -16
  190. package/dist/rules/typescript-prefer-enum.js.map +1 -1
  191. package/dist/rules/typescript-prefer-named-tuple-members.d.ts.map +1 -1
  192. package/dist/rules/typescript-prefer-named-tuple-members.js +10 -10
  193. package/dist/rules/typescript-prefer-named-tuple-members.js.map +1 -1
  194. package/dist/rules/typescript-prefer-readonly-array-parameter.d.ts.map +1 -1
  195. package/dist/rules/typescript-prefer-readonly-array-parameter.js +25 -22
  196. package/dist/rules/typescript-prefer-readonly-array-parameter.js.map +1 -1
  197. package/dist/rules/typescript-prefer-readonly-array.d.ts.map +1 -1
  198. package/dist/rules/typescript-prefer-readonly-array.js +5 -4
  199. package/dist/rules/typescript-prefer-readonly-array.js.map +1 -1
  200. package/dist/rules/typescript-prefer-readonly-index-signature.d.ts.map +1 -1
  201. package/dist/rules/typescript-prefer-readonly-index-signature.js +3 -1
  202. package/dist/rules/typescript-prefer-readonly-index-signature.js.map +1 -1
  203. package/dist/rules/typescript-prefer-readonly-map.d.ts.map +1 -1
  204. package/dist/rules/typescript-prefer-readonly-map.js +2 -1
  205. package/dist/rules/typescript-prefer-readonly-map.js.map +1 -1
  206. package/dist/rules/typescript-prefer-readonly-property.d.ts.map +1 -1
  207. package/dist/rules/typescript-prefer-readonly-property.js +6 -5
  208. package/dist/rules/typescript-prefer-readonly-property.js.map +1 -1
  209. package/dist/rules/typescript-prefer-readonly-record.d.ts.map +1 -1
  210. package/dist/rules/typescript-prefer-readonly-record.js +8 -6
  211. package/dist/rules/typescript-prefer-readonly-record.js.map +1 -1
  212. package/dist/rules/typescript-prefer-readonly-set.d.ts.map +1 -1
  213. package/dist/rules/typescript-prefer-readonly-set.js +2 -1
  214. package/dist/rules/typescript-prefer-readonly-set.js.map +1 -1
  215. package/dist/rules/typescript-require-prop-type-annotation.d.ts.map +1 -1
  216. package/dist/rules/typescript-require-prop-type-annotation.js +3 -2
  217. package/dist/rules/typescript-require-prop-type-annotation.js.map +1 -1
  218. package/dist/rules/typescript-require-readonly-array-property-type.d.ts.map +1 -1
  219. package/dist/rules/typescript-require-readonly-array-property-type.js +11 -11
  220. package/dist/rules/typescript-require-readonly-array-property-type.js.map +1 -1
  221. package/dist/rules/typescript-require-readonly-array-return-type.d.ts.map +1 -1
  222. package/dist/rules/typescript-require-readonly-array-return-type.js +19 -16
  223. package/dist/rules/typescript-require-readonly-array-return-type.js.map +1 -1
  224. package/dist/rules/typescript-require-readonly-array-type-alias.d.ts.map +1 -1
  225. package/dist/rules/typescript-require-readonly-array-type-alias.js +9 -6
  226. package/dist/rules/typescript-require-readonly-array-type-alias.js.map +1 -1
  227. package/dist/rules/typescript-require-readonly-map-parameter-type.d.ts.map +1 -1
  228. package/dist/rules/typescript-require-readonly-map-parameter-type.js +23 -20
  229. package/dist/rules/typescript-require-readonly-map-parameter-type.js.map +1 -1
  230. package/dist/rules/typescript-require-readonly-map-property-type.d.ts.map +1 -1
  231. package/dist/rules/typescript-require-readonly-map-property-type.js +9 -9
  232. package/dist/rules/typescript-require-readonly-map-property-type.js.map +1 -1
  233. package/dist/rules/typescript-require-readonly-map-return-type.d.ts.map +1 -1
  234. package/dist/rules/typescript-require-readonly-map-return-type.js +17 -14
  235. package/dist/rules/typescript-require-readonly-map-return-type.js.map +1 -1
  236. package/dist/rules/typescript-require-readonly-map-type-alias.d.ts.map +1 -1
  237. package/dist/rules/typescript-require-readonly-map-type-alias.js +7 -4
  238. package/dist/rules/typescript-require-readonly-map-type-alias.js.map +1 -1
  239. package/dist/rules/typescript-require-readonly-record-parameter-type.d.ts.map +1 -1
  240. package/dist/rules/typescript-require-readonly-record-parameter-type.js +26 -23
  241. package/dist/rules/typescript-require-readonly-record-parameter-type.js.map +1 -1
  242. package/dist/rules/typescript-require-readonly-record-property-type.d.ts.map +1 -1
  243. package/dist/rules/typescript-require-readonly-record-property-type.js +12 -12
  244. package/dist/rules/typescript-require-readonly-record-property-type.js.map +1 -1
  245. package/dist/rules/typescript-require-readonly-record-return-type.d.ts.map +1 -1
  246. package/dist/rules/typescript-require-readonly-record-return-type.js +20 -17
  247. package/dist/rules/typescript-require-readonly-record-return-type.js.map +1 -1
  248. package/dist/rules/typescript-require-readonly-record-type-alias.d.ts.map +1 -1
  249. package/dist/rules/typescript-require-readonly-record-type-alias.js +10 -7
  250. package/dist/rules/typescript-require-readonly-record-type-alias.js.map +1 -1
  251. package/dist/rules/typescript-require-readonly-set-parameter-type.d.ts.map +1 -1
  252. package/dist/rules/typescript-require-readonly-set-parameter-type.js +23 -20
  253. package/dist/rules/typescript-require-readonly-set-parameter-type.js.map +1 -1
  254. package/dist/rules/typescript-require-readonly-set-property-type.d.ts.map +1 -1
  255. package/dist/rules/typescript-require-readonly-set-property-type.js +9 -9
  256. package/dist/rules/typescript-require-readonly-set-property-type.js.map +1 -1
  257. package/dist/rules/typescript-require-readonly-set-return-type.d.ts.map +1 -1
  258. package/dist/rules/typescript-require-readonly-set-return-type.js +17 -14
  259. package/dist/rules/typescript-require-readonly-set-return-type.js.map +1 -1
  260. package/dist/rules/typescript-require-readonly-set-type-alias.d.ts.map +1 -1
  261. package/dist/rules/typescript-require-readonly-set-type-alias.js +7 -4
  262. package/dist/rules/typescript-require-readonly-set-type-alias.js.map +1 -1
  263. package/dist/rules/typescript-require-this-void.d.ts.map +1 -1
  264. package/dist/rules/typescript-require-this-void.js +3 -2
  265. package/dist/rules/typescript-require-this-void.js.map +1 -1
  266. package/dist/rules/underscore-internal.d.ts.map +1 -1
  267. package/dist/rules/underscore-internal.js +10 -12
  268. package/dist/rules/underscore-internal.js.map +1 -1
  269. package/dist/rules/unused-internal-properties.js +2 -2
  270. package/dist/rules/unused-internal-properties.js.map +1 -1
  271. package/dist/rules/uppercase-iife.js +2 -2
  272. package/dist/rules/uppercase-iife.js.map +1 -1
  273. package/dist/rules/words.js +2 -2
  274. package/dist/rules/words.js.map +1 -1
  275. package/dist/rules.d.ts +2 -1
  276. package/dist/rules.d.ts.map +1 -1
  277. package/dist/rules.js +269 -268
  278. package/dist/rules.js.map +1 -1
  279. package/docs/AGENTS.md +186 -0
  280. package/docs/docusaurus/AGENTS.md +27 -0
  281. package/docs/docusaurus/package.json +1 -1
  282. package/docs/docusaurus/src/components/GitHubStats.jsx +7 -1
  283. package/docs/docusaurus/src/pages/index.jsx +5 -0
  284. package/docs/docusaurus/typedoc-plugins/hashToBangLinksCore.mjs +1 -1
  285. package/docs/docusaurus/typedoc-plugins/prefixDocLinksCore.mjs +4 -5
  286. package/docs/rules/no-vulnerable.md +6 -0
  287. package/package.json +37 -39
package/dist/plugin.cjs CHANGED
@@ -42,10 +42,10 @@ var pluginMeta = {
42
42
  };
43
43
 
44
44
  // dist/configs/all-strict.js
45
- var import_ts_extras69 = require("ts-extras");
45
+ var import_ts_extras71 = require("ts-extras");
46
46
 
47
47
  // dist/rules.js
48
- var import_ts_extras68 = require("ts-extras");
48
+ var import_ts_extras70 = require("ts-extras");
49
49
 
50
50
  // dist/_internal/rule-catalog.js
51
51
  var toCatalogNumericPart = (catalogIndex) => `${catalogIndex}`.padStart(3, "0");
@@ -92,6 +92,45 @@ var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"),
92
92
  var import_ts_extras = require("ts-extras");
93
93
  var isObjectRecord = (value) => typeof value === "object" && value !== null;
94
94
  var hasCreateFunction = (value) => isObjectRecord(value) && typeof value["create"] === "function";
95
+ var isRuleMetaDocs = (value) => isObjectRecord(value) && typeof value["description"] === "string";
96
+ var getNormalizedMetaType = (value) => {
97
+ if (value === "layout" || value === "problem" || value === "suggestion") {
98
+ return value;
99
+ }
100
+ return "problem";
101
+ };
102
+ var getNormalizedMetaMessages = (value) => {
103
+ if (!isObjectRecord(value)) {
104
+ return {};
105
+ }
106
+ let normalizedMessages = {};
107
+ for (const [key, message] of (0, import_ts_extras.objectEntries)(value)) {
108
+ if (typeof message !== "string") {
109
+ continue;
110
+ }
111
+ normalizedMessages = {
112
+ ...normalizedMessages,
113
+ [key]: message
114
+ };
115
+ }
116
+ return normalizedMessages;
117
+ };
118
+ var isJsonSchemaLike = (value) => {
119
+ if (!isObjectRecord(value)) {
120
+ return false;
121
+ }
122
+ return (0, import_ts_extras.keyIn)(value, "allOf") || (0, import_ts_extras.keyIn)(value, "anyOf") || (0, import_ts_extras.keyIn)(value, "oneOf") || (0, import_ts_extras.keyIn)(value, "properties") || (0, import_ts_extras.keyIn)(value, "type");
123
+ };
124
+ var isJsonSchemaArray = (value) => Array.isArray(value) && value.every((entry) => isJsonSchemaLike(entry));
125
+ var getNormalizedMetaSchema = (value) => {
126
+ if (isJsonSchemaArray(value)) {
127
+ return value;
128
+ }
129
+ if (isJsonSchemaLike(value)) {
130
+ return value;
131
+ }
132
+ return [];
133
+ };
95
134
  var createLegacyContextCompat = (context) => new Proxy(context, {
96
135
  get: (target, property, receiver) => {
97
136
  if (property === "getSourceCode") {
@@ -109,11 +148,11 @@ var createLegacyContextCompat = (context) => new Proxy(context, {
109
148
  return Reflect.get(target, property, receiver);
110
149
  }
111
150
  });
112
- var getExternalRuleFromPlugin = (plugin2, ruleName, pluginName) => {
113
- if (!isObjectRecord(plugin2) || !isObjectRecord(plugin2["rules"])) {
151
+ var getExternalRuleFromPlugin = (plugin3, ruleName, pluginName) => {
152
+ if (!isObjectRecord(plugin3) || !isObjectRecord(plugin3["rules"])) {
114
153
  throw new TypeError(`Plugin "${pluginName}" does not expose a valid rules map.`);
115
154
  }
116
- const rules2 = plugin2["rules"];
155
+ const rules2 = plugin3["rules"];
117
156
  if (!(0, import_ts_extras.objectHasOwn)(rules2, ruleName)) {
118
157
  throw new Error(`Rule "${ruleName}" was not found in plugin "${pluginName}".`);
119
158
  }
@@ -124,19 +163,25 @@ var adaptExternalRule = (externalRule4, docsUrl) => {
124
163
  throw new TypeError("External rule module does not expose create().");
125
164
  }
126
165
  const externalRuleRecord = externalRule4;
127
- const externalMeta = isObjectRecord(externalRuleRecord["meta"]) ? externalRuleRecord["meta"] : {};
128
- const externalDocs = isObjectRecord(externalMeta["docs"]) ? externalMeta["docs"] : {};
166
+ const externalMetaRecord = isObjectRecord(externalRuleRecord["meta"]) ? externalRuleRecord["meta"] : {};
167
+ const externalDocs = isRuleMetaDocs(externalMetaRecord["docs"]) ? externalMetaRecord["docs"] : {
168
+ description: "External rule re-exported by eslint-plugin-etc-misc."
169
+ };
129
170
  const create = (context) => externalRule4.create(createLegacyContextCompat(context));
171
+ const externalRuleModule = (0, import_ts_extras.safeCastTo)(externalRuleRecord);
130
172
  return {
131
- ...externalRuleRecord,
173
+ ...externalRuleModule,
132
174
  create,
133
175
  defaultOptions: Array.isArray(externalRuleRecord["defaultOptions"]) ? (0, import_ts_extras.safeCastTo)(externalRuleRecord["defaultOptions"]) : [],
134
176
  meta: {
135
- ...externalMeta,
177
+ ...externalMetaRecord,
136
178
  docs: {
137
179
  ...externalDocs,
138
180
  url: docsUrl
139
- }
181
+ },
182
+ messages: getNormalizedMetaMessages(externalMetaRecord["messages"]),
183
+ schema: getNormalizedMetaSchema(externalMetaRecord["schema"]),
184
+ type: getNormalizedMetaType(externalMetaRecord["type"])
140
185
  }
141
186
  };
142
187
  };
@@ -191,19 +236,20 @@ var deprecatedRule = withDeprecatedRuleLifecycle(rule, {
191
236
  var array_type_default = deprecatedRule;
192
237
 
193
238
  // dist/rules/class-match-filename.js
194
- var import_node_path = require("node:path");
239
+ var import_node_path = __toESM(require("node:path"), 1);
195
240
 
196
241
  // dist/_internal/rule-creator.js
197
242
  var import_utils = require("@typescript-eslint/utils");
198
- var ruleCreator = import_utils.ESLintUtils.RuleCreator((name) => {
243
+ var createRuleCreator = import_utils.ESLintUtils.RuleCreator;
244
+ var ruleCreator = createRuleCreator((name) => {
199
245
  const docsPathName = name.replaceAll("/", "-");
200
246
  return `https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/${docsPathName}`;
201
247
  });
202
248
 
203
249
  // dist/rules/class-match-filename.js
204
250
  var getFileStem = (filePath) => {
205
- const extension = (0, import_node_path.extname)(filePath);
206
- return (0, import_node_path.basename)(filePath, extension);
251
+ const extension = import_node_path.default.extname(filePath);
252
+ return import_node_path.default.basename(filePath, extension);
207
253
  };
208
254
  var rule2 = ruleCreator({
209
255
  create: (context) => ({
@@ -247,13 +293,14 @@ var rule2 = ruleCreator({
247
293
  var class_match_filename_default = rule2;
248
294
 
249
295
  // dist/rules/comment-spacing.js
296
+ var import_utils2 = require("@typescript-eslint/utils");
250
297
  var import_ts_extras3 = require("ts-extras");
251
- var isEslintDirectiveComment = (comment) => comment.type === "Block" && comment.value.trimStart().startsWith("eslint-");
298
+ var isEslintDirectiveComment = (comment) => comment.type === import_utils2.AST_TOKEN_TYPES.Block && comment.value.trimStart().startsWith("eslint-");
252
299
  var expectedBlankLines = (comment) => {
253
- if (comment.type === "Line" || isEslintDirectiveComment(comment)) {
300
+ if (comment.type === import_utils2.AST_TOKEN_TYPES.Line || isEslintDirectiveComment(comment)) {
254
301
  return 0;
255
302
  }
256
- return /\r\n|\n/u.test(comment.value) ? 1 : 0;
303
+ return /\r\n|\n/v.test(comment.value) ? 1 : 0;
257
304
  };
258
305
  var buildFix = (sourceCode, comment, nextNode, expected) => (fixer) => {
259
306
  const textBetween = sourceCode.text.slice(comment.range[1], (0, import_ts_extras3.arrayFirst)(nextNode.range));
@@ -308,7 +355,7 @@ var comment_spacing_default = rule3;
308
355
 
309
356
  // dist/rules/consistent-empty-lines.js
310
357
  var import_ts_extras4 = require("ts-extras");
311
- var splitLines = (sourceText) => (0, import_ts_extras4.stringSplit)(sourceText.replaceAll(/\r\n?/gu, "\n"), "\n");
358
+ var splitLines = (sourceText) => (0, import_ts_extras4.stringSplit)(sourceText.replaceAll(/\r\n?/gv, "\n"), "\n");
312
359
  var collapseEmptyLines = (sourceText) => {
313
360
  const lines = splitLines(sourceText);
314
361
  let output = [];
@@ -415,9 +462,9 @@ var import_ts_extras6 = require("ts-extras");
415
462
 
416
463
  // dist/_internal/identifier-blocks.js
417
464
  var import_ts_extras5 = require("ts-extras");
418
- var camelCaseBoundaryPattern = /(?<=[\da-z])(?=[A-Z])/gu;
419
- var nonAlphanumericPattern = /[^0-9A-Za-z]+/gu;
420
- var whitespacePattern = /\s+/gu;
465
+ var camelCaseBoundaryPattern = /(?<=[\da-z])(?=[A-Z])/gv;
466
+ var nonAlphanumericPattern = /[^0-9A-Za-z]+/gv;
467
+ var whitespacePattern = /\s+/gv;
421
468
  var splitIdentifierBlocks = (value) => {
422
469
  const normalized = value.replaceAll(camelCaseBoundaryPattern, " ").replaceAll(nonAlphanumericPattern, " ").trim();
423
470
  if (normalized.length === 0) {
@@ -452,7 +499,7 @@ var filenameStem = (filePath) => {
452
499
  const normalizedPath = filePath.replaceAll("\\", "/");
453
500
  const pathSegments = (0, import_ts_extras6.stringSplit)(normalizedPath, "/");
454
501
  const lastPathSegment = (0, import_ts_extras6.arrayAt)(pathSegments, -1) ?? filePath;
455
- return lastPathSegment.replace(/\.[^./\\]+$/u, "");
502
+ return lastPathSegment.replace(/\.[^.\/]+$/v, "");
456
503
  };
457
504
 
458
505
  // dist/rules/consistent-filename.js
@@ -534,14 +581,15 @@ var deprecatedRule2 = withDeprecatedRuleLifecycle(rule6, {
534
581
  var consistent_filename_default = deprecatedRule2;
535
582
 
536
583
  // dist/rules/consistent-import.js
584
+ var import_utils3 = require("@typescript-eslint/utils");
537
585
  var import_ts_extras8 = require("ts-extras");
538
586
  var styleFromImport = (node) => {
539
587
  if (node.specifiers.length === 0) {
540
588
  return "side-effect";
541
589
  }
542
- const hasDefault = node.specifiers.some((specifier) => specifier.type === "ImportDefaultSpecifier");
543
- const hasNamed = node.specifiers.some((specifier) => specifier.type === "ImportSpecifier");
544
- const hasNamespace = node.specifiers.some((specifier) => specifier.type === "ImportNamespaceSpecifier");
590
+ const hasDefault = node.specifiers.some((specifier) => specifier.type === import_utils3.AST_NODE_TYPES.ImportDefaultSpecifier);
591
+ const hasNamed = node.specifiers.some((specifier) => specifier.type === import_utils3.AST_NODE_TYPES.ImportSpecifier);
592
+ const hasNamespace = node.specifiers.some((specifier) => specifier.type === import_utils3.AST_NODE_TYPES.ImportNamespaceSpecifier);
545
593
  if (hasNamespace) {
546
594
  return "namespace";
547
595
  }
@@ -622,6 +670,7 @@ var rule7 = ruleCreator({
622
670
  var consistent_import_default = rule7;
623
671
 
624
672
  // dist/rules/consistent-optional-props.js
673
+ var import_utils4 = require("@typescript-eslint/utils");
625
674
  var import_ts_extras9 = require("ts-extras");
626
675
  var selector2 = (0, import_ts_extras9.arrayJoin)([
627
676
  "TSPropertySignature[optional=true] > TSTypeAnnotation > TSUnionType",
@@ -630,7 +679,7 @@ var selector2 = (0, import_ts_extras9.arrayJoin)([
630
679
  var buildOptionalUnionFixText = (sourceCode, unionType) => {
631
680
  let nonUndefinedTypeTexts = [];
632
681
  for (const typeNode of unionType.types) {
633
- if (typeNode.type === "TSUndefinedKeyword") {
682
+ if (typeNode.type === import_utils4.AST_NODE_TYPES.TSUndefinedKeyword) {
634
683
  continue;
635
684
  }
636
685
  nonUndefinedTypeTexts = [
@@ -648,7 +697,7 @@ var rule8 = ruleCreator({
648
697
  const sourceCode = context.sourceCode;
649
698
  return {
650
699
  [selector2]: (node) => {
651
- if (node.type !== "TSUnionType") {
700
+ if (node.type !== import_utils4.AST_NODE_TYPES.TSUnionType) {
652
701
  return;
653
702
  }
654
703
  const fixedTypeText = buildOptionalUnionFixText(sourceCode, node);
@@ -783,20 +832,21 @@ var default_case_default = rule11;
783
832
  var import_ts_extras11 = require("ts-extras");
784
833
 
785
834
  // dist/_internal/import-patterns.js
835
+ var import_utils5 = require("@typescript-eslint/utils");
786
836
  var import_minimatch = require("minimatch");
787
837
  var matchesAnyPattern = (value, patterns) => patterns.some((pattern) => (0, import_minimatch.minimatch)(value, pattern, {
788
838
  dot: true,
789
839
  nocase: false
790
840
  }));
791
841
  var getImportSourceText = (node) => {
792
- if (node.type === "ExportAllDeclaration" || node.type === "ImportDeclaration") {
842
+ if (node.type === import_utils5.AST_NODE_TYPES.ExportAllDeclaration || node.type === import_utils5.AST_NODE_TYPES.ImportDeclaration) {
793
843
  return node.source.value;
794
844
  }
795
- if (node.type === "ExportNamedDeclaration") {
845
+ if (node.type === import_utils5.AST_NODE_TYPES.ExportNamedDeclaration) {
796
846
  return node.source?.value;
797
847
  }
798
- if (node.type === "ImportExpression") {
799
- return node.source.type === "Literal" && typeof node.source.value === "string" ? node.source.value : void 0;
848
+ if (node.type === import_utils5.AST_NODE_TYPES.ImportExpression) {
849
+ return node.source.type === import_utils5.AST_NODE_TYPES.Literal && typeof node.source.value === "string" ? node.source.value : void 0;
800
850
  }
801
851
  return void 0;
802
852
  };
@@ -880,24 +930,25 @@ var rule12 = createImportPatternRule({
880
930
  var disallow_import_default = rule12;
881
931
 
882
932
  // dist/rules/export-matching-filename-only.js
883
- var import_node_path2 = require("node:path");
933
+ var import_utils6 = require("@typescript-eslint/utils");
934
+ var import_node_path2 = __toESM(require("node:path"), 1);
884
935
  var import_ts_extras12 = require("ts-extras");
885
936
  var exportedNamesFromDeclaration = (node) => {
886
937
  if (node.specifiers.length > 0) {
887
- return node.specifiers.filter((specifier) => specifier.type === "ExportSpecifier").flatMap((specifier) => specifier.exported.type === "Identifier" ? [specifier.exported.name] : []);
938
+ return node.specifiers.flatMap((specifier) => specifier.exported.type === import_utils6.AST_NODE_TYPES.Identifier ? [specifier.exported.name] : []);
888
939
  }
889
- if (node.declaration?.type === "ClassDeclaration" || node.declaration?.type === "FunctionDeclaration") {
940
+ if (node.declaration?.type === import_utils6.AST_NODE_TYPES.ClassDeclaration || node.declaration?.type === import_utils6.AST_NODE_TYPES.FunctionDeclaration) {
890
941
  return node.declaration.id === null ? [] : [node.declaration.id.name];
891
942
  }
892
943
  return [];
893
944
  };
894
945
  var rule13 = ruleCreator({
895
946
  create: (context, [options]) => {
896
- let exports2 = [];
947
+ let namedExports = [];
897
948
  return {
898
949
  ExportDefaultDeclaration: (node) => {
899
- exports2 = [
900
- ...exports2,
950
+ namedExports = [
951
+ ...namedExports,
901
952
  {
902
953
  name: "default",
903
954
  node
@@ -906,20 +957,20 @@ var rule13 = ruleCreator({
906
957
  },
907
958
  ExportNamedDeclaration: (node) => {
908
959
  for (const name of exportedNamesFromDeclaration(node)) {
909
- exports2 = [...exports2, { name, node }];
960
+ namedExports = [...namedExports, { name, node }];
910
961
  }
911
962
  },
912
963
  "Program:exit": () => {
913
964
  if (context.filename === "<input>") {
914
965
  return;
915
966
  }
916
- const stem = filenameStem((0, import_node_path2.resolve)(context.filename));
967
+ const stem = filenameStem(import_node_path2.default.resolve(context.filename));
917
968
  const expected = toCasing(stem, options.format ?? "PascalCase");
918
- const matching = exports2.filter((entry) => entry.name === expected);
919
- if ((0, import_ts_extras12.isEmpty)(matching) || exports2.length <= 1) {
969
+ const matching = namedExports.filter((entry) => entry.name === expected);
970
+ if ((0, import_ts_extras12.isEmpty)(matching) || namedExports.length <= 1) {
920
971
  return;
921
972
  }
922
- for (const entry of exports2) {
973
+ for (const entry of namedExports) {
923
974
  if (entry.name === expected) {
924
975
  continue;
925
976
  }
@@ -973,7 +1024,8 @@ var rule13 = ruleCreator({
973
1024
  var export_matching_filename_only_default = rule13;
974
1025
 
975
1026
  // dist/rules/match-filename.js
976
- var import_node_path3 = require("node:path");
1027
+ var import_utils7 = require("@typescript-eslint/utils");
1028
+ var import_node_path3 = __toESM(require("node:path"), 1);
977
1029
  var import_ts_extras13 = require("ts-extras");
978
1030
  var defaultSelectors = [
979
1031
  "ClassDeclaration > Identifier.id",
@@ -998,10 +1050,10 @@ var rule14 = ruleCreator({
998
1050
  listeners = {
999
1051
  ...listeners,
1000
1052
  [selector25]: (node) => {
1001
- if (context.filename === "<input>" || node.type !== "Identifier") {
1053
+ if (context.filename === "<input>" || node.type !== import_utils7.AST_NODE_TYPES.Identifier) {
1002
1054
  return;
1003
1055
  }
1004
- const stem = filenameStem((0, import_node_path3.resolve)(context.filename));
1056
+ const stem = filenameStem(import_node_path3.default.resolve(context.filename));
1005
1057
  const expected = `${options.prefix ?? ""}${toCasing(node.name, options.format ?? "kebab-case")}${options.suffix ?? ""}`;
1006
1058
  const matches = stem === expected;
1007
1059
  if (options.match ?? true ? matches : !matches) {
@@ -1127,7 +1179,7 @@ var max_identifier_blocks_default = rule15;
1127
1179
 
1128
1180
  // dist/rules/no-assign-mutated-array.js
1129
1181
  var import_type_utils = require("@typescript-eslint/type-utils");
1130
- var import_utils2 = require("@typescript-eslint/utils");
1182
+ var import_utils8 = require("@typescript-eslint/utils");
1131
1183
  var import_ts_extras15 = require("ts-extras");
1132
1184
  var readonlyArrayTypeNames = /* @__PURE__ */ new Set(["ReadonlyArray"]);
1133
1185
  var isArrayLikeType = (typeChecker, type) => {
@@ -1145,54 +1197,54 @@ var creatorMethodNames = /* @__PURE__ */ new Set([
1145
1197
  "values"
1146
1198
  ]);
1147
1199
  var isArrayFactoryCallee = (callee) => {
1148
- if (callee.type === "Identifier") {
1200
+ if (callee.type === import_utils8.AST_NODE_TYPES.Identifier) {
1149
1201
  return callee.name === "Array";
1150
1202
  }
1151
- if (callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "Array" && callee.property.type === "Identifier") {
1203
+ if (callee.type === import_utils8.AST_NODE_TYPES.MemberExpression && callee.object.type === import_utils8.AST_NODE_TYPES.Identifier && callee.object.name === "Array" && callee.property.type === import_utils8.AST_NODE_TYPES.Identifier) {
1152
1204
  return callee.property.name === "from" || callee.property.name === "of";
1153
1205
  }
1154
1206
  return false;
1155
1207
  };
1156
1208
  var isNewArray = (node) => {
1157
- if (node.type === "ArrayExpression") {
1209
+ if (node.type === import_utils8.AST_NODE_TYPES.ArrayExpression) {
1158
1210
  return true;
1159
1211
  }
1160
- if (node.type === "CallExpression") {
1212
+ if (node.type === import_utils8.AST_NODE_TYPES.CallExpression) {
1161
1213
  return isArrayFactoryCallee(node.callee);
1162
1214
  }
1163
1215
  return false;
1164
1216
  };
1165
1217
  var mutatesReferencedArray = (callExpression) => {
1166
- if (callExpression.callee.type !== "MemberExpression") {
1218
+ if (callExpression.callee.type !== import_utils8.AST_NODE_TYPES.MemberExpression) {
1167
1219
  return true;
1168
1220
  }
1169
1221
  const { object, property } = callExpression.callee;
1170
- if (property.type === "Identifier" && (0, import_ts_extras15.setHas)(creatorMethodNames, property.name)) {
1222
+ if (property.type === import_utils8.AST_NODE_TYPES.Identifier && (0, import_ts_extras15.setHas)(creatorMethodNames, property.name)) {
1171
1223
  return false;
1172
1224
  }
1173
1225
  if (isNewArray(object)) {
1174
1226
  return false;
1175
1227
  }
1176
- if (object.type === "CallExpression") {
1228
+ if (object.type === import_utils8.AST_NODE_TYPES.CallExpression) {
1177
1229
  return mutatesReferencedArray(object);
1178
1230
  }
1179
1231
  return true;
1180
1232
  };
1181
1233
  var rule16 = ruleCreator({
1182
1234
  create: (context) => {
1183
- const parserServices = import_utils2.ESLintUtils.getParserServices(context);
1235
+ const parserServices = import_utils8.ESLintUtils.getParserServices(context);
1184
1236
  const typeChecker = parserServices.program.getTypeChecker();
1185
1237
  return {
1186
1238
  "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name=/^(?:fill|reverse|sort)$/]": (callExpression) => {
1187
1239
  const { callee } = callExpression;
1188
- if (callee.type !== "MemberExpression") {
1240
+ if (callee.type !== import_utils8.AST_NODE_TYPES.MemberExpression) {
1189
1241
  return;
1190
1242
  }
1191
1243
  const { property } = callee;
1192
- if (property.type !== "Identifier") {
1244
+ if (property.type !== import_utils8.AST_NODE_TYPES.Identifier) {
1193
1245
  return;
1194
1246
  }
1195
- if (callExpression.parent?.type === "ExpressionStatement") {
1247
+ if (callExpression.parent.type === import_utils8.AST_NODE_TYPES.ExpressionStatement) {
1196
1248
  return;
1197
1249
  }
1198
1250
  const objectType = (0, import_type_utils.getConstrainedTypeAtLocation)(parserServices, callee.object);
@@ -1279,6 +1331,7 @@ var no_chain_coalescence_mixture_default = rule19;
1279
1331
 
1280
1332
  // dist/rules/no-commented-out-code.js
1281
1333
  var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
1334
+ var import_utils9 = require("@typescript-eslint/utils");
1282
1335
  var import_ts_extras16 = require("ts-extras");
1283
1336
  var parserOptions = {
1284
1337
  ecmaVersion: "latest",
@@ -1320,7 +1373,7 @@ var toCommentBlocks = (comments) => {
1320
1373
  let blocks = [];
1321
1374
  let previousLineComment = null;
1322
1375
  for (const comment of comments) {
1323
- if (comment.type === "Block") {
1376
+ if (comment.type === import_utils9.AST_TOKEN_TYPES.Block) {
1324
1377
  blocks = [
1325
1378
  ...blocks,
1326
1379
  {
@@ -1356,10 +1409,10 @@ ${comment.value}`,
1356
1409
  return blocks;
1357
1410
  };
1358
1411
  var isExpressionOrIdentifierOrLiteral = (node) => {
1359
- if (node.type === "Identifier" || node.type === "Literal") {
1412
+ if (node.type === import_utils9.AST_NODE_TYPES.Identifier || node.type === import_utils9.AST_NODE_TYPES.Literal) {
1360
1413
  return true;
1361
1414
  }
1362
- if (node.type !== "BinaryExpression") {
1415
+ if (node.type !== import_utils9.AST_NODE_TYPES.BinaryExpression) {
1363
1416
  return false;
1364
1417
  }
1365
1418
  return isExpressionOrIdentifierOrLiteral(node.left) && isExpressionOrIdentifierOrLiteral(node.right);
@@ -1368,37 +1421,37 @@ var isTrivialProgram = (program) => {
1368
1421
  if (program.body.length === 0) {
1369
1422
  return true;
1370
1423
  }
1371
- if (program.body.length === 1 && (0, import_ts_extras16.arrayFirst)(program.body)?.type === "LabeledStatement") {
1424
+ if (program.body.length === 1 && (0, import_ts_extras16.arrayFirst)(program.body)?.type === import_utils9.AST_NODE_TYPES.LabeledStatement) {
1372
1425
  return true;
1373
1426
  }
1374
- return program.body.every((statement) => statement.type === "ExpressionStatement" && isExpressionOrIdentifierOrLiteral(statement.expression));
1427
+ return program.body.every((statement) => statement.type === import_utils9.AST_NODE_TYPES.ExpressionStatement && isExpressionOrIdentifierOrLiteral(statement.expression));
1375
1428
  };
1376
1429
  var getWrappedContent = (content, node) => {
1377
1430
  if (node === null) {
1378
1431
  return void 0;
1379
1432
  }
1380
- if (node.type === "ArrayExpression") {
1433
+ if (node.type === import_utils9.AST_NODE_TYPES.ArrayExpression) {
1381
1434
  return `const wrapper = [${content}]`;
1382
1435
  }
1383
- if (node.type === "ClassBody") {
1436
+ if (node.type === import_utils9.AST_NODE_TYPES.ClassBody) {
1384
1437
  return `class Wrapper { ${content} }`;
1385
1438
  }
1386
- if (node.type === "FunctionDeclaration") {
1439
+ if (node.type === import_utils9.AST_NODE_TYPES.FunctionDeclaration) {
1387
1440
  return `function wrapper(${content}) {}`;
1388
1441
  }
1389
- if (node.type === "ImportDeclaration") {
1442
+ if (node.type === import_utils9.AST_NODE_TYPES.ImportDeclaration) {
1390
1443
  return `import { ${content} } from "wrapper"`;
1391
1444
  }
1392
- if (node.type === "ObjectExpression") {
1445
+ if (node.type === import_utils9.AST_NODE_TYPES.ObjectExpression) {
1393
1446
  return `const wrapper = { ${content} }`;
1394
1447
  }
1395
- if (node.type === "SwitchStatement") {
1448
+ if (node.type === import_utils9.AST_NODE_TYPES.SwitchStatement) {
1396
1449
  return `switch (wrapper) { ${content} }`;
1397
1450
  }
1398
- if (node.type === "TSInterfaceBody") {
1451
+ if (node.type === import_utils9.AST_NODE_TYPES.TSInterfaceBody) {
1399
1452
  return `interface Wrapper { ${content} }`;
1400
1453
  }
1401
- if (node.type === "TSTypeLiteral") {
1454
+ if (node.type === import_utils9.AST_NODE_TYPES.TSTypeLiteral) {
1402
1455
  return `type Wrapper = { ${content} }`;
1403
1456
  }
1404
1457
  return void 0;
@@ -1479,9 +1532,10 @@ var deprecatedRule4 = withDeprecatedRuleLifecycle(rule20, {
1479
1532
  var no_commented_out_code_default = deprecatedRule4;
1480
1533
 
1481
1534
  // dist/rules/no-const-enum.js
1535
+ var import_utils10 = require("@typescript-eslint/utils");
1482
1536
  var import_ts_extras17 = require("ts-extras");
1483
1537
  var defaultOptions2 = [{}];
1484
- var isExportedEnumDeclaration = (node) => node.parent?.type === "ExportNamedDeclaration";
1538
+ var isExportedEnumDeclaration = (node) => node.parent.type === import_utils10.AST_NODE_TYPES.ExportNamedDeclaration;
1485
1539
  var getConstToken = (sourceCode, node) => sourceCode.getFirstToken(node, {
1486
1540
  filter: (token) => token.value === "const"
1487
1541
  }) ?? void 0;
@@ -1561,7 +1615,7 @@ var rule21 = ruleCreator({
1561
1615
  var no_const_enum_default = rule21;
1562
1616
 
1563
1617
  // dist/rules/no-deprecated.js
1564
- var import_utils3 = require("@typescript-eslint/utils");
1618
+ var import_utils12 = require("@typescript-eslint/utils");
1565
1619
  var import_ts_extras20 = require("ts-extras");
1566
1620
 
1567
1621
  // dist/_internal/ignore-patterns.js
@@ -1593,20 +1647,21 @@ var compileIgnorePatterns = (ignored) => {
1593
1647
 
1594
1648
  // dist/_internal/symbol-usage.js
1595
1649
  var import_type_utils2 = require("@typescript-eslint/type-utils");
1650
+ var import_utils11 = require("@typescript-eslint/utils");
1596
1651
  var import_ts_extras19 = require("ts-extras");
1597
- var isImportOrExportSpecifier = (parent) => parent?.type === "ExportSpecifier" || parent?.type === "ImportDefaultSpecifier" || parent?.type === "ImportNamespaceSpecifier" || parent?.type === "ImportSpecifier";
1652
+ var isImportOrExportSpecifier = (parent) => parent?.type === import_utils11.AST_NODE_TYPES.ExportSpecifier || parent?.type === import_utils11.AST_NODE_TYPES.ImportDefaultSpecifier || parent?.type === import_utils11.AST_NODE_TYPES.ImportNamespaceSpecifier || parent?.type === import_utils11.AST_NODE_TYPES.ImportSpecifier;
1598
1653
  var isDeclarationIdentifier = (node) => {
1599
1654
  const { parent } = node;
1600
- if (parent === void 0) {
1655
+ if (!(0, import_ts_extras19.isDefined)(parent)) {
1601
1656
  return false;
1602
1657
  }
1603
- if (parent.type === "TSInterfaceDeclaration" || parent.type === "TSTypeAliasDeclaration") {
1658
+ if (parent.type === import_utils11.AST_NODE_TYPES.TSInterfaceDeclaration || parent.type === import_utils11.AST_NODE_TYPES.TSTypeAliasDeclaration) {
1604
1659
  return parent.id === node;
1605
1660
  }
1606
- if (parent.type === "ClassDeclaration" || parent.type === "FunctionDeclaration" || parent.type === "TSDeclareFunction" || parent.type === "TSEnumDeclaration") {
1661
+ if (parent.type === import_utils11.AST_NODE_TYPES.ClassDeclaration || parent.type === import_utils11.AST_NODE_TYPES.FunctionDeclaration || parent.type === import_utils11.AST_NODE_TYPES.TSDeclareFunction || parent.type === import_utils11.AST_NODE_TYPES.TSEnumDeclaration) {
1607
1662
  return parent.id === node;
1608
1663
  }
1609
- if (parent.type === "VariableDeclarator") {
1664
+ if (parent.type === import_utils11.AST_NODE_TYPES.VariableDeclarator) {
1610
1665
  return parent.id === node;
1611
1666
  }
1612
1667
  return false;
@@ -1616,10 +1671,10 @@ var normalizeTagComment = (text) => {
1616
1671
  return void 0;
1617
1672
  }
1618
1673
  if (typeof text === "string") {
1619
- const normalized2 = text.trim().replaceAll(/\s+/gu, " ");
1674
+ const normalized2 = text.trim().replaceAll(/\s+/gv, " ");
1620
1675
  return normalized2.length > 0 ? normalized2 : void 0;
1621
1676
  }
1622
- const normalized = (0, import_ts_extras19.arrayJoin)(text.map((part) => part.text), "").replaceAll(/\s+/gu, " ").trim();
1677
+ const normalized = (0, import_ts_extras19.arrayJoin)(text.map((part) => part.text), "").replaceAll(/\s+/gv, " ").trim();
1623
1678
  return normalized.length > 0 ? normalized : void 0;
1624
1679
  };
1625
1680
  var isUnknownRecord = (value) => typeof value === "object" && value !== null;
@@ -1654,7 +1709,7 @@ var defaultOptions3 = [{}];
1654
1709
  var rule22 = ruleCreator({
1655
1710
  create: (context) => {
1656
1711
  const [{ ignored = {} } = {}] = context.options;
1657
- const parserServices = import_utils3.ESLintUtils.getParserServices(context);
1712
+ const parserServices = import_utils12.ESLintUtils.getParserServices(context);
1658
1713
  const typeChecker = parserServices.program.getTypeChecker();
1659
1714
  const compiledIgnorePatterns = compileIgnorePatterns(ignored);
1660
1715
  const ignorePatterns = compiledIgnorePatterns.patterns;
@@ -1804,7 +1859,7 @@ var no_enum_default = rule23;
1804
1859
 
1805
1860
  // dist/rules/no-expression-empty-lines.js
1806
1861
  var import_ts_extras21 = require("ts-extras");
1807
- var splitLines2 = (sourceText) => (0, import_ts_extras21.stringSplit)(sourceText.replaceAll(/\r\n?/gu, "\n"), "\n");
1862
+ var splitLines2 = (sourceText) => (0, import_ts_extras21.stringSplit)(sourceText.replaceAll(/\r\n?/gv, "\n"), "\n");
1808
1863
  var hasBlankLine = (text) => splitLines2(text).some((line) => line.trim().length === 0);
1809
1864
  var normalizeExpressionSource = (sourceText) => {
1810
1865
  const lines = splitLines2(sourceText).map((line) => line.trimEnd());
@@ -1852,7 +1907,7 @@ var no_expression_empty_lines_default = rule24;
1852
1907
 
1853
1908
  // dist/rules/no-foreach.js
1854
1909
  var import_type_utils3 = require("@typescript-eslint/type-utils");
1855
- var import_utils4 = require("@typescript-eslint/utils");
1910
+ var import_utils13 = require("@typescript-eslint/utils");
1856
1911
  var import_ts_extras22 = require("ts-extras");
1857
1912
  var defaultOptions4 = [{}];
1858
1913
  var defaultTypes = [
@@ -1882,14 +1937,14 @@ var matchesConfiguredCollectionType = (typeChecker, type, configuredTypeNames) =
1882
1937
  };
1883
1938
  var rule25 = ruleCreator({
1884
1939
  create: (context) => {
1885
- const parserServices = import_utils4.ESLintUtils.getParserServices(context);
1940
+ const parserServices = import_utils13.ESLintUtils.getParserServices(context);
1886
1941
  const typeChecker = parserServices.program.getTypeChecker();
1887
1942
  const [{ types = defaultTypes } = {}] = context.options;
1888
1943
  const configuredTypeNames = getConfiguredTypeNames(types);
1889
1944
  return {
1890
1945
  "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='forEach']": (callExpression) => {
1891
1946
  const { callee } = callExpression;
1892
- if (callee.type !== "MemberExpression") {
1947
+ if (callee.type !== import_utils13.AST_NODE_TYPES.MemberExpression) {
1893
1948
  return;
1894
1949
  }
1895
1950
  const objectType = (0, import_type_utils3.getConstrainedTypeAtLocation)(parserServices, callee.object);
@@ -1942,25 +1997,26 @@ var rule25 = ruleCreator({
1942
1997
  var no_foreach_default = rule25;
1943
1998
 
1944
1999
  // dist/rules/no-function-declare-after-return.js
2000
+ var import_utils14 = require("@typescript-eslint/utils");
1945
2001
  var import_ts_extras23 = require("ts-extras");
1946
- var isStatementList = (node) => node.type === "BlockStatement" || node.type === "Program";
2002
+ var isStatementList = (node) => node.type === import_utils14.AST_NODE_TYPES.BlockStatement || node.type === import_utils14.AST_NODE_TYPES.Program;
1947
2003
  var getLineStartIndex = (sourceText, index) => sourceText.lastIndexOf("\n", index - 1) + 1;
1948
2004
  var getSafeFixRangeStart = (sourceCode, node) => {
1949
- const declarationStart = (0, import_ts_extras23.arrayFirst)(node.range) ?? 0;
2005
+ const declarationStart = (0, import_ts_extras23.arrayFirst)(node.range);
1950
2006
  const tokenBeforeDeclaration = sourceCode.getTokenBefore(node);
1951
- const tokenBeforeEnd = tokenBeforeDeclaration === null ? 0 : (0, import_ts_extras23.arrayLast)(tokenBeforeDeclaration.range) ?? 0;
1952
- const commentsBeforeDeclaration = sourceCode.getCommentsBefore(node).filter((comment) => ((0, import_ts_extras23.arrayFirst)(comment.range) ?? 0) >= tokenBeforeEnd && ((0, import_ts_extras23.arrayLast)(comment.range) ?? 0) <= declarationStart);
2007
+ const tokenBeforeEnd = tokenBeforeDeclaration === null ? 0 : (0, import_ts_extras23.arrayLast)(tokenBeforeDeclaration.range);
2008
+ const commentsBeforeDeclaration = sourceCode.getCommentsBefore(node).filter((comment) => (0, import_ts_extras23.arrayFirst)(comment.range) >= tokenBeforeEnd && (0, import_ts_extras23.arrayLast)(comment.range) <= declarationStart);
1953
2009
  const firstLeadingComment = (0, import_ts_extras23.arrayFirst)(commentsBeforeDeclaration);
1954
- const firstMovableNodeStart = firstLeadingComment === void 0 ? declarationStart : (0, import_ts_extras23.arrayFirst)(firstLeadingComment.range) ?? declarationStart;
2010
+ const firstMovableNodeStart = firstLeadingComment === void 0 ? declarationStart : (0, import_ts_extras23.arrayFirst)(firstLeadingComment.range);
1955
2011
  return getLineStartIndex(sourceCode.text, firstMovableNodeStart);
1956
2012
  };
1957
2013
  var getSafeFixRangeEnd = (sourceCode, node) => {
1958
- const declarationEnd = (0, import_ts_extras23.arrayLast)(node.range) ?? 0;
2014
+ const declarationEnd = (0, import_ts_extras23.arrayLast)(node.range);
1959
2015
  const tokenAfterDeclaration = sourceCode.getTokenAfter(node);
1960
2016
  if (tokenAfterDeclaration === null) {
1961
2017
  return declarationEnd;
1962
2018
  }
1963
- return getLineStartIndex(sourceCode.text, (0, import_ts_extras23.arrayFirst)(tokenAfterDeclaration.range) ?? declarationEnd);
2019
+ return getLineStartIndex(sourceCode.text, (0, import_ts_extras23.arrayFirst)(tokenAfterDeclaration.range));
1964
2020
  };
1965
2021
  var rule26 = ruleCreator({
1966
2022
  create: (context) => ({
@@ -1973,18 +2029,18 @@ var rule26 = ruleCreator({
1973
2029
  const returnIndex = siblings.indexOf(node);
1974
2030
  for (let i = returnIndex + 1; i < siblings.length; i++) {
1975
2031
  const sibling = siblings[i];
1976
- if (sibling?.type !== "FunctionDeclaration") {
2032
+ if (sibling?.type !== import_utils14.AST_NODE_TYPES.FunctionDeclaration) {
1977
2033
  continue;
1978
2034
  }
1979
2035
  const functionDeclaration = sibling;
1980
2036
  const returnStatement = node;
1981
2037
  context.report({
1982
2038
  data: {
1983
- name: functionDeclaration.id?.name ?? "(anonymous)"
2039
+ name: functionDeclaration.id.name
1984
2040
  },
1985
2041
  fix(fixer) {
1986
2042
  const sourceCode = context.sourceCode;
1987
- const declarationEnd = (0, import_ts_extras23.arrayLast)(functionDeclaration.range) ?? 0;
2043
+ const declarationEnd = (0, import_ts_extras23.arrayLast)(functionDeclaration.range);
1988
2044
  const fixRangeStart = getSafeFixRangeStart(sourceCode, functionDeclaration);
1989
2045
  const fixRangeEnd = getSafeFixRangeEnd(sourceCode, functionDeclaration);
1990
2046
  const functionAndLeadingCommentsText = sourceCode.text.slice(fixRangeStart, declarationEnd);
@@ -1992,7 +2048,10 @@ var rule26 = ruleCreator({
1992
2048
  return null;
1993
2049
  }
1994
2050
  const returnToken = sourceCode.getFirstToken(returnStatement);
1995
- const indentationEnd = (0, import_ts_extras23.arrayFirst)(returnToken?.range ?? [0]) ?? 0;
2051
+ if (returnToken === null) {
2052
+ return null;
2053
+ }
2054
+ const indentationEnd = (0, import_ts_extras23.arrayFirst)(returnToken.range);
1996
2055
  const returnLineStart = getLineStartIndex(sourceCode.text, indentationEnd);
1997
2056
  return [
1998
2057
  fixer.insertTextBeforeRange([returnLineStart, returnLineStart], `${functionAndLeadingCommentsText}
@@ -2029,12 +2088,12 @@ var no_function_declare_after_return_default = rule26;
2029
2088
 
2030
2089
  // dist/rules/no-implicit-any-catch.js
2031
2090
  var import_type_utils4 = require("@typescript-eslint/type-utils");
2032
- var import_utils5 = require("@typescript-eslint/utils");
2091
+ var import_utils15 = require("@typescript-eslint/utils");
2033
2092
  var import_ts_extras24 = require("ts-extras");
2034
2093
  var defaultOptions5 = [{}];
2035
2094
  var isPromiseRejectionCall = (callExpression, parserServices, program) => {
2036
2095
  const { callee } = callExpression;
2037
- if (callee.type !== "MemberExpression" || callee.object.type === "Super") {
2096
+ if (callee.type !== import_utils15.AST_NODE_TYPES.MemberExpression || callee.object.type === import_utils15.AST_NODE_TYPES.Super) {
2038
2097
  return false;
2039
2098
  }
2040
2099
  const objectType = (0, import_type_utils4.getConstrainedTypeAtLocation)(parserServices, callee.object);
@@ -2060,15 +2119,15 @@ var annotateImplicitParamFixes = (fixer, sourceCode, parameter) => {
2060
2119
  };
2061
2120
  var rule27 = ruleCreator({
2062
2121
  create: (context) => {
2063
- const parserServices = import_utils5.ESLintUtils.getParserServices(context);
2122
+ const parserServices = import_utils15.ESLintUtils.getParserServices(context);
2064
2123
  const sourceCode = context.sourceCode;
2065
2124
  const [{ allowExplicitAny = false } = {}] = context.options;
2066
2125
  const checkRejectionCallback = (callExpression, callback) => {
2067
- if (callback.type !== "ArrowFunctionExpression" && callback.type !== "FunctionExpression") {
2126
+ if (callback.type !== import_utils15.AST_NODE_TYPES.ArrowFunctionExpression && callback.type !== import_utils15.AST_NODE_TYPES.FunctionExpression) {
2068
2127
  return;
2069
2128
  }
2070
2129
  const [parameter] = callback.params;
2071
- if (parameter?.type !== "Identifier") {
2130
+ if (parameter?.type !== import_utils15.AST_NODE_TYPES.Identifier) {
2072
2131
  return;
2073
2132
  }
2074
2133
  if (!isPromiseRejectionCall(callExpression, parserServices, parserServices.program)) {
@@ -2090,10 +2149,10 @@ var rule27 = ruleCreator({
2090
2149
  }
2091
2150
  const { typeAnnotation } = parameter;
2092
2151
  const annotationType = typeAnnotation.typeAnnotation.type;
2093
- if (annotationType === "TSUnknownKeyword") {
2152
+ if (annotationType === import_utils15.AST_NODE_TYPES.TSUnknownKeyword) {
2094
2153
  return;
2095
2154
  }
2096
- if (annotationType === "TSAnyKeyword") {
2155
+ if (annotationType === import_utils15.AST_NODE_TYPES.TSAnyKeyword) {
2097
2156
  if (allowExplicitAny) {
2098
2157
  return;
2099
2158
  }
@@ -2197,13 +2256,13 @@ var rule29 = createImportPatternRule({
2197
2256
  var no_internal_modules_default = rule29;
2198
2257
 
2199
2258
  // dist/rules/no-internal.js
2200
- var import_utils6 = require("@typescript-eslint/utils");
2259
+ var import_utils16 = require("@typescript-eslint/utils");
2201
2260
  var import_ts_extras25 = require("ts-extras");
2202
2261
  var defaultOptions6 = [{}];
2203
2262
  var rule30 = ruleCreator({
2204
2263
  create: (context) => {
2205
2264
  const [{ ignored = {} } = {}] = context.options;
2206
- const parserServices = import_utils6.ESLintUtils.getParserServices(context);
2265
+ const parserServices = import_utils16.ESLintUtils.getParserServices(context);
2207
2266
  const typeChecker = parserServices.program.getTypeChecker();
2208
2267
  const compiledIgnorePatterns = compileIgnorePatterns(ignored);
2209
2268
  const ignorePatterns = compiledIgnorePatterns.patterns;
@@ -2342,7 +2401,7 @@ var rule31 = ruleCreator({
2342
2401
  var no_language_mixing_default = rule31;
2343
2402
 
2344
2403
  // dist/rules/no-misused-generics.js
2345
- var import_utils7 = require("@typescript-eslint/utils");
2404
+ var import_utils17 = require("@typescript-eslint/utils");
2346
2405
  var import_ts_extras27 = require("ts-extras");
2347
2406
  var tsutils = __toESM(require("tsutils"), 1);
2348
2407
  var getVariableUses = (usageMap, identifier) => usageMap.get(identifier)?.uses ?? [];
@@ -2414,7 +2473,7 @@ var analyzeTypeParameterUses = (uses, signature, typeParameters) => {
2414
2473
  };
2415
2474
  var rule32 = ruleCreator({
2416
2475
  create: (context) => {
2417
- const parserServices = import_utils7.ESLintUtils.getParserServices(context);
2476
+ const parserServices = import_utils17.ESLintUtils.getParserServices(context);
2418
2477
  let usageMap = null;
2419
2478
  const checkTypeParameters = (typeParameters, signature) => {
2420
2479
  usageMap ??= tsutils.collectVariableUsage(signature.getSourceFile());
@@ -2435,7 +2494,7 @@ var rule32 = ruleCreator({
2435
2494
  });
2436
2495
  continue;
2437
2496
  }
2438
- if (!usageAnalysis.usedInReturnOrExtends && usageMap !== null && !isConstrainedByAnotherTypeParameter(typeParameter, typeParameters, usageMap)) {
2497
+ if (!usageAnalysis.usedInReturnOrExtends && !isConstrainedByAnotherTypeParameter(typeParameter, typeParameters, usageMap)) {
2439
2498
  context.report({
2440
2499
  data: {
2441
2500
  name: typeParameter.name.text,
@@ -2563,9 +2622,10 @@ var rule35 = createImportPatternRule({
2563
2622
  var no_nodejs_modules_default = rule35;
2564
2623
 
2565
2624
  // dist/rules/no-param-reassign.js
2625
+ var import_utils18 = require("@typescript-eslint/utils");
2566
2626
  var import_ts_extras29 = require("ts-extras");
2567
2627
  var getAssignmentTargetIdentifier = (node) => {
2568
- if (node.left.type === "Identifier") {
2628
+ if (node.left.type === import_utils18.AST_NODE_TYPES.Identifier) {
2569
2629
  return node.left;
2570
2630
  }
2571
2631
  return void 0;
@@ -2581,7 +2641,7 @@ var getScopeVariable = (sourceCode, identifier) => {
2581
2641
  }
2582
2642
  return void 0;
2583
2643
  };
2584
- var isParameterVariable = (variable) => variable?.defs.some((definition) => definition.type === "Parameter") ?? false;
2644
+ var isParameterVariable = (variable) => variable?.defs.some((definition) => definition.type === import_utils18.TSESLint.Scope.DefinitionType.Parameter) ?? false;
2585
2645
  var isInFirstFunctionExpressionStatement = (sourceCode, node) => {
2586
2646
  const ancestors = sourceCode.getAncestors(node);
2587
2647
  let enclosingFunction = null;
@@ -2590,16 +2650,16 @@ var isInFirstFunctionExpressionStatement = (sourceCode, node) => {
2590
2650
  if (ancestor === void 0) {
2591
2651
  continue;
2592
2652
  }
2593
- if (ancestor.type === "ArrowFunctionExpression" || ancestor.type === "FunctionDeclaration" || ancestor.type === "FunctionExpression") {
2653
+ if (ancestor.type === import_utils18.AST_NODE_TYPES.ArrowFunctionExpression || ancestor.type === import_utils18.AST_NODE_TYPES.FunctionDeclaration || ancestor.type === import_utils18.AST_NODE_TYPES.FunctionExpression) {
2594
2654
  enclosingFunction = ancestor;
2595
2655
  break;
2596
2656
  }
2597
2657
  }
2598
- if (enclosingFunction?.body.type !== "BlockStatement") {
2658
+ if (enclosingFunction?.body.type !== import_utils18.AST_NODE_TYPES.BlockStatement) {
2599
2659
  return false;
2600
2660
  }
2601
2661
  const [firstStatement] = enclosingFunction.body.body;
2602
- if (firstStatement?.type !== "ExpressionStatement") {
2662
+ if (firstStatement?.type !== import_utils18.AST_NODE_TYPES.ExpressionStatement) {
2603
2663
  return false;
2604
2664
  }
2605
2665
  return (0, import_ts_extras29.arrayFirst)(node.range) >= (0, import_ts_extras29.arrayFirst)(firstStatement.range) && node.range[1] <= firstStatement.range[1];
@@ -2629,7 +2689,7 @@ var rule36 = ruleCreator({
2629
2689
  reportIfParameterReassignment(identifier);
2630
2690
  },
2631
2691
  UpdateExpression: (node) => {
2632
- if (node.argument.type !== "Identifier") {
2692
+ if (node.argument.type !== import_utils18.AST_NODE_TYPES.Identifier) {
2633
2693
  return;
2634
2694
  }
2635
2695
  reportIfParameterReassignment(node.argument);
@@ -2696,7 +2756,7 @@ var import_ts_extras31 = require("ts-extras");
2696
2756
 
2697
2757
  // dist/_internal/syntax-selectors.js
2698
2758
  var import_ts_extras30 = require("ts-extras");
2699
- var isSelectorObject = (value) => typeof value === "object" && value !== null && (0, import_ts_extras30.keyIn)(value, "selector");
2759
+ var isSelectorObject = (value) => typeof value === "object" && (0, import_ts_extras30.keyIn)(value, "selector");
2700
2760
  var normalizeSyntaxSelector = (selector25) => {
2701
2761
  if (isSelectorObject(selector25)) {
2702
2762
  if (!(0, import_ts_extras30.isDefined)(selector25.message)) {
@@ -2848,31 +2908,31 @@ var deprecatedRule9 = withDeprecatedRuleLifecycle(rule39, {
2848
2908
  var no_secret_default = deprecatedRule9;
2849
2909
 
2850
2910
  // dist/rules/no-self-import.js
2851
- var import_node_path4 = require("node:path");
2911
+ var import_node_path4 = __toESM(require("node:path"), 1);
2852
2912
  var import_ts_extras32 = require("ts-extras");
2853
2913
  var importFileSuffixes = [
2854
2914
  "",
2855
- ".ts",
2856
- ".tsx",
2857
- ".js",
2858
- ".mjs",
2859
2915
  ".cjs",
2860
2916
  ".d.ts",
2861
- "/index.ts",
2862
- "/index.tsx",
2917
+ ".js",
2918
+ ".mjs",
2919
+ ".ts",
2920
+ ".tsx",
2921
+ "/index.cjs",
2863
2922
  "/index.js",
2864
2923
  "/index.mjs",
2865
- "/index.cjs"
2924
+ "/index.ts",
2925
+ "/index.tsx"
2866
2926
  ];
2867
- var toResolvedCandidates = (baseDirectory, importSource) => importFileSuffixes.map((suffix) => (0, import_node_path4.resolve)(baseDirectory, `${importSource}${suffix}`));
2927
+ var toResolvedCandidates = (baseDirectory, importSource) => importFileSuffixes.map((suffix) => import_node_path4.default.resolve(baseDirectory, `${importSource}${suffix}`));
2868
2928
  var rule40 = ruleCreator({
2869
2929
  create: (context) => {
2870
2930
  const currentFilePath = context.filename;
2871
2931
  if (currentFilePath === "<input>") {
2872
2932
  return {};
2873
2933
  }
2874
- const normalizedCurrentFilePath = (0, import_node_path4.resolve)(currentFilePath);
2875
- const currentFileDirectory = (0, import_node_path4.dirname)(normalizedCurrentFilePath);
2934
+ const normalizedCurrentFilePath = import_node_path4.default.resolve(currentFilePath);
2935
+ const currentFileDirectory = import_node_path4.default.dirname(normalizedCurrentFilePath);
2876
2936
  return {
2877
2937
  "ImportDeclaration, ExportNamedDeclaration[source], ExportAllDeclaration, ImportExpression": (node) => {
2878
2938
  const sourceText = getImportSourceFromNode(node);
@@ -2926,7 +2986,8 @@ var deprecatedRule10 = withDeprecatedRuleLifecycle(rule40, {
2926
2986
  var no_self_import_default = deprecatedRule10;
2927
2987
 
2928
2988
  // dist/rules/no-shadow.js
2929
- var shouldIgnoreVariable = (variable) => variable.defs.some((definition) => definition.node.type === "TSEnumDeclaration" || definition.type.includes("Enum"));
2989
+ var import_utils19 = require("@typescript-eslint/utils");
2990
+ var shouldIgnoreVariable = (variable) => variable.defs.some((definition) => definition.node.type === import_utils19.AST_NODE_TYPES.TSEnumDeclaration || definition.type.includes("Enum"));
2930
2991
  var findShadowedVariable = (scope, variableName) => {
2931
2992
  let upperScope = scope.upper;
2932
2993
  while (upperScope !== null) {
@@ -3015,7 +3076,8 @@ var rule42 = createImportPatternRule({
3015
3076
  var no_sibling_import_default = rule42;
3016
3077
 
3017
3078
  // dist/rules/no-single-line-comment.js
3018
- var directiveCommentPattern = /^(?:eslint(?:-|$)|global\s|exported\s|ts-(?:check|expect-error|ignore|nocheck))/u;
3079
+ var import_utils20 = require("@typescript-eslint/utils");
3080
+ var directiveCommentPattern = /^(?:eslint(?:-|$)|global\s|exported\s|ts-(?:check|expect-error|ignore|nocheck))/v;
3019
3081
  var isDirectiveComment = (commentText2) => directiveCommentPattern.test(commentText2.trimStart());
3020
3082
  var createConvertToBlockSuggestionFix = (commentValue, commentRange) => {
3021
3083
  if (commentValue.includes("*/")) {
@@ -3029,7 +3091,7 @@ var rule43 = ruleCreator({
3029
3091
  return {
3030
3092
  Program: () => {
3031
3093
  for (const comment of context.sourceCode.getAllComments()) {
3032
- if (comment.type !== "Line") {
3094
+ if (comment.type !== import_utils20.AST_TOKEN_TYPES.Line) {
3033
3095
  continue;
3034
3096
  }
3035
3097
  if (allowDirectiveComments && isDirectiveComment(comment.value)) {
@@ -3187,9 +3249,10 @@ var rule45 = ruleCreator({
3187
3249
  var no_underscore_export_default = rule45;
3188
3250
 
3189
3251
  // dist/rules/no-unnecessary-as-const.js
3252
+ var import_utils21 = require("@typescript-eslint/utils");
3190
3253
  var disallowedSelector7 = "VariableDeclarator > TSAsExpression[expression.properties.length=0] > TSTypeReference > Identifier[name='const'], VariableDeclarator[id.typeAnnotation] > TSAsExpression > TSTypeReference > Identifier[name='const']";
3191
3254
  var getAsConstExpression = (node) => {
3192
- if (node.type !== "Identifier" || node.parent?.type !== "TSTypeReference" || node.parent.parent?.type !== "TSAsExpression") {
3255
+ if (node.type !== import_utils21.AST_NODE_TYPES.Identifier || node.parent.type !== import_utils21.AST_NODE_TYPES.TSTypeReference || node.parent.parent.type !== import_utils21.AST_NODE_TYPES.TSAsExpression) {
3193
3256
  return void 0;
3194
3257
  }
3195
3258
  return node.parent.parent;
@@ -3234,6 +3297,7 @@ var rule46 = ruleCreator({
3234
3297
  var no_unnecessary_as_const_default = rule46;
3235
3298
 
3236
3299
  // dist/rules/no-unnecessary-break.js
3300
+ var import_utils22 = require("@typescript-eslint/utils");
3237
3301
  var import_ts_extras34 = require("ts-extras");
3238
3302
  var disallowedSelector8 = "SwitchCase:last-child > BreakStatement.consequent";
3239
3303
  var createTrailingBreakRemovalFix = (sourceCode, node) => {
@@ -3245,7 +3309,7 @@ var createTrailingBreakRemovalFix = (sourceCode, node) => {
3245
3309
  return (fixer) => fixer.remove(node);
3246
3310
  }
3247
3311
  const leadingText = sourceCode.text.slice(previousToken.range[1], (0, import_ts_extras34.arrayFirst)(node.range));
3248
- const leadingWhitespaceLength = /^[\t ]*/u.exec(leadingText)?.[0].length ?? 0;
3312
+ const leadingWhitespaceLength = /^[\t ]*/v.exec(leadingText)?.[0].length ?? 0;
3249
3313
  return (fixer) => fixer.removeRange([
3250
3314
  (0, import_ts_extras34.arrayFirst)(node.range) - leadingWhitespaceLength,
3251
3315
  node.range[1]
@@ -3256,7 +3320,7 @@ var rule47 = ruleCreator({
3256
3320
  const sourceCode = context.sourceCode;
3257
3321
  return {
3258
3322
  [disallowedSelector8]: (node) => {
3259
- if (node.type !== "BreakStatement" || node.label !== null) {
3323
+ if (node.type !== import_utils22.AST_NODE_TYPES.BreakStatement || node.label !== null) {
3260
3324
  return;
3261
3325
  }
3262
3326
  const fix = createTrailingBreakRemovalFix(sourceCode, node);
@@ -3357,13 +3421,14 @@ var rule48 = ruleCreator({
3357
3421
  var no_unnecessary_initialization_default = rule48;
3358
3422
 
3359
3423
  // dist/rules/no-unnecessary-template-literal.js
3424
+ var import_utils23 = require("@typescript-eslint/utils");
3360
3425
  var import_ts_extras36 = require("ts-extras");
3361
3426
  var selector3 = "TemplateLiteral[expressions.length=0] > TemplateElement";
3362
3427
  var toSafeStringLiteralText = (templateLiteral) => JSON.stringify((0, import_ts_extras36.arrayFirst)(templateLiteral.quasis)?.value.cooked ?? (0, import_ts_extras36.arrayFirst)(templateLiteral.quasis)?.value.raw ?? "");
3363
3428
  var rule49 = ruleCreator({
3364
3429
  create: (context) => ({
3365
3430
  [selector3]: (node) => {
3366
- const templateLiteral = node.type === "TemplateElement" && node.parent?.type === "TemplateLiteral" ? node.parent : void 0;
3431
+ const templateLiteral = node.type === import_utils23.AST_NODE_TYPES.TemplateElement && node.parent.type === import_utils23.AST_NODE_TYPES.TemplateLiteral ? node.parent : void 0;
3367
3432
  if (templateLiteral === void 0) {
3368
3433
  return;
3369
3434
  }
@@ -3417,6 +3482,7 @@ var deprecatedRule12 = withDeprecatedRuleLifecycle(rule50, {
3417
3482
  var no_unused_disable_default = deprecatedRule12;
3418
3483
 
3419
3484
  // dist/rules/no-use-extend-native.js
3485
+ var import_utils24 = require("@typescript-eslint/utils");
3420
3486
  var import_ts_extras37 = require("ts-extras");
3421
3487
  var nativeTypeDefinitions = [
3422
3488
  {
@@ -3504,6 +3570,7 @@ var nativeTypeDefinitions = [
3504
3570
  }
3505
3571
  ];
3506
3572
  var nativeTypeNameSet = new Set(nativeTypeDefinitions.map((definition) => definition.name));
3573
+ var nativeTypeNameLookup = nativeTypeNameSet;
3507
3574
  function buildNativeTypeInfoByName(definitions) {
3508
3575
  return new Map(definitions.map((definition) => [
3509
3576
  definition.name,
@@ -3515,8 +3582,8 @@ function buildNativeTypeInfoByName(definitions) {
3515
3582
  function collectPropertyKinds(definition) {
3516
3583
  const propertyKinds = /* @__PURE__ */ new Map();
3517
3584
  const descriptorSources = [
3518
- definition.prototypeRef,
3519
- definition.constructorRef
3585
+ definition.constructorRef,
3586
+ definition.prototypeRef
3520
3587
  ];
3521
3588
  for (const descriptorSource of descriptorSources) {
3522
3589
  if (!(0, import_ts_extras37.isDefined)(descriptorSource)) {
@@ -3542,38 +3609,38 @@ function collectPropertyKinds(definition) {
3542
3609
  return propertyKinds;
3543
3610
  }
3544
3611
  function unwrapExpression(node) {
3545
- if (node.type === "TSAsExpression" || node.type === "TSTypeAssertion") {
3612
+ if (node.type === import_utils24.AST_NODE_TYPES.TSAsExpression || node.type === import_utils24.AST_NODE_TYPES.TSTypeAssertion) {
3546
3613
  return unwrapExpression(node.expression);
3547
3614
  }
3548
- if (node.type === "ChainExpression") {
3615
+ if (node.type === import_utils24.AST_NODE_TYPES.ChainExpression) {
3549
3616
  return unwrapExpression(node.expression);
3550
3617
  }
3551
3618
  return node;
3552
3619
  }
3553
3620
  var inferNativeType = (rawExpression) => {
3554
3621
  const expression = unwrapExpression(rawExpression);
3555
- if (expression.type === "ArrayExpression") {
3622
+ if (expression.type === import_utils24.AST_NODE_TYPES.ArrayExpression) {
3556
3623
  return "Array";
3557
3624
  }
3558
- if (expression.type === "ObjectExpression") {
3625
+ if (expression.type === import_utils24.AST_NODE_TYPES.ObjectExpression) {
3559
3626
  return "Object";
3560
3627
  }
3561
- if (expression.type === "TemplateLiteral") {
3628
+ if (expression.type === import_utils24.AST_NODE_TYPES.TemplateLiteral) {
3562
3629
  return "String";
3563
3630
  }
3564
- if (expression.type === "Literal") {
3631
+ if (expression.type === import_utils24.AST_NODE_TYPES.Literal) {
3565
3632
  return inferNativeTypeFromLiteral(expression);
3566
3633
  }
3567
- if (expression.type === "Identifier" && isNativeTypeName(expression.name)) {
3634
+ if (expression.type === import_utils24.AST_NODE_TYPES.Identifier && isNativeTypeName(expression.name)) {
3568
3635
  return expression.name;
3569
3636
  }
3570
- if (expression.type === "BinaryExpression") {
3637
+ if (expression.type === import_utils24.AST_NODE_TYPES.BinaryExpression) {
3571
3638
  return inferNativeTypeFromBinaryExpression(expression);
3572
3639
  }
3573
- if (expression.type === "MemberExpression") {
3640
+ if (expression.type === import_utils24.AST_NODE_TYPES.MemberExpression) {
3574
3641
  return inferNativeTypeFromMemberExpression(expression);
3575
3642
  }
3576
- if (expression.type === "NewExpression") {
3643
+ if (expression.type === import_utils24.AST_NODE_TYPES.NewExpression) {
3577
3644
  return inferNativeTypeFromNewExpression(expression);
3578
3645
  }
3579
3646
  return null;
@@ -3611,13 +3678,13 @@ function inferNativeTypeFromLiteral(expression) {
3611
3678
  return null;
3612
3679
  }
3613
3680
  function inferNativeTypeFromMemberExpression(expression) {
3614
- if (expression.computed || expression.property.type !== "Identifier" || expression.property.name !== "prototype" || expression.object.type !== "Identifier" || !isNativeTypeName(expression.object.name)) {
3681
+ if (expression.computed || expression.property.type !== import_utils24.AST_NODE_TYPES.Identifier || expression.property.name !== "prototype" || expression.object.type !== import_utils24.AST_NODE_TYPES.Identifier || !isNativeTypeName(expression.object.name)) {
3615
3682
  return null;
3616
3683
  }
3617
3684
  return expression.object.name;
3618
3685
  }
3619
3686
  function inferNativeTypeFromNewExpression(expression) {
3620
- if (expression.callee.type !== "Identifier" || !isNativeTypeName(expression.callee.name)) {
3687
+ if (expression.callee.type !== import_utils24.AST_NODE_TYPES.Identifier || !isNativeTypeName(expression.callee.name)) {
3621
3688
  return null;
3622
3689
  }
3623
3690
  return expression.callee.name;
@@ -3632,17 +3699,17 @@ function getMemberKind(descriptor) {
3632
3699
  return "data";
3633
3700
  }
3634
3701
  var getStaticMemberPropertyName = (node) => {
3635
- if (node.computed || node.property.type !== "Identifier") {
3702
+ if (node.computed || node.property.type !== import_utils24.AST_NODE_TYPES.Identifier) {
3636
3703
  return null;
3637
3704
  }
3638
3705
  return node.property.name;
3639
3706
  };
3640
3707
  var isCallUsage = (node) => {
3641
3708
  const parent = node.parent;
3642
- return parent.type === "CallExpression" && parent.callee === node;
3709
+ return parent.type === import_utils24.AST_NODE_TYPES.CallExpression && parent.callee === node;
3643
3710
  };
3644
3711
  var nativeTypeInfoByName = buildNativeTypeInfoByName(nativeTypeDefinitions);
3645
- var isNativeTypeName = (value) => (0, import_ts_extras37.setHas)(nativeTypeNameSet, value);
3712
+ var isNativeTypeName = (value) => (0, import_ts_extras37.setHas)(nativeTypeNameLookup, value);
3646
3713
  var rule51 = ruleCreator({
3647
3714
  create: (context) => ({
3648
3715
  MemberExpression: (node) => {
@@ -3745,20 +3812,116 @@ var deprecatedRule14 = withDeprecatedRuleLifecycle(rule53, {
3745
3812
  var no_value_tostring_default = deprecatedRule14;
3746
3813
 
3747
3814
  // dist/rules/no-vulnerable.js
3815
+ var import_utils25 = require("@typescript-eslint/utils");
3816
+ var import_node_module = require("node:module");
3817
+ var import_node_path5 = __toESM(require("node:path"), 1);
3748
3818
  var import_recheck = require("recheck");
3749
3819
  var import_ts_extras38 = require("ts-extras");
3820
+ var requireFromWorkingDirectory = (0, import_node_module.createRequire)(import_node_path5.default.join(process.cwd(), "package.json"));
3821
+ var isUnknownRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3822
+ var isModuleNotFoundError = (error) => {
3823
+ if (!isUnknownRecord2(error)) {
3824
+ return false;
3825
+ }
3826
+ return (0, import_ts_extras38.keyIn)(error, "code") && error["code"] === "MODULE_NOT_FOUND";
3827
+ };
3828
+ var createRequireFromPluginPackage = () => {
3829
+ try {
3830
+ return (0, import_node_module.createRequire)(requireFromWorkingDirectory.resolve("eslint-plugin-etc-misc/package.json"));
3831
+ } catch (error) {
3832
+ if (isModuleNotFoundError(error)) {
3833
+ return requireFromWorkingDirectory;
3834
+ }
3835
+ throw error;
3836
+ }
3837
+ };
3838
+ var requireFromPluginPackage = createRequireFromPluginPackage();
3839
+ var shouldOverrideRuntimePath = (currentPath) => !(0, import_ts_extras38.isDefined)(currentPath) || import_node_path5.default.basename(currentPath).toLowerCase() === "package.json";
3840
+ var resolvePackageSiblingFile = (packageJsonSpecifier, siblingFileName) => {
3841
+ try {
3842
+ const packageJsonPath = requireFromPluginPackage.resolve(packageJsonSpecifier);
3843
+ return import_node_path5.default.join(import_node_path5.default.dirname(packageJsonPath), siblingFileName);
3844
+ } catch (error) {
3845
+ if (isModuleNotFoundError(error)) {
3846
+ return null;
3847
+ }
3848
+ throw error;
3849
+ }
3850
+ };
3851
+ var resolveRecheckJarPath = () => resolvePackageSiblingFile("recheck-jar/package.json", "recheck.jar");
3852
+ var resolveRecheckWindowsBinaryPath = () => {
3853
+ if (process.platform !== "win32" || process.arch !== "x64") {
3854
+ return null;
3855
+ }
3856
+ return resolvePackageSiblingFile("recheck-windows-x64/package.json", "recheck.exe");
3857
+ };
3858
+ var recheckJarPath = process.platform === "win32" ? resolveRecheckJarPath() : null;
3859
+ var recheckWindowsBinaryPath = process.platform === "win32" ? resolveRecheckWindowsBinaryPath() : null;
3860
+ var deleteRecheckEnvironmentValue = (key) => {
3861
+ if (key === "RECHECK_BIN") {
3862
+ delete process.env["RECHECK_BIN"];
3863
+ return;
3864
+ }
3865
+ delete process.env["RECHECK_JAR"];
3866
+ };
3867
+ var getRecheckEnvironmentValue = (key) => key === "RECHECK_BIN" ? process.env["RECHECK_BIN"] : process.env["RECHECK_JAR"];
3868
+ var setRecheckEnvironmentValue = (key, value) => {
3869
+ if (key === "RECHECK_BIN") {
3870
+ process.env["RECHECK_BIN"] = value;
3871
+ return;
3872
+ }
3873
+ process.env["RECHECK_JAR"] = value;
3874
+ };
3875
+ var getRecheckEnvironmentOverrides = () => {
3876
+ if (process.platform !== "win32") {
3877
+ return {};
3878
+ }
3879
+ const overrides = {};
3880
+ if (recheckJarPath !== null && shouldOverrideRuntimePath(getRecheckEnvironmentValue("RECHECK_JAR"))) {
3881
+ overrides.RECHECK_JAR = recheckJarPath;
3882
+ }
3883
+ if (recheckWindowsBinaryPath !== null && shouldOverrideRuntimePath(getRecheckEnvironmentValue("RECHECK_BIN"))) {
3884
+ overrides.RECHECK_BIN = recheckWindowsBinaryPath;
3885
+ }
3886
+ return overrides;
3887
+ };
3888
+ var restoreEnvironmentValue = (key, value) => {
3889
+ if (!(0, import_ts_extras38.isDefined)(value)) {
3890
+ deleteRecheckEnvironmentValue(key);
3891
+ return;
3892
+ }
3893
+ setRecheckEnvironmentValue(key, value);
3894
+ };
3895
+ var withRecheckEnvironmentOverrides = (callback) => {
3896
+ const overrides = getRecheckEnvironmentOverrides();
3897
+ const previousBin = getRecheckEnvironmentValue("RECHECK_BIN");
3898
+ const previousJar = getRecheckEnvironmentValue("RECHECK_JAR");
3899
+ if ((0, import_ts_extras38.isDefined)(overrides.RECHECK_BIN)) {
3900
+ setRecheckEnvironmentValue("RECHECK_BIN", overrides.RECHECK_BIN);
3901
+ }
3902
+ if ((0, import_ts_extras38.isDefined)(overrides.RECHECK_JAR)) {
3903
+ setRecheckEnvironmentValue("RECHECK_JAR", overrides.RECHECK_JAR);
3904
+ }
3905
+ try {
3906
+ return callback();
3907
+ } finally {
3908
+ restoreEnvironmentValue("RECHECK_BIN", previousBin);
3909
+ restoreEnvironmentValue("RECHECK_JAR", previousJar);
3910
+ }
3911
+ };
3912
+ var runRecheck = (source, flags, parameters) => withRecheckEnvironmentOverrides(() => (0, import_recheck.checkSync)(source, flags, parameters));
3750
3913
  var getStaticStringValue = (node) => {
3751
- if (node.type === "Literal" && typeof node.value === "string") {
3914
+ if (node.type === import_utils25.AST_NODE_TYPES.Literal && typeof node.value === "string") {
3752
3915
  return node.value;
3753
3916
  }
3754
- if (node.type === "TemplateLiteral" && node.expressions.length === 0 && node.quasis.length === 1) {
3917
+ if (node.type === import_utils25.AST_NODE_TYPES.TemplateLiteral && node.expressions.length === 0 && node.quasis.length === 1) {
3755
3918
  return (0, import_ts_extras38.arrayFirst)(node.quasis)?.value.cooked ?? null;
3756
3919
  }
3757
3920
  return null;
3758
3921
  };
3759
- var isNonSpreadArgument = (argument) => argument.type !== "SpreadElement";
3922
+ var isNonSpreadArgument = (argument) => argument.type !== import_utils25.AST_NODE_TYPES.SpreadElement;
3760
3923
  var isRegExpConstructorCall = (node) => {
3761
- if (node.callee.type !== "Identifier" || node.callee.name !== "RegExp") {
3924
+ if (node.callee.type !== import_utils25.AST_NODE_TYPES.Identifier || node.callee.name !== "RegExp") {
3762
3925
  return false;
3763
3926
  }
3764
3927
  if (node.arguments.length === 0 || node.arguments.length > 2) {
@@ -3776,7 +3939,7 @@ var isRegExpConstructorCall = (node) => {
3776
3939
  if (flagsArgument === void 0) {
3777
3940
  return true;
3778
3941
  }
3779
- if (flagsArgument.type === "SpreadElement") {
3942
+ if (flagsArgument.type === import_utils25.AST_NODE_TYPES.SpreadElement) {
3780
3943
  return false;
3781
3944
  }
3782
3945
  return (0, import_ts_extras38.isDefined)(getStaticStringValue(flagsArgument));
@@ -3796,13 +3959,42 @@ var getDiagnosticsErrorMessage = (error) => {
3796
3959
  }
3797
3960
  return "No additional details provided.";
3798
3961
  };
3962
+ var getThrownErrorMessage = (error) => {
3963
+ if (error instanceof Error && error.message.length > 0) {
3964
+ return error.message;
3965
+ }
3966
+ if (typeof error === "string" && error.length > 0) {
3967
+ return error;
3968
+ }
3969
+ return "No additional details provided.";
3970
+ };
3799
3971
  var rule54 = ruleCreator({
3800
3972
  create: (context, [rawOptions]) => {
3801
3973
  const options = rawOptions ?? {};
3802
3974
  const { ignoreErrors = true, permittableComplexities = [], ...recheckParameters } = options;
3803
3975
  const allowedComplexities = new Set(permittableComplexities);
3804
3976
  const reportDiagnostics = (node, source, flags) => {
3805
- const diagnostics = (0, import_recheck.checkSync)(source, flags, recheckParameters);
3977
+ const diagnostics = (() => {
3978
+ try {
3979
+ return runRecheck(source, flags, recheckParameters);
3980
+ } catch (error) {
3981
+ if (ignoreErrors) {
3982
+ return null;
3983
+ }
3984
+ context.report({
3985
+ data: {
3986
+ kind: "unexpected",
3987
+ message: getThrownErrorMessage(error)
3988
+ },
3989
+ messageId: "checkerError",
3990
+ node
3991
+ });
3992
+ return null;
3993
+ }
3994
+ })();
3995
+ if (diagnostics === null) {
3996
+ return;
3997
+ }
3806
3998
  if (diagnostics.status === "safe") {
3807
3999
  return;
3808
4000
  }
@@ -3982,11 +4174,12 @@ var rule56 = ruleCreator({
3982
4174
  var object_format_default = rule56;
3983
4175
 
3984
4176
  // dist/rules/only-export-name.js
4177
+ var import_utils26 = require("@typescript-eslint/utils");
3985
4178
  var import_ts_extras39 = require("ts-extras");
3986
4179
  var getExportedNames = (node) => {
3987
4180
  if (node.specifiers.length > 0) {
3988
- return node.specifiers.filter((specifier) => specifier.type === "ExportSpecifier").flatMap((specifier) => {
3989
- if (specifier.exported.type === "Identifier") {
4181
+ return node.specifiers.flatMap((specifier) => {
4182
+ if (specifier.exported.type === import_utils26.AST_NODE_TYPES.Identifier) {
3990
4183
  return [specifier.exported.name];
3991
4184
  }
3992
4185
  return [];
@@ -3996,13 +4189,13 @@ var getExportedNames = (node) => {
3996
4189
  if (declaration === null) {
3997
4190
  return [];
3998
4191
  }
3999
- if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") {
4192
+ if (declaration.type === import_utils26.AST_NODE_TYPES.FunctionDeclaration || declaration.type === import_utils26.AST_NODE_TYPES.ClassDeclaration) {
4000
4193
  return declaration.id === null ? [] : [declaration.id.name];
4001
4194
  }
4002
- if (declaration.type === "VariableDeclaration") {
4195
+ if (declaration.type === import_utils26.AST_NODE_TYPES.VariableDeclaration) {
4003
4196
  let names = [];
4004
4197
  for (const declarator of declaration.declarations) {
4005
- if (declarator.id.type === "Identifier") {
4198
+ if (declarator.id.type === import_utils26.AST_NODE_TYPES.Identifier) {
4006
4199
  names = [...names, declarator.id.name];
4007
4200
  }
4008
4201
  }
@@ -4166,12 +4359,12 @@ var prefer_includes_default = deprecatedRule15;
4166
4359
 
4167
4360
  // dist/rules/prefer-interface.js
4168
4361
  var import_type_utils5 = require("@typescript-eslint/type-utils");
4169
- var import_utils8 = require("@typescript-eslint/utils");
4362
+ var import_utils27 = require("@typescript-eslint/utils");
4170
4363
  var import_ts_extras40 = require("ts-extras");
4171
4364
  var tsutils2 = __toESM(require("tsutils"), 1);
4172
4365
  var defaultOptions8 = [{}];
4173
- var isExportedTypeAlias = (typeAliasDeclaration) => typeAliasDeclaration.parent?.type === "ExportNamedDeclaration" && typeAliasDeclaration.parent.declaration === typeAliasDeclaration;
4174
- var getTypeAliasDeclarationParent = (node) => node?.type === "TSTypeAliasDeclaration" ? node : void 0;
4366
+ var isExportedTypeAlias = (typeAliasDeclaration) => typeAliasDeclaration.parent.type === import_utils27.AST_NODE_TYPES.ExportNamedDeclaration && typeAliasDeclaration.parent.declaration === typeAliasDeclaration;
4367
+ var getTypeAliasDeclarationParent = (node) => node?.type === import_utils27.AST_NODE_TYPES.TSTypeAliasDeclaration ? node : void 0;
4175
4368
  var formatTypeParameters = (sourceCode, typeParameters) => typeParameters === void 0 ? "" : sourceCode.getText(typeParameters);
4176
4369
  var createTypeLiteralFixText = (sourceCode, typeAliasDeclaration, typeLiteralNode) => {
4177
4370
  const aliasTypeParameters = formatTypeParameters(sourceCode, typeAliasDeclaration.typeParameters);
@@ -4196,11 +4389,11 @@ var canSafelyConvertIntersection = (intersectionTypeNode, parserServices) => {
4196
4389
  let literals = [];
4197
4390
  let references = [];
4198
4391
  for (const intersectionMember of intersectionTypeNode.types) {
4199
- if (intersectionMember.type === "TSTypeLiteral") {
4392
+ if (intersectionMember.type === import_utils27.AST_NODE_TYPES.TSTypeLiteral) {
4200
4393
  literals = [...literals, intersectionMember];
4201
4394
  continue;
4202
4395
  }
4203
- if (intersectionMember.type === "TSTypeReference") {
4396
+ if (intersectionMember.type === import_utils27.AST_NODE_TYPES.TSTypeReference) {
4204
4397
  references = [...references, intersectionMember];
4205
4398
  continue;
4206
4399
  }
@@ -4239,7 +4432,7 @@ var rule61 = ruleCreator({
4239
4432
  create: (context) => {
4240
4433
  const [{ allowIntersection = true, allowLocal = false } = {}] = context.options;
4241
4434
  const sourceCode = context.sourceCode;
4242
- const parserServices = import_utils8.ESLintUtils.getParserServices(context, true);
4435
+ const parserServices = import_utils27.ESLintUtils.getParserServices(context, true);
4243
4436
  const typedParserServices = hasFullTypeInformation(parserServices) ? parserServices : void 0;
4244
4437
  const shouldSkipForAllowLocal = (typeAliasDeclaration) => allowLocal && !isExportedTypeAlias(typeAliasDeclaration);
4245
4438
  return {
@@ -4449,6 +4642,7 @@ var rule64 = ruleCreator({
4449
4642
  var prefer_only_export_default = rule64;
4450
4643
 
4451
4644
  // dist/rules/require-jsdoc.js
4645
+ var import_utils28 = require("@typescript-eslint/utils");
4452
4646
  var import_ts_extras41 = require("ts-extras");
4453
4647
  var defaultKinds = [
4454
4648
  "arrow-function",
@@ -4460,7 +4654,7 @@ var defaultKinds = [
4460
4654
  var hasJSDocComment = (sourceCode, node) => {
4461
4655
  const comments = sourceCode.getCommentsBefore(node);
4462
4656
  const comment = (0, import_ts_extras41.arrayLast)(comments);
4463
- return comment?.type === "Block" && comment.value.startsWith("*");
4657
+ return comment?.type === import_utils28.AST_TOKEN_TYPES.Block && comment.value.startsWith("*");
4464
4658
  };
4465
4659
  var reportMissingJSDoc = (context, node) => {
4466
4660
  if (hasJSDocComment(context.sourceCode, node)) {
@@ -4488,7 +4682,7 @@ var rule65 = ruleCreator({
4488
4682
  reportMissingJSDoc(context, node);
4489
4683
  },
4490
4684
  MethodDefinition: (node) => {
4491
- if (!(0, import_ts_extras41.setHas)(kinds, "method") || node.kind === "constructor" || node.key.type !== "Identifier") {
4685
+ if (!(0, import_ts_extras41.setHas)(kinds, "method") || node.kind === "constructor" || node.key.type !== import_utils28.AST_NODE_TYPES.Identifier) {
4492
4686
  return;
4493
4687
  }
4494
4688
  reportMissingJSDoc(context, node);
@@ -4497,12 +4691,12 @@ var rule65 = ruleCreator({
4497
4691
  if (!(0, import_ts_extras41.setHas)(kinds, "type")) {
4498
4692
  return;
4499
4693
  }
4500
- if (node.type === "TSInterfaceDeclaration" || node.type === "TSTypeAliasDeclaration") {
4694
+ if (node.type === import_utils28.AST_NODE_TYPES.TSInterfaceDeclaration || node.type === import_utils28.AST_NODE_TYPES.TSTypeAliasDeclaration) {
4501
4695
  reportMissingJSDoc(context, node);
4502
4696
  }
4503
4697
  },
4504
4698
  VariableDeclarator: (node) => {
4505
- if (!(0, import_ts_extras41.setHas)(kinds, "arrow-function") || node.id.type !== "Identifier" || node.init?.type !== "ArrowFunctionExpression" || node.parent.type !== "VariableDeclaration" || node.parent.kind !== "const") {
4699
+ if (!(0, import_ts_extras41.setHas)(kinds, "arrow-function") || node.id.type !== import_utils28.AST_NODE_TYPES.Identifier || node.init?.type !== import_utils28.AST_NODE_TYPES.ArrowFunctionExpression || node.parent.kind !== "const") {
4506
4700
  return;
4507
4701
  }
4508
4702
  reportMissingJSDoc(context, node.parent);
@@ -4696,9 +4890,10 @@ var rule67 = ruleCreator({
4696
4890
  var restrict_identifier_characters_default = rule67;
4697
4891
 
4698
4892
  // dist/rules/sort-array.js
4893
+ var import_utils29 = require("@typescript-eslint/utils");
4699
4894
  var import_ts_extras43 = require("ts-extras");
4700
4895
  var getSortableValue = (element) => {
4701
- if (element.type === "Literal") {
4896
+ if (element.type === import_utils29.AST_NODE_TYPES.Literal) {
4702
4897
  return String(element.value);
4703
4898
  }
4704
4899
  return void 0;
@@ -4794,12 +4989,13 @@ var rule69 = ruleCreator({
4794
4989
  var sort_call_signature_default = rule69;
4795
4990
 
4796
4991
  // dist/rules/sort-class-members.js
4992
+ var import_utils30 = require("@typescript-eslint/utils");
4797
4993
  var import_ts_extras44 = require("ts-extras");
4798
4994
  var memberName = (member) => {
4799
- if (member.key.type === "Identifier") {
4995
+ if (member.key.type === import_utils30.AST_NODE_TYPES.Identifier) {
4800
4996
  return member.key.name;
4801
4997
  }
4802
- if (member.key.type === "Literal" && typeof member.key.value === "string") {
4998
+ if (member.key.type === import_utils30.AST_NODE_TYPES.Literal && typeof member.key.value === "string") {
4803
4999
  return member.key.value;
4804
5000
  }
4805
5001
  return void 0;
@@ -4809,7 +5005,7 @@ var rule70 = ruleCreator({
4809
5005
  ClassBody: (node) => {
4810
5006
  let members = [];
4811
5007
  for (const member of node.body) {
4812
- if (member.type === "PropertyDefinition" || member.type === "MethodDefinition") {
5008
+ if (member.type === import_utils30.AST_NODE_TYPES.PropertyDefinition || member.type === import_utils30.AST_NODE_TYPES.MethodDefinition) {
4813
5009
  members = [...members, member];
4814
5010
  }
4815
5011
  }
@@ -4906,8 +5102,9 @@ var rule71 = ruleCreator({
4906
5102
  var sort_construct_signature_default = rule71;
4907
5103
 
4908
5104
  // dist/rules/sort-export-specifiers.js
5105
+ var import_utils31 = require("@typescript-eslint/utils");
4909
5106
  var import_ts_extras45 = require("ts-extras");
4910
- var toName = (specifier) => specifier.exported.type === "Identifier" ? specifier.exported.name : specifier.exported.value;
5107
+ var toName = (specifier) => specifier.exported.type === import_utils31.AST_NODE_TYPES.Identifier ? specifier.exported.name : specifier.exported.value;
4911
5108
  var buildFix3 = (fixer, node, sourceCode, sorted) => {
4912
5109
  const startRange = (0, import_ts_extras45.arrayFirst)(node.specifiers)?.range ?? node.range;
4913
5110
  const endRange = (0, import_ts_extras45.arrayLast)(node.specifiers)?.range ?? node.range;
@@ -4918,9 +5115,7 @@ var rule72 = ruleCreator({
4918
5115
  ExportNamedDeclaration: (node) => {
4919
5116
  let exportSpecifiers = [];
4920
5117
  for (const specifier of node.specifiers) {
4921
- if (specifier.type === "ExportSpecifier") {
4922
- exportSpecifiers = [...exportSpecifiers, specifier];
4923
- }
5118
+ exportSpecifiers = [...exportSpecifiers, specifier];
4924
5119
  }
4925
5120
  if (exportSpecifiers.length < 2) {
4926
5121
  return;
@@ -4959,12 +5154,13 @@ var rule72 = ruleCreator({
4959
5154
  var sort_export_specifiers_default = rule72;
4960
5155
 
4961
5156
  // dist/rules/sort-keys.js
5157
+ var import_utils32 = require("@typescript-eslint/utils");
4962
5158
  var import_ts_extras46 = require("ts-extras");
4963
5159
  var keyName = (property) => {
4964
- if (property.key.type === "Identifier") {
5160
+ if (property.key.type === import_utils32.AST_NODE_TYPES.Identifier) {
4965
5161
  return property.key.name;
4966
5162
  }
4967
- if (property.key.type === "Literal" && typeof property.key.value === "string") {
5163
+ if (property.key.type === import_utils32.AST_NODE_TYPES.Literal && typeof property.key.value === "string") {
4968
5164
  return property.key.value;
4969
5165
  }
4970
5166
  return void 0;
@@ -4983,7 +5179,7 @@ var rule73 = ruleCreator({
4983
5179
  ObjectExpression: (node) => {
4984
5180
  let properties = [];
4985
5181
  for (const property of node.properties) {
4986
- if (property.type === "Property" && property.kind === "init" && !property.computed) {
5182
+ if (property.type === import_utils32.AST_NODE_TYPES.Property && property.kind === "init" && !property.computed) {
4987
5183
  properties = [...properties, property];
4988
5184
  }
4989
5185
  }
@@ -5085,6 +5281,7 @@ var rule74 = ruleCreator({
5085
5281
  var sort_top_comments_default = rule74;
5086
5282
 
5087
5283
  // dist/rules/switch-case-spacing.js
5284
+ var import_utils33 = require("@typescript-eslint/utils");
5088
5285
  var import_ts_extras48 = require("ts-extras");
5089
5286
  var isValidCaseBody = (node) => {
5090
5287
  if (node.consequent.length === 0) {
@@ -5096,8 +5293,8 @@ var isValidCaseBody = (node) => {
5096
5293
  return true;
5097
5294
  }
5098
5295
  const startsOnFollowingLine = firstStatement.loc.start.line > node.loc.start.line;
5099
- const startsWithBlock = firstStatement.type === "BlockStatement";
5100
- const endsWithBreak = lastStatement.type === "BreakStatement" || startsWithBlock;
5296
+ const startsWithBlock = firstStatement.type === import_utils33.AST_NODE_TYPES.BlockStatement;
5297
+ const endsWithBreak = lastStatement.type === import_utils33.AST_NODE_TYPES.BreakStatement || startsWithBlock;
5101
5298
  return (startsOnFollowingLine || startsWithBlock) && endsWithBreak;
5102
5299
  };
5103
5300
  var rule75 = ruleCreator({
@@ -5157,9 +5354,9 @@ var hasExpectedBoundaryNewlines = (node) => {
5157
5354
  return first.startsWith("\n") && last.endsWith("\n");
5158
5355
  };
5159
5356
  var normalizeTemplate = (sourceText) => {
5160
- const lines = (0, import_ts_extras49.stringSplit)(sourceText.replaceAll(/\r\n?/gu, "\n"), "\n");
5357
+ const lines = (0, import_ts_extras49.stringSplit)(sourceText.replaceAll(/\r\n?/gv, "\n"), "\n");
5161
5358
  const contentLines = lines.slice(1, -1);
5162
- const indents = contentLines.filter((line) => line.trim().length > 0).map((line) => /^\s*/u.exec(line)?.[0].length ?? 0);
5359
+ const indents = contentLines.filter((line) => line.trim().length > 0).map((line) => /^\s*/v.exec(line)?.[0].length ?? 0);
5163
5360
  const minIndent = (0, import_ts_extras49.isEmpty)(indents) ? 0 : Math.min(...indents);
5164
5361
  const normalizedContent = (0, import_ts_extras49.arrayJoin)(contentLines.map((line) => line.length >= minIndent ? line.slice(minIndent) : line).map((line) => ` ${line}`), "\n");
5165
5362
  const lastLine = (0, import_ts_extras49.arrayLast)(lines) ?? "";
@@ -5209,22 +5406,22 @@ var template_literal_format_default = rule76;
5209
5406
 
5210
5407
  // dist/rules/throw-error.js
5211
5408
  var import_type_utils6 = require("@typescript-eslint/type-utils");
5212
- var import_utils9 = require("@typescript-eslint/utils");
5409
+ var import_utils34 = require("@typescript-eslint/utils");
5213
5410
  var import_ts_extras50 = require("ts-extras");
5214
5411
  var tsutils3 = __toESM(require("tsutils"), 1);
5215
5412
  var isAllowedThrowableVariant = (type, program) => (0, import_type_utils6.isTypeAnyType)(type) || (0, import_type_utils6.isTypeUnknownType)(type) || (0, import_type_utils6.isErrorLike)(program, type);
5216
5413
  var couldBeAllowedThrowableType = (type, program) => tsutils3.unionTypeParts(type).every((typeVariant) => isAllowedThrowableVariant(typeVariant, program));
5217
5414
  var couldBePromiseConstructorType = (type, program) => tsutils3.unionTypeParts(type).some((typeVariant) => (0, import_type_utils6.isBuiltinSymbolLike)(program, typeVariant, "PromiseConstructor"));
5218
- var isPromiseIdentifier = (node) => node.type === "Identifier" && node.name === "Promise";
5415
+ var isPromiseIdentifier = (node) => node.type === import_utils34.AST_NODE_TYPES.Identifier && node.name === "Promise";
5219
5416
  var createWrapLiteralInErrorSuggestionFix = (sourceCode, node) => {
5220
- if (node.type !== "Literal") {
5417
+ if (node.type !== import_utils34.AST_NODE_TYPES.Literal) {
5221
5418
  return void 0;
5222
5419
  }
5223
5420
  return (fixer) => fixer.replaceText(node, `new Error(${sourceCode.getText(node)})`);
5224
5421
  };
5225
5422
  var rule77 = ruleCreator({
5226
5423
  create: (context) => {
5227
- const parserServices = import_utils9.ESLintUtils.getParserServices(context);
5424
+ const parserServices = import_utils34.ESLintUtils.getParserServices(context);
5228
5425
  const sourceCode = context.sourceCode;
5229
5426
  const { program } = parserServices;
5230
5427
  const reportIfNonErrorLike = (node, usage) => {
@@ -5257,7 +5454,7 @@ var rule77 = ruleCreator({
5257
5454
  return {
5258
5455
  "CallExpression[callee.type='MemberExpression'][callee.property.type='Identifier'][callee.property.name='reject']": (callExpression) => {
5259
5456
  const { callee } = callExpression;
5260
- if (callee.type !== "MemberExpression" || callee.object.type === "Super") {
5457
+ if (callee.type !== import_utils34.AST_NODE_TYPES.MemberExpression || callee.object.type === import_utils34.AST_NODE_TYPES.Super) {
5261
5458
  return;
5262
5459
  }
5263
5460
  const objectType = (0, import_type_utils6.getConstrainedTypeAtLocation)(parserServices, callee.object);
@@ -5268,7 +5465,7 @@ var rule77 = ruleCreator({
5268
5465
  },
5269
5466
  "NewExpression[callee.type='Identifier'][callee.name='Promise'] > ArrowFunctionExpression, NewExpression[callee.type='Identifier'][callee.name='Promise'] > FunctionExpression": (callback) => {
5270
5467
  const rejectParameter = callback.params[1];
5271
- if (rejectParameter?.type !== "Identifier") {
5468
+ if (rejectParameter?.type !== import_utils34.AST_NODE_TYPES.Identifier) {
5272
5469
  return;
5273
5470
  }
5274
5471
  const rejectVariable = (0, import_ts_extras50.arrayFirst)(context.sourceCode.getDeclaredVariables(callback).filter((declaredVariable) => declaredVariable.name === rejectParameter.name));
@@ -5278,16 +5475,13 @@ var rule77 = ruleCreator({
5278
5475
  for (const reference of rejectVariable.references) {
5279
5476
  const { identifier } = reference;
5280
5477
  const parent = identifier.parent;
5281
- if (parent?.type === "CallExpression" && parent.callee === identifier) {
5478
+ if (parent.type === import_utils34.AST_NODE_TYPES.CallExpression && parent.callee === identifier) {
5282
5479
  checkRejectionCall(parent);
5283
5480
  }
5284
5481
  }
5285
5482
  },
5286
5483
  ThrowStatement: (throwStatement) => {
5287
5484
  const { argument } = throwStatement;
5288
- if (argument === null) {
5289
- return;
5290
- }
5291
5485
  reportIfNonErrorLike(argument, "Throwing");
5292
5486
  }
5293
5487
  };
@@ -5337,7 +5531,7 @@ var throw_new_error_default = deprecatedRule21;
5337
5531
 
5338
5532
  // dist/rules/typescript-array-callback-return-type.js
5339
5533
  var import_type_utils7 = require("@typescript-eslint/type-utils");
5340
- var import_utils10 = require("@typescript-eslint/utils");
5534
+ var import_utils35 = require("@typescript-eslint/utils");
5341
5535
  var import_ts_extras51 = require("ts-extras");
5342
5536
  var arrayCallbackMethodNames = /* @__PURE__ */ new Set([
5343
5537
  "every",
@@ -5359,19 +5553,19 @@ var isArrayLikeType2 = (typeChecker, type) => {
5359
5553
  var isFirstCallbackArgument = (callExpression, callback) => (0, import_ts_extras51.arrayFirst)(callExpression.arguments) === callback;
5360
5554
  var rule79 = ruleCreator({
5361
5555
  create: (context) => {
5362
- const parserServices = import_utils10.ESLintUtils.getParserServices(context);
5556
+ const parserServices = import_utils35.ESLintUtils.getParserServices(context);
5363
5557
  const typeChecker = parserServices.program.getTypeChecker();
5364
5558
  return {
5365
5559
  [callbackSelector]: (callback) => {
5366
5560
  const parentNode = callback.parent;
5367
- if (parentNode?.type !== "CallExpression") {
5561
+ if (parentNode.type !== import_utils35.AST_NODE_TYPES.CallExpression) {
5368
5562
  return;
5369
5563
  }
5370
5564
  if (!isFirstCallbackArgument(parentNode, callback)) {
5371
5565
  return;
5372
5566
  }
5373
5567
  const { callee } = parentNode;
5374
- if (callee.type !== "MemberExpression" || callee.object.type === "Super" || callee.property.type !== "Identifier" || !(0, import_ts_extras51.setHas)(arrayCallbackMethodNames, callee.property.name)) {
5568
+ if (callee.type !== import_utils35.AST_NODE_TYPES.MemberExpression || callee.object.type === import_utils35.AST_NODE_TYPES.Super || callee.property.type !== import_utils35.AST_NODE_TYPES.Identifier || !(0, import_ts_extras51.setHas)(arrayCallbackMethodNames, callee.property.name)) {
5375
5569
  return;
5376
5570
  }
5377
5571
  const objectType = (0, import_type_utils7.getConstrainedTypeAtLocation)(parserServices, callee.object);
@@ -5407,6 +5601,7 @@ var rule79 = ruleCreator({
5407
5601
  var typescript_array_callback_return_type_default = rule79;
5408
5602
 
5409
5603
  // dist/rules/typescript-class-methods-use-this.js
5604
+ var import_utils36 = require("@typescript-eslint/utils");
5410
5605
  var import_ts_extras52 = require("ts-extras");
5411
5606
  var isNode = (value) => typeof value === "object" && value !== null && (0, import_ts_extras52.objectHasOwn)(value, "type");
5412
5607
  var collectNodeChildren = (node) => {
@@ -5438,7 +5633,7 @@ var containsThisExpression = (root) => {
5438
5633
  if (node === void 0) {
5439
5634
  continue;
5440
5635
  }
5441
- if (node.type === "ThisExpression") {
5636
+ if (node.type === import_utils36.AST_NODE_TYPES.ThisExpression) {
5442
5637
  return true;
5443
5638
  }
5444
5639
  stack = [...stack, ...collectNodeChildren(node)];
@@ -5447,7 +5642,7 @@ var containsThisExpression = (root) => {
5447
5642
  };
5448
5643
  var hasThisParameter = (node) => {
5449
5644
  const [firstParameter] = node.value.params;
5450
- return firstParameter?.type === "Identifier" && firstParameter.name === "this";
5645
+ return firstParameter?.type === import_utils36.AST_NODE_TYPES.Identifier && firstParameter.name === "this";
5451
5646
  };
5452
5647
  var usesThisExpression = (node) => node.value.body === null ? false : containsThisExpression(node.value.body);
5453
5648
  var shouldSkipMethod = (node) => node.kind !== "method" || node.static || node.value.body === null || hasThisParameter(node) || usesThisExpression(node);
@@ -5609,6 +5804,7 @@ var deprecatedRule23 = withDeprecatedRuleLifecycle(rule83, {
5609
5804
  var typescript_exhaustive_switch_default = deprecatedRule23;
5610
5805
 
5611
5806
  // dist/rules/typescript-no-boolean-literal-type.js
5807
+ var import_utils37 = require("@typescript-eslint/utils");
5612
5808
  var import_ts_extras53 = require("ts-extras");
5613
5809
  var selector8 = (0, import_ts_extras53.arrayJoin)([
5614
5810
  "TSPropertySignature[optional=true] > TSTypeAnnotation > TSLiteralType > Literal[value=true]",
@@ -5617,7 +5813,7 @@ var selector8 = (0, import_ts_extras53.arrayJoin)([
5617
5813
  var rule84 = ruleCreator({
5618
5814
  create: (context) => ({
5619
5815
  [selector8]: (node) => {
5620
- if (node.type !== "Literal") {
5816
+ if (node.type !== import_utils37.AST_NODE_TYPES.Literal) {
5621
5817
  return;
5622
5818
  }
5623
5819
  context.report({
@@ -5841,11 +6037,11 @@ var typescript_no_multi_type_tuples_default = rule89;
5841
6037
 
5842
6038
  // dist/rules/typescript-no-never.js
5843
6039
  var import_type_utils8 = require("@typescript-eslint/type-utils");
5844
- var import_utils11 = require("@typescript-eslint/utils");
5845
- var isTypeAliasNeverIdentifier = (node) => node.parent.type === "TSTypeAliasDeclaration" && node.parent.id === node && node.parent.typeAnnotation.type === "TSNeverKeyword";
6040
+ var import_utils38 = require("@typescript-eslint/utils");
6041
+ var isTypeAliasNeverIdentifier = (node) => node.parent.type === import_utils38.AST_NODE_TYPES.TSTypeAliasDeclaration && node.parent.id === node && node.parent.typeAnnotation.type === import_utils38.AST_NODE_TYPES.TSNeverKeyword;
5846
6042
  var rule90 = ruleCreator({
5847
6043
  create: (context) => {
5848
- const parserServices = import_utils11.ESLintUtils.getParserServices(context);
6044
+ const parserServices = import_utils38.ESLintUtils.getParserServices(context);
5849
6045
  return {
5850
6046
  Identifier: (node) => {
5851
6047
  if (isTypeAliasNeverIdentifier(node)) {
@@ -5884,11 +6080,12 @@ var rule90 = ruleCreator({
5884
6080
  var typescript_no_never_default = rule90;
5885
6081
 
5886
6082
  // dist/rules/typescript-no-redundant-undefined-const.js
6083
+ var import_utils39 = require("@typescript-eslint/utils");
5887
6084
  var import_ts_extras55 = require("ts-extras");
5888
6085
  var buildFixedTypeText = (sourceCode, unionType) => {
5889
6086
  let nonUndefinedTypeTexts = [];
5890
6087
  for (const typeNode of unionType.types) {
5891
- if (typeNode.type === "TSUndefinedKeyword") {
6088
+ if (typeNode.type === import_utils39.AST_NODE_TYPES.TSUndefinedKeyword) {
5892
6089
  continue;
5893
6090
  }
5894
6091
  nonUndefinedTypeTexts = [
@@ -5901,42 +6098,37 @@ var buildFixedTypeText = (sourceCode, unionType) => {
5901
6098
  }
5902
6099
  return (0, import_ts_extras55.arrayJoin)(nonUndefinedTypeTexts, " | ");
5903
6100
  };
5904
- var getTypeAnnotationFromDeclarator = (declarator) => {
5905
- if (declarator.id.type === "Identifier" || declarator.id.type === "ArrayPattern" || declarator.id.type === "ObjectPattern") {
5906
- return declarator.id.typeAnnotation;
5907
- }
5908
- return void 0;
5909
- };
6101
+ var getTypeAnnotationFromDeclarator = (declarator) => declarator.id.typeAnnotation;
5910
6102
  var unwrapExpression2 = (expression) => {
5911
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6103
+ if (expression.type === import_utils39.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils39.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils39.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils39.AST_NODE_TYPES.TSTypeAssertion) {
5912
6104
  return unwrapExpression2(expression.expression);
5913
6105
  }
5914
6106
  return expression;
5915
6107
  };
5916
6108
  var isDefinitelyDefinedExpression = (expression) => {
5917
6109
  const unwrappedExpression = unwrapExpression2(expression);
5918
- if (unwrappedExpression.type === "ArrayExpression") {
6110
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.ArrayExpression) {
5919
6111
  return true;
5920
6112
  }
5921
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6113
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.ArrowFunctionExpression) {
5922
6114
  return true;
5923
6115
  }
5924
- if (unwrappedExpression.type === "ClassExpression") {
6116
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.ClassExpression) {
5925
6117
  return true;
5926
6118
  }
5927
- if (unwrappedExpression.type === "FunctionExpression") {
6119
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.FunctionExpression) {
5928
6120
  return true;
5929
6121
  }
5930
- if (unwrappedExpression.type === "Literal") {
6122
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.Literal) {
5931
6123
  return true;
5932
6124
  }
5933
- if (unwrappedExpression.type === "NewExpression") {
6125
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.NewExpression) {
5934
6126
  return true;
5935
6127
  }
5936
- if (unwrappedExpression.type === "ObjectExpression") {
6128
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.ObjectExpression) {
5937
6129
  return true;
5938
6130
  }
5939
- if (unwrappedExpression.type === "TemplateLiteral") {
6131
+ if (unwrappedExpression.type === import_utils39.AST_NODE_TYPES.TemplateLiteral) {
5940
6132
  return true;
5941
6133
  }
5942
6134
  return false;
@@ -5946,7 +6138,7 @@ var rule91 = ruleCreator({
5946
6138
  const sourceCode = context.sourceCode;
5947
6139
  return {
5948
6140
  'VariableDeclaration[kind="const"] > VariableDeclarator': (node) => {
5949
- if (node.type !== "VariableDeclarator") {
6141
+ if (node.type !== import_utils39.AST_NODE_TYPES.VariableDeclarator) {
5950
6142
  return;
5951
6143
  }
5952
6144
  if (node.init === null) {
@@ -5959,7 +6151,7 @@ var rule91 = ruleCreator({
5959
6151
  if (typeAnnotation === void 0) {
5960
6152
  return;
5961
6153
  }
5962
- if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
6154
+ if (typeAnnotation.typeAnnotation.type !== import_utils39.AST_NODE_TYPES.TSUnionType) {
5963
6155
  return;
5964
6156
  }
5965
6157
  const fixedTypeText = buildFixedTypeText(sourceCode, typeAnnotation.typeAnnotation);
@@ -6004,65 +6196,61 @@ var rule91 = ruleCreator({
6004
6196
  var typescript_no_redundant_undefined_const_default = rule91;
6005
6197
 
6006
6198
  // dist/rules/typescript-no-redundant-undefined-default-parameter.js
6199
+ var import_utils40 = require("@typescript-eslint/utils");
6007
6200
  var import_ts_extras56 = require("ts-extras");
6008
6201
  var functionLikeNodeSelector = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
6009
6202
  var getParametersFromFunctionLikeNode = (node) => {
6010
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
6203
+ if (node.type === import_utils40.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils40.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils40.AST_NODE_TYPES.FunctionExpression || node.type === import_utils40.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils40.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils40.AST_NODE_TYPES.TSConstructorType || node.type === import_utils40.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils40.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils40.AST_NODE_TYPES.TSFunctionType || node.type === import_utils40.AST_NODE_TYPES.TSMethodSignature) {
6011
6204
  return node.params;
6012
6205
  }
6013
6206
  return void 0;
6014
6207
  };
6015
6208
  var getAssignmentPatternFromPattern = (pattern) => {
6016
- if (pattern.type === "AssignmentPattern") {
6209
+ if (pattern.type === import_utils40.AST_NODE_TYPES.AssignmentPattern) {
6017
6210
  return pattern;
6018
6211
  }
6019
- if (pattern.type === "RestElement") {
6212
+ if (pattern.type === import_utils40.AST_NODE_TYPES.RestElement) {
6020
6213
  return void 0;
6021
6214
  }
6022
6215
  return void 0;
6023
6216
  };
6024
6217
  var getAssignmentPatternFromParameter = (parameter) => {
6025
- if (parameter.type === "TSParameterProperty") {
6218
+ if (parameter.type === import_utils40.AST_NODE_TYPES.TSParameterProperty) {
6026
6219
  return getAssignmentPatternFromPattern(parameter.parameter);
6027
6220
  }
6028
6221
  return getAssignmentPatternFromPattern(parameter);
6029
6222
  };
6030
- var getTypeAnnotationFromAssignmentPattern = (assignmentPattern) => {
6031
- if (assignmentPattern.left.type !== "ArrayPattern" && assignmentPattern.left.type !== "Identifier" && assignmentPattern.left.type !== "ObjectPattern") {
6032
- return void 0;
6033
- }
6034
- return assignmentPattern.left.typeAnnotation;
6035
- };
6223
+ var getTypeAnnotationFromAssignmentPattern = (assignmentPattern) => assignmentPattern.left.typeAnnotation;
6036
6224
  var unwrapExpression3 = (expression) => {
6037
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6225
+ if (expression.type === import_utils40.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils40.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils40.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils40.AST_NODE_TYPES.TSTypeAssertion) {
6038
6226
  return unwrapExpression3(expression.expression);
6039
6227
  }
6040
6228
  return expression;
6041
6229
  };
6042
6230
  var isDefinitelyDefinedExpression2 = (expression) => {
6043
6231
  const unwrappedExpression = unwrapExpression3(expression);
6044
- if (unwrappedExpression.type === "ArrayExpression") {
6232
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.ArrayExpression) {
6045
6233
  return true;
6046
6234
  }
6047
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6235
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.ArrowFunctionExpression) {
6048
6236
  return true;
6049
6237
  }
6050
- if (unwrappedExpression.type === "ClassExpression") {
6238
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.ClassExpression) {
6051
6239
  return true;
6052
6240
  }
6053
- if (unwrappedExpression.type === "FunctionExpression") {
6241
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.FunctionExpression) {
6054
6242
  return true;
6055
6243
  }
6056
- if (unwrappedExpression.type === "Literal") {
6244
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.Literal) {
6057
6245
  return true;
6058
6246
  }
6059
- if (unwrappedExpression.type === "NewExpression") {
6247
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.NewExpression) {
6060
6248
  return true;
6061
6249
  }
6062
- if (unwrappedExpression.type === "ObjectExpression") {
6250
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.ObjectExpression) {
6063
6251
  return true;
6064
6252
  }
6065
- if (unwrappedExpression.type === "TemplateLiteral") {
6253
+ if (unwrappedExpression.type === import_utils40.AST_NODE_TYPES.TemplateLiteral) {
6066
6254
  return true;
6067
6255
  }
6068
6256
  return false;
@@ -6070,7 +6258,7 @@ var isDefinitelyDefinedExpression2 = (expression) => {
6070
6258
  var buildFixedTypeText2 = (sourceCode, unionType) => {
6071
6259
  let nonUndefinedTypeTexts = [];
6072
6260
  for (const typeNode of unionType.types) {
6073
- if (typeNode.type === "TSUndefinedKeyword") {
6261
+ if (typeNode.type === import_utils40.AST_NODE_TYPES.TSUndefinedKeyword) {
6074
6262
  continue;
6075
6263
  }
6076
6264
  nonUndefinedTypeTexts = [
@@ -6083,6 +6271,10 @@ var buildFixedTypeText2 = (sourceCode, unionType) => {
6083
6271
  }
6084
6272
  return (0, import_ts_extras56.arrayJoin)(nonUndefinedTypeTexts, " | ");
6085
6273
  };
6274
+ var createReplaceTypeFix = (targetNode, replacementText) => (fixer) => {
6275
+ const [start, end] = targetNode.range;
6276
+ return fixer.replaceTextRange([start, end], replacementText);
6277
+ };
6086
6278
  var rule92 = ruleCreator({
6087
6279
  create: (context) => {
6088
6280
  const sourceCode = context.sourceCode;
@@ -6104,14 +6296,14 @@ var rule92 = ruleCreator({
6104
6296
  if (typeAnnotation === void 0) {
6105
6297
  continue;
6106
6298
  }
6107
- if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
6299
+ if (typeAnnotation.typeAnnotation.type !== import_utils40.AST_NODE_TYPES.TSUnionType) {
6108
6300
  continue;
6109
6301
  }
6110
6302
  const fixedTypeText = buildFixedTypeText2(sourceCode, typeAnnotation.typeAnnotation);
6111
6303
  if (!(0, import_ts_extras56.isDefined)(fixedTypeText)) {
6112
6304
  continue;
6113
6305
  }
6114
- const fix = (fixer) => fixer.replaceText(typeAnnotation.typeAnnotation, fixedTypeText);
6306
+ const fix = createReplaceTypeFix(typeAnnotation.typeAnnotation, fixedTypeText);
6115
6307
  context.report({
6116
6308
  fix,
6117
6309
  messageId: "forbidden",
@@ -6150,11 +6342,12 @@ var rule92 = ruleCreator({
6150
6342
  var typescript_no_redundant_undefined_default_parameter_default = rule92;
6151
6343
 
6152
6344
  // dist/rules/typescript-no-redundant-undefined-let.js
6345
+ var import_utils41 = require("@typescript-eslint/utils");
6153
6346
  var import_ts_extras57 = require("ts-extras");
6154
6347
  var buildFixedTypeText3 = (sourceCode, unionType) => {
6155
6348
  let nonUndefinedTypeTexts = [];
6156
6349
  for (const typeNode of unionType.types) {
6157
- if (typeNode.type === "TSUndefinedKeyword") {
6350
+ if (typeNode.type === import_utils41.AST_NODE_TYPES.TSUndefinedKeyword) {
6158
6351
  continue;
6159
6352
  }
6160
6353
  nonUndefinedTypeTexts = [
@@ -6168,35 +6361,35 @@ var buildFixedTypeText3 = (sourceCode, unionType) => {
6168
6361
  return (0, import_ts_extras57.arrayJoin)(nonUndefinedTypeTexts, " | ");
6169
6362
  };
6170
6363
  var unwrapExpression4 = (expression) => {
6171
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6364
+ if (expression.type === import_utils41.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils41.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils41.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils41.AST_NODE_TYPES.TSTypeAssertion) {
6172
6365
  return unwrapExpression4(expression.expression);
6173
6366
  }
6174
6367
  return expression;
6175
6368
  };
6176
6369
  var isDefinitelyDefinedExpression3 = (expression) => {
6177
6370
  const unwrappedExpression = unwrapExpression4(expression);
6178
- if (unwrappedExpression.type === "ArrayExpression") {
6371
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.ArrayExpression) {
6179
6372
  return true;
6180
6373
  }
6181
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6374
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.ArrowFunctionExpression) {
6182
6375
  return true;
6183
6376
  }
6184
- if (unwrappedExpression.type === "ClassExpression") {
6377
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.ClassExpression) {
6185
6378
  return true;
6186
6379
  }
6187
- if (unwrappedExpression.type === "FunctionExpression") {
6380
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.FunctionExpression) {
6188
6381
  return true;
6189
6382
  }
6190
- if (unwrappedExpression.type === "Literal") {
6383
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.Literal) {
6191
6384
  return true;
6192
6385
  }
6193
- if (unwrappedExpression.type === "NewExpression") {
6386
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.NewExpression) {
6194
6387
  return true;
6195
6388
  }
6196
- if (unwrappedExpression.type === "ObjectExpression") {
6389
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.ObjectExpression) {
6197
6390
  return true;
6198
6391
  }
6199
- if (unwrappedExpression.type === "TemplateLiteral") {
6392
+ if (unwrappedExpression.type === import_utils41.AST_NODE_TYPES.TemplateLiteral) {
6200
6393
  return true;
6201
6394
  }
6202
6395
  return false;
@@ -6224,14 +6417,14 @@ var rule93 = ruleCreator({
6224
6417
  return;
6225
6418
  }
6226
6419
  const id = node.id;
6227
- if (id.type !== "Identifier") {
6420
+ if (id.type !== import_utils41.AST_NODE_TYPES.Identifier) {
6228
6421
  return;
6229
6422
  }
6230
6423
  const typeAnnotation = id.typeAnnotation;
6231
6424
  if (typeAnnotation === void 0) {
6232
6425
  return;
6233
6426
  }
6234
- if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
6427
+ if (typeAnnotation.typeAnnotation.type !== import_utils41.AST_NODE_TYPES.TSUnionType) {
6235
6428
  return;
6236
6429
  }
6237
6430
  const fixedTypeText = buildFixedTypeText3(sourceCode, typeAnnotation.typeAnnotation);
@@ -6276,6 +6469,7 @@ var rule93 = ruleCreator({
6276
6469
  var typescript_no_redundant_undefined_let_default = rule93;
6277
6470
 
6278
6471
  // dist/rules/typescript-no-redundant-undefined-optional.js
6472
+ var import_utils42 = require("@typescript-eslint/utils");
6279
6473
  var import_ts_extras58 = require("ts-extras");
6280
6474
  var selector14 = (0, import_ts_extras58.arrayJoin)([
6281
6475
  "Identifier[optional=true] > TSTypeAnnotation > TSUnionType",
@@ -6285,7 +6479,7 @@ var selector14 = (0, import_ts_extras58.arrayJoin)([
6285
6479
  var buildFixedTypeText4 = (sourceCode, unionType) => {
6286
6480
  let nonUndefinedTypeTexts = [];
6287
6481
  for (const typeNode of unionType.types) {
6288
- if (typeNode.type === "TSUndefinedKeyword") {
6482
+ if (typeNode.type === import_utils42.AST_NODE_TYPES.TSUndefinedKeyword) {
6289
6483
  continue;
6290
6484
  }
6291
6485
  nonUndefinedTypeTexts = [
@@ -6303,7 +6497,7 @@ var rule94 = ruleCreator({
6303
6497
  const sourceCode = context.sourceCode;
6304
6498
  return {
6305
6499
  [selector14]: (node) => {
6306
- if (node.type !== "TSUnionType") {
6500
+ if (node.type !== import_utils42.AST_NODE_TYPES.TSUnionType) {
6307
6501
  return;
6308
6502
  }
6309
6503
  const fixedTypeText = buildFixedTypeText4(sourceCode, node);
@@ -6348,11 +6542,12 @@ var rule94 = ruleCreator({
6348
6542
  var typescript_no_redundant_undefined_optional_default = rule94;
6349
6543
 
6350
6544
  // dist/rules/typescript-no-redundant-undefined-promise-return-type.js
6545
+ var import_utils43 = require("@typescript-eslint/utils");
6351
6546
  var import_ts_extras59 = require("ts-extras");
6352
6547
  var buildFixedTypeText5 = (sourceCode, unionType) => {
6353
6548
  let nonUndefinedTypeTexts = [];
6354
6549
  for (const typeNode of unionType.types) {
6355
- if (typeNode.type === "TSUndefinedKeyword") {
6550
+ if (typeNode.type === import_utils43.AST_NODE_TYPES.TSUndefinedKeyword) {
6356
6551
  continue;
6357
6552
  }
6358
6553
  nonUndefinedTypeTexts = [
@@ -6366,52 +6561,52 @@ var buildFixedTypeText5 = (sourceCode, unionType) => {
6366
6561
  return (0, import_ts_extras59.arrayJoin)(nonUndefinedTypeTexts, " | ");
6367
6562
  };
6368
6563
  var unwrapExpression5 = (expression) => {
6369
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6564
+ if (expression.type === import_utils43.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils43.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils43.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils43.AST_NODE_TYPES.TSTypeAssertion) {
6370
6565
  return unwrapExpression5(expression.expression);
6371
6566
  }
6372
6567
  return expression;
6373
6568
  };
6374
6569
  var isDefinitelyDefinedExpression4 = (expression) => {
6375
6570
  const unwrappedExpression = unwrapExpression5(expression);
6376
- if (unwrappedExpression.type === "ArrayExpression") {
6571
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.ArrayExpression) {
6377
6572
  return true;
6378
6573
  }
6379
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6574
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.ArrowFunctionExpression) {
6380
6575
  return true;
6381
6576
  }
6382
- if (unwrappedExpression.type === "ClassExpression") {
6577
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.ClassExpression) {
6383
6578
  return true;
6384
6579
  }
6385
- if (unwrappedExpression.type === "ConditionalExpression") {
6580
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.ConditionalExpression) {
6386
6581
  return isDefinitelyDefinedExpression4(unwrappedExpression.consequent) && isDefinitelyDefinedExpression4(unwrappedExpression.alternate);
6387
6582
  }
6388
- if (unwrappedExpression.type === "FunctionExpression") {
6583
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.FunctionExpression) {
6389
6584
  return true;
6390
6585
  }
6391
- if (unwrappedExpression.type === "Literal") {
6586
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.Literal) {
6392
6587
  return true;
6393
6588
  }
6394
- if (unwrappedExpression.type === "LogicalExpression" && unwrappedExpression.operator === "??") {
6589
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.LogicalExpression && unwrappedExpression.operator === "??") {
6395
6590
  return isDefinitelyDefinedExpression4(unwrappedExpression.right);
6396
6591
  }
6397
- if (unwrappedExpression.type === "NewExpression") {
6592
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.NewExpression) {
6398
6593
  return true;
6399
6594
  }
6400
- if (unwrappedExpression.type === "ObjectExpression") {
6595
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.ObjectExpression) {
6401
6596
  return true;
6402
6597
  }
6403
- if (unwrappedExpression.type === "SequenceExpression") {
6598
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.SequenceExpression) {
6404
6599
  const lastExpression = (0, import_ts_extras59.arrayAt)(unwrappedExpression.expressions, -1);
6405
6600
  return lastExpression !== void 0 && isDefinitelyDefinedExpression4(lastExpression);
6406
6601
  }
6407
- if (unwrappedExpression.type === "TemplateLiteral") {
6602
+ if (unwrappedExpression.type === import_utils43.AST_NODE_TYPES.TemplateLiteral) {
6408
6603
  return true;
6409
6604
  }
6410
6605
  return false;
6411
6606
  };
6412
6607
  var hasDefinitelyDefinedReturnValue = (node) => {
6413
6608
  const body = node.body;
6414
- if (body.type !== "BlockStatement") {
6609
+ if (body.type !== import_utils43.AST_NODE_TYPES.BlockStatement) {
6415
6610
  return isDefinitelyDefinedExpression4(body);
6416
6611
  }
6417
6612
  if (body.body.length !== 1) {
@@ -6421,7 +6616,7 @@ var hasDefinitelyDefinedReturnValue = (node) => {
6421
6616
  if (statement === void 0) {
6422
6617
  return false;
6423
6618
  }
6424
- if (statement.type !== "ReturnStatement") {
6619
+ if (statement.type !== import_utils43.AST_NODE_TYPES.ReturnStatement) {
6425
6620
  return false;
6426
6621
  }
6427
6622
  if (statement.argument === null) {
@@ -6431,10 +6626,10 @@ var hasDefinitelyDefinedReturnValue = (node) => {
6431
6626
  };
6432
6627
  var getPromiseValueUnionType = (returnType) => {
6433
6628
  const annotation = returnType.typeAnnotation;
6434
- if (annotation.type !== "TSTypeReference") {
6629
+ if (annotation.type !== import_utils43.AST_NODE_TYPES.TSTypeReference) {
6435
6630
  return void 0;
6436
6631
  }
6437
- if (annotation.typeName.type !== "Identifier") {
6632
+ if (annotation.typeName.type !== import_utils43.AST_NODE_TYPES.Identifier) {
6438
6633
  return void 0;
6439
6634
  }
6440
6635
  if (annotation.typeName.name !== "Promise") {
@@ -6448,7 +6643,7 @@ var getPromiseValueUnionType = (returnType) => {
6448
6643
  if (promiseValueType === void 0) {
6449
6644
  return void 0;
6450
6645
  }
6451
- if (promiseValueType.type !== "TSUnionType") {
6646
+ if (promiseValueType.type !== import_utils43.AST_NODE_TYPES.TSUnionType) {
6452
6647
  return void 0;
6453
6648
  }
6454
6649
  return promiseValueType;
@@ -6458,7 +6653,7 @@ var rule95 = ruleCreator({
6458
6653
  const sourceCode = context.sourceCode;
6459
6654
  return {
6460
6655
  ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)[async=true]": (node) => {
6461
- if (node.type !== "ArrowFunctionExpression" && node.type !== "FunctionDeclaration" && node.type !== "FunctionExpression") {
6656
+ if (node.type !== import_utils43.AST_NODE_TYPES.ArrowFunctionExpression && node.type !== import_utils43.AST_NODE_TYPES.FunctionDeclaration && node.type !== import_utils43.AST_NODE_TYPES.FunctionExpression) {
6462
6657
  return;
6463
6658
  }
6464
6659
  const returnType = node.returnType;
@@ -6514,11 +6709,12 @@ var rule95 = ruleCreator({
6514
6709
  var typescript_no_redundant_undefined_promise_return_type_default = rule95;
6515
6710
 
6516
6711
  // dist/rules/typescript-no-redundant-undefined-readonly-property.js
6712
+ var import_utils44 = require("@typescript-eslint/utils");
6517
6713
  var import_ts_extras60 = require("ts-extras");
6518
6714
  var buildFixedTypeText6 = (sourceCode, unionType) => {
6519
6715
  let nonUndefinedTypeTexts = [];
6520
6716
  for (const typeNode of unionType.types) {
6521
- if (typeNode.type === "TSUndefinedKeyword") {
6717
+ if (typeNode.type === import_utils44.AST_NODE_TYPES.TSUndefinedKeyword) {
6522
6718
  continue;
6523
6719
  }
6524
6720
  nonUndefinedTypeTexts = [
@@ -6532,35 +6728,35 @@ var buildFixedTypeText6 = (sourceCode, unionType) => {
6532
6728
  return (0, import_ts_extras60.arrayJoin)(nonUndefinedTypeTexts, " | ");
6533
6729
  };
6534
6730
  var unwrapExpression6 = (expression) => {
6535
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6731
+ if (expression.type === import_utils44.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils44.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils44.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils44.AST_NODE_TYPES.TSTypeAssertion) {
6536
6732
  return unwrapExpression6(expression.expression);
6537
6733
  }
6538
6734
  return expression;
6539
6735
  };
6540
6736
  var isDefinitelyDefinedExpression5 = (expression) => {
6541
6737
  const unwrappedExpression = unwrapExpression6(expression);
6542
- if (unwrappedExpression.type === "ArrayExpression") {
6738
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.ArrayExpression) {
6543
6739
  return true;
6544
6740
  }
6545
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6741
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.ArrowFunctionExpression) {
6546
6742
  return true;
6547
6743
  }
6548
- if (unwrappedExpression.type === "ClassExpression") {
6744
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.ClassExpression) {
6549
6745
  return true;
6550
6746
  }
6551
- if (unwrappedExpression.type === "FunctionExpression") {
6747
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.FunctionExpression) {
6552
6748
  return true;
6553
6749
  }
6554
- if (unwrappedExpression.type === "Literal") {
6750
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.Literal) {
6555
6751
  return true;
6556
6752
  }
6557
- if (unwrappedExpression.type === "NewExpression") {
6753
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.NewExpression) {
6558
6754
  return true;
6559
6755
  }
6560
- if (unwrappedExpression.type === "ObjectExpression") {
6756
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.ObjectExpression) {
6561
6757
  return true;
6562
6758
  }
6563
- if (unwrappedExpression.type === "TemplateLiteral") {
6759
+ if (unwrappedExpression.type === import_utils44.AST_NODE_TYPES.TemplateLiteral) {
6564
6760
  return true;
6565
6761
  }
6566
6762
  return false;
@@ -6570,7 +6766,7 @@ var rule96 = ruleCreator({
6570
6766
  const sourceCode = context.sourceCode;
6571
6767
  return {
6572
6768
  "PropertyDefinition[readonly=true][optional!=true]": (node) => {
6573
- if (node.type !== "PropertyDefinition") {
6769
+ if (node.type !== import_utils44.AST_NODE_TYPES.PropertyDefinition) {
6574
6770
  return;
6575
6771
  }
6576
6772
  if (node.declare) {
@@ -6586,7 +6782,7 @@ var rule96 = ruleCreator({
6586
6782
  if (typeAnnotation === void 0) {
6587
6783
  return;
6588
6784
  }
6589
- if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
6785
+ if (typeAnnotation.typeAnnotation.type !== import_utils44.AST_NODE_TYPES.TSUnionType) {
6590
6786
  return;
6591
6787
  }
6592
6788
  const fixedTypeText = buildFixedTypeText6(sourceCode, typeAnnotation.typeAnnotation);
@@ -6631,11 +6827,12 @@ var rule96 = ruleCreator({
6631
6827
  var typescript_no_redundant_undefined_readonly_property_default = rule96;
6632
6828
 
6633
6829
  // dist/rules/typescript-no-redundant-undefined-return-type.js
6830
+ var import_utils45 = require("@typescript-eslint/utils");
6634
6831
  var import_ts_extras61 = require("ts-extras");
6635
6832
  var buildFixedTypeText7 = (sourceCode, unionType) => {
6636
6833
  let nonUndefinedTypeTexts = [];
6637
6834
  for (const typeNode of unionType.types) {
6638
- if (typeNode.type === "TSUndefinedKeyword") {
6835
+ if (typeNode.type === import_utils45.AST_NODE_TYPES.TSUndefinedKeyword) {
6639
6836
  continue;
6640
6837
  }
6641
6838
  nonUndefinedTypeTexts = [
@@ -6649,52 +6846,52 @@ var buildFixedTypeText7 = (sourceCode, unionType) => {
6649
6846
  return (0, import_ts_extras61.arrayJoin)(nonUndefinedTypeTexts, " | ");
6650
6847
  };
6651
6848
  var unwrapExpression7 = (expression) => {
6652
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6849
+ if (expression.type === import_utils45.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils45.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils45.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils45.AST_NODE_TYPES.TSTypeAssertion) {
6653
6850
  return unwrapExpression7(expression.expression);
6654
6851
  }
6655
6852
  return expression;
6656
6853
  };
6657
6854
  var isDefinitelyDefinedExpression6 = (expression) => {
6658
6855
  const unwrappedExpression = unwrapExpression7(expression);
6659
- if (unwrappedExpression.type === "ArrayExpression") {
6856
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.ArrayExpression) {
6660
6857
  return true;
6661
6858
  }
6662
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
6859
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.ArrowFunctionExpression) {
6663
6860
  return true;
6664
6861
  }
6665
- if (unwrappedExpression.type === "ClassExpression") {
6862
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.ClassExpression) {
6666
6863
  return true;
6667
6864
  }
6668
- if (unwrappedExpression.type === "ConditionalExpression") {
6865
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.ConditionalExpression) {
6669
6866
  return isDefinitelyDefinedExpression6(unwrappedExpression.consequent) && isDefinitelyDefinedExpression6(unwrappedExpression.alternate);
6670
6867
  }
6671
- if (unwrappedExpression.type === "FunctionExpression") {
6868
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.FunctionExpression) {
6672
6869
  return true;
6673
6870
  }
6674
- if (unwrappedExpression.type === "Literal") {
6871
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.Literal) {
6675
6872
  return true;
6676
6873
  }
6677
- if (unwrappedExpression.type === "LogicalExpression" && unwrappedExpression.operator === "??") {
6874
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.LogicalExpression && unwrappedExpression.operator === "??") {
6678
6875
  return isDefinitelyDefinedExpression6(unwrappedExpression.right);
6679
6876
  }
6680
- if (unwrappedExpression.type === "NewExpression") {
6877
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.NewExpression) {
6681
6878
  return true;
6682
6879
  }
6683
- if (unwrappedExpression.type === "ObjectExpression") {
6880
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.ObjectExpression) {
6684
6881
  return true;
6685
6882
  }
6686
- if (unwrappedExpression.type === "SequenceExpression") {
6883
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.SequenceExpression) {
6687
6884
  const lastExpression = (0, import_ts_extras61.arrayAt)(unwrappedExpression.expressions, -1);
6688
6885
  return lastExpression !== void 0 && isDefinitelyDefinedExpression6(lastExpression);
6689
6886
  }
6690
- if (unwrappedExpression.type === "TemplateLiteral") {
6887
+ if (unwrappedExpression.type === import_utils45.AST_NODE_TYPES.TemplateLiteral) {
6691
6888
  return true;
6692
6889
  }
6693
6890
  return false;
6694
6891
  };
6695
6892
  var hasDefinitelyDefinedReturnValue2 = (node) => {
6696
6893
  const body = node.body;
6697
- if (body.type !== "BlockStatement") {
6894
+ if (body.type !== import_utils45.AST_NODE_TYPES.BlockStatement) {
6698
6895
  return isDefinitelyDefinedExpression6(body);
6699
6896
  }
6700
6897
  if (body.body.length !== 1) {
@@ -6704,7 +6901,7 @@ var hasDefinitelyDefinedReturnValue2 = (node) => {
6704
6901
  if (statement === void 0) {
6705
6902
  return false;
6706
6903
  }
6707
- if (statement.type !== "ReturnStatement") {
6904
+ if (statement.type !== import_utils45.AST_NODE_TYPES.ReturnStatement) {
6708
6905
  return false;
6709
6906
  }
6710
6907
  if (statement.argument === null) {
@@ -6717,14 +6914,14 @@ var rule97 = ruleCreator({
6717
6914
  const sourceCode = context.sourceCode;
6718
6915
  return {
6719
6916
  ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression)": (node) => {
6720
- if (node.type !== "ArrowFunctionExpression" && node.type !== "FunctionDeclaration" && node.type !== "FunctionExpression") {
6917
+ if (node.type !== import_utils45.AST_NODE_TYPES.ArrowFunctionExpression && node.type !== import_utils45.AST_NODE_TYPES.FunctionDeclaration && node.type !== import_utils45.AST_NODE_TYPES.FunctionExpression) {
6721
6918
  return;
6722
6919
  }
6723
6920
  const returnType = node.returnType;
6724
6921
  if (returnType === void 0) {
6725
6922
  return;
6726
6923
  }
6727
- if (returnType.typeAnnotation.type !== "TSUnionType") {
6924
+ if (returnType.typeAnnotation.type !== import_utils45.AST_NODE_TYPES.TSUnionType) {
6728
6925
  return;
6729
6926
  }
6730
6927
  if (!hasDefinitelyDefinedReturnValue2(node)) {
@@ -6772,11 +6969,12 @@ var rule97 = ruleCreator({
6772
6969
  var typescript_no_redundant_undefined_return_type_default = rule97;
6773
6970
 
6774
6971
  // dist/rules/typescript-no-redundant-undefined-var.js
6972
+ var import_utils46 = require("@typescript-eslint/utils");
6775
6973
  var import_ts_extras62 = require("ts-extras");
6776
6974
  var buildFixedTypeText8 = (sourceCode, unionType) => {
6777
6975
  let nonUndefinedTypeTexts = [];
6778
6976
  for (const typeNode of unionType.types) {
6779
- if (typeNode.type === "TSUndefinedKeyword") {
6977
+ if (typeNode.type === import_utils46.AST_NODE_TYPES.TSUndefinedKeyword) {
6780
6978
  continue;
6781
6979
  }
6782
6980
  nonUndefinedTypeTexts = [
@@ -6790,35 +6988,35 @@ var buildFixedTypeText8 = (sourceCode, unionType) => {
6790
6988
  return (0, import_ts_extras62.arrayJoin)(nonUndefinedTypeTexts, " | ");
6791
6989
  };
6792
6990
  var unwrapExpression8 = (expression) => {
6793
- if (expression.type === "TSAsExpression" || expression.type === "TSSatisfiesExpression" || expression.type === "TSNonNullExpression" || expression.type === "TSTypeAssertion") {
6991
+ if (expression.type === import_utils46.AST_NODE_TYPES.TSAsExpression || expression.type === import_utils46.AST_NODE_TYPES.TSSatisfiesExpression || expression.type === import_utils46.AST_NODE_TYPES.TSNonNullExpression || expression.type === import_utils46.AST_NODE_TYPES.TSTypeAssertion) {
6794
6992
  return unwrapExpression8(expression.expression);
6795
6993
  }
6796
6994
  return expression;
6797
6995
  };
6798
6996
  var isDefinitelyDefinedExpression7 = (expression) => {
6799
6997
  const unwrappedExpression = unwrapExpression8(expression);
6800
- if (unwrappedExpression.type === "ArrayExpression") {
6998
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.ArrayExpression) {
6801
6999
  return true;
6802
7000
  }
6803
- if (unwrappedExpression.type === "ArrowFunctionExpression") {
7001
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.ArrowFunctionExpression) {
6804
7002
  return true;
6805
7003
  }
6806
- if (unwrappedExpression.type === "ClassExpression") {
7004
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.ClassExpression) {
6807
7005
  return true;
6808
7006
  }
6809
- if (unwrappedExpression.type === "FunctionExpression") {
7007
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.FunctionExpression) {
6810
7008
  return true;
6811
7009
  }
6812
- if (unwrappedExpression.type === "Literal") {
7010
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.Literal) {
6813
7011
  return true;
6814
7012
  }
6815
- if (unwrappedExpression.type === "NewExpression") {
7013
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.NewExpression) {
6816
7014
  return true;
6817
7015
  }
6818
- if (unwrappedExpression.type === "ObjectExpression") {
7016
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.ObjectExpression) {
6819
7017
  return true;
6820
7018
  }
6821
- if (unwrappedExpression.type === "TemplateLiteral") {
7019
+ if (unwrappedExpression.type === import_utils46.AST_NODE_TYPES.TemplateLiteral) {
6822
7020
  return true;
6823
7021
  }
6824
7022
  return false;
@@ -6846,14 +7044,14 @@ var rule98 = ruleCreator({
6846
7044
  return;
6847
7045
  }
6848
7046
  const id = node.id;
6849
- if (id.type !== "Identifier") {
7047
+ if (id.type !== import_utils46.AST_NODE_TYPES.Identifier) {
6850
7048
  return;
6851
7049
  }
6852
7050
  const typeAnnotation = id.typeAnnotation;
6853
7051
  if (typeAnnotation === void 0) {
6854
7052
  return;
6855
7053
  }
6856
- if (typeAnnotation.typeAnnotation.type !== "TSUnionType") {
7054
+ if (typeAnnotation.typeAnnotation.type !== import_utils46.AST_NODE_TYPES.TSUnionType) {
6857
7055
  return;
6858
7056
  }
6859
7057
  const fixedTypeText = buildFixedTypeText8(sourceCode, typeAnnotation.typeAnnotation);
@@ -6898,21 +7096,25 @@ var rule98 = ruleCreator({
6898
7096
  var typescript_no_redundant_undefined_var_default = rule98;
6899
7097
 
6900
7098
  // dist/rules/typescript-no-restricted-syntax.js
7099
+ var import_ts_extras63 = require("ts-extras");
7100
+ var noRestrictedSyntaxRule = no_restricted_syntax_default;
7101
+ var baseDocs = noRestrictedSyntaxRule.meta.docs;
7102
+ (0, import_ts_extras63.assertDefined)(baseDocs);
6901
7103
  var typescriptNoRestrictedSyntaxRule = {
6902
- ...no_restricted_syntax_default,
7104
+ ...noRestrictedSyntaxRule,
6903
7105
  meta: {
6904
7106
  deprecated: true,
6905
- ...no_restricted_syntax_default.meta,
7107
+ ...noRestrictedSyntaxRule.meta,
6906
7108
  docs: {
7109
+ ...baseDocs,
6907
7110
  deprecated: true,
6908
7111
  frozen: true,
6909
7112
  recommended: false,
6910
- ...no_restricted_syntax_default.meta.docs,
6911
7113
  url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-restricted-syntax"
6912
7114
  }
6913
7115
  }
6914
7116
  };
6915
- var deprecatedRule26 = withDeprecatedRuleLifecycle(typescriptNoRestrictedSyntaxRule, {
7117
+ var rule99 = withDeprecatedRuleLifecycle(typescriptNoRestrictedSyntaxRule, {
6916
7118
  message: "Deprecated in favor of @typescript-eslint/no-restricted-syntax.",
6917
7119
  replacedBy: [
6918
7120
  createReplacementRuleInfo({
@@ -6928,15 +7130,15 @@ var deprecatedRule26 = withDeprecatedRuleLifecycle(typescriptNoRestrictedSyntaxR
6928
7130
  ],
6929
7131
  ruleId: "typescript/no-restricted-syntax"
6930
7132
  });
6931
- var typescript_no_restricted_syntax_default = deprecatedRule26;
7133
+ var typescript_no_restricted_syntax_default = rule99;
6932
7134
 
6933
7135
  // dist/rules/typescript-no-unsafe-object-assign.js
6934
7136
  var import_type_utils9 = require("@typescript-eslint/type-utils");
6935
- var import_utils12 = require("@typescript-eslint/utils");
7137
+ var import_utils47 = require("@typescript-eslint/utils");
6936
7138
  var tsutils4 = __toESM(require("tsutils"), 1);
6937
- var rule99 = ruleCreator({
7139
+ var rule100 = ruleCreator({
6938
7140
  create: (context) => {
6939
- const parserServices = import_utils12.ESLintUtils.getParserServices(context);
7141
+ const parserServices = import_utils47.ESLintUtils.getParserServices(context);
6940
7142
  const checker = parserServices.program.getTypeChecker();
6941
7143
  const hasReadonlyProperty = (type) => type.getProperties().some((property) => tsutils4.isPropertyReadonlyInType(type, property.getEscapedName(), checker));
6942
7144
  return {
@@ -6975,24 +7177,28 @@ var rule99 = ruleCreator({
6975
7177
  },
6976
7178
  name: "typescript/no-unsafe-object-assign"
6977
7179
  });
6978
- var typescript_no_unsafe_object_assign_default = rule99;
7180
+ var typescript_no_unsafe_object_assign_default = rule100;
6979
7181
 
6980
7182
  // dist/rules/typescript-no-unsafe-object-assignment.js
6981
- var rule100 = {
6982
- ...typescript_no_unsafe_object_assign_default,
7183
+ var import_ts_extras64 = require("ts-extras");
7184
+ var coreNoUnsafeObjectAssignRule = typescript_no_unsafe_object_assign_default;
7185
+ var baseDocs2 = coreNoUnsafeObjectAssignRule.meta.docs;
7186
+ (0, import_ts_extras64.assertDefined)(baseDocs2);
7187
+ var typescriptNoUnsafeObjectAssignmentRule = {
7188
+ ...coreNoUnsafeObjectAssignRule,
6983
7189
  meta: {
6984
7190
  deprecated: false,
6985
- ...typescript_no_unsafe_object_assign_default.meta,
7191
+ ...coreNoUnsafeObjectAssignRule.meta,
6986
7192
  docs: {
7193
+ ...baseDocs2,
6987
7194
  deprecated: false,
6988
7195
  frozen: false,
6989
7196
  recommended: false,
6990
- ...typescript_no_unsafe_object_assign_default.meta.docs,
6991
7197
  url: "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/typescript-no-unsafe-object-assignment"
6992
7198
  }
6993
7199
  }
6994
7200
  };
6995
- var typescript_no_unsafe_object_assignment_default = rule100;
7201
+ var typescript_no_unsafe_object_assignment_default = typescriptNoUnsafeObjectAssignmentRule;
6996
7202
 
6997
7203
  // dist/rules/typescript-prefer-array-type-alias.js
6998
7204
  var selector15 = String.raw`TSTypeAliasDeclaration > Identifier.id:matches([parent.typeAnnotation.type='TSArrayType'], [parent.typeAnnotation.type='TSTupleType']):not([name=/^(?:[A-Z][a-z\d]*)+(?:Array|s)$/u])`;
@@ -7058,8 +7264,8 @@ var typescript_prefer_class_method_default = rule102;
7058
7264
 
7059
7265
  // dist/rules/typescript-prefer-enum.js
7060
7266
  var import_type_utils10 = require("@typescript-eslint/type-utils");
7061
- var import_utils13 = require("@typescript-eslint/utils");
7062
- var import_ts_extras63 = require("ts-extras");
7267
+ var import_utils48 = require("@typescript-eslint/utils");
7268
+ var import_ts_extras65 = require("ts-extras");
7063
7269
  var tsutils5 = __toESM(require("tsutils"), 1);
7064
7270
  var import_typescript = __toESM(require("typescript"), 1);
7065
7271
  var isEnumLikeOrUndefinedType = (checker, type) => {
@@ -7077,10 +7283,10 @@ var isEnumLikeOrUndefinedType = (checker, type) => {
7077
7283
  }
7078
7284
  return hasEnumLike;
7079
7285
  };
7080
- var isStringLiteral = (node) => node.type === "Literal" && typeof node.value === "string";
7286
+ var isStringLiteral = (node) => node.type === import_utils48.AST_NODE_TYPES.Literal && typeof node.value === "string";
7081
7287
  var rule103 = ruleCreator({
7082
7288
  create: (context) => {
7083
- const parserServices = import_utils13.ESLintUtils.getParserServices(context);
7289
+ const parserServices = import_utils48.ESLintUtils.getParserServices(context);
7084
7290
  const checker = parserServices.program.getTypeChecker();
7085
7291
  return {
7086
7292
  BinaryExpression: (node) => {
@@ -7088,16 +7294,11 @@ var rule103 = ruleCreator({
7088
7294
  if (!isEqualityOperator) {
7089
7295
  return;
7090
7296
  }
7091
- let literalNode = null;
7092
- if (isStringLiteral(node.left)) {
7093
- literalNode = node.left;
7094
- } else if (isStringLiteral(node.right)) {
7095
- literalNode = node.right;
7096
- }
7097
- const expressionNode = literalNode === node.left ? node.right : node.left;
7297
+ const literalNode = isStringLiteral(node.left) ? node.left : isStringLiteral(node.right) ? node.right : null;
7098
7298
  if (literalNode === null) {
7099
7299
  return;
7100
7300
  }
7301
+ const expressionNode = literalNode === node.left ? node.right : node.left;
7101
7302
  const expressionType = (0, import_type_utils10.getConstrainedTypeAtLocation)(parserServices, expressionNode);
7102
7303
  if (!isEnumLikeOrUndefinedType(checker, expressionType)) {
7103
7304
  return;
@@ -7113,16 +7314,16 @@ var rule103 = ruleCreator({
7113
7314
  }
7114
7315
  let functionNode = null;
7115
7316
  for (const ancestor of context.sourceCode.getAncestors(node)) {
7116
- if (ancestor.type === "ArrowFunctionExpression" || ancestor.type === "FunctionDeclaration" || ancestor.type === "FunctionExpression") {
7317
+ if (ancestor.type === import_utils48.AST_NODE_TYPES.ArrowFunctionExpression || ancestor.type === import_utils48.AST_NODE_TYPES.FunctionDeclaration || ancestor.type === import_utils48.AST_NODE_TYPES.FunctionExpression) {
7117
7318
  functionNode = ancestor;
7118
7319
  }
7119
7320
  }
7120
7321
  if (functionNode === null) {
7121
7322
  return;
7122
7323
  }
7123
- const signature = (0, import_ts_extras63.arrayFirst)((0, import_type_utils10.getConstrainedTypeAtLocation)(parserServices, functionNode).getCallSignatures());
7124
- const returnType = (0, import_ts_extras63.isDefined)(signature) ? checker.getReturnTypeOfSignature(signature) : void 0;
7125
- if (!(0, import_ts_extras63.isDefined)(returnType)) {
7324
+ const signature = (0, import_ts_extras65.arrayFirst)((0, import_type_utils10.getConstrainedTypeAtLocation)(parserServices, functionNode).getCallSignatures());
7325
+ const returnType = (0, import_ts_extras65.isDefined)(signature) ? checker.getReturnTypeOfSignature(signature) : void 0;
7326
+ if (!(0, import_ts_extras65.isDefined)(returnType)) {
7126
7327
  return;
7127
7328
  }
7128
7329
  if (!isEnumLikeOrUndefinedType(checker, returnType)) {
@@ -7134,12 +7335,12 @@ var rule103 = ruleCreator({
7134
7335
  });
7135
7336
  },
7136
7337
  TSTypeAliasDeclaration: (node) => {
7137
- if (node.typeAnnotation.type !== "TSUnionType") {
7338
+ if (node.typeAnnotation.type !== import_utils48.AST_NODE_TYPES.TSUnionType) {
7138
7339
  return;
7139
7340
  }
7140
7341
  let literalCount = 0;
7141
7342
  for (const typeNode of node.typeAnnotation.types) {
7142
- if (typeNode.type === "TSLiteralType" && typeNode.literal.type === "Literal" && typeof typeNode.literal.value === "string") {
7343
+ if (typeNode.type === import_utils48.AST_NODE_TYPES.TSLiteralType && typeNode.literal.type === import_utils48.AST_NODE_TYPES.Literal && typeof typeNode.literal.value === "string") {
7143
7344
  literalCount += 1;
7144
7345
  }
7145
7346
  }
@@ -7176,11 +7377,12 @@ var rule103 = ruleCreator({
7176
7377
  var typescript_prefer_enum_default = rule103;
7177
7378
 
7178
7379
  // dist/rules/typescript-prefer-named-tuple-members.js
7380
+ var import_utils49 = require("@typescript-eslint/utils");
7179
7381
  var isUnnamedTupleElement = (tupleElement) => {
7180
- if (tupleElement.type === "TSNamedTupleMember") {
7382
+ if (tupleElement.type === import_utils49.AST_NODE_TYPES.TSNamedTupleMember) {
7181
7383
  return false;
7182
7384
  }
7183
- if (tupleElement.type === "TSRestType" && tupleElement.typeAnnotation.type === "TSNamedTupleMember") {
7385
+ if (tupleElement.type === import_utils49.AST_NODE_TYPES.TSRestType && tupleElement.typeAnnotation.type === import_utils49.AST_NODE_TYPES.TSNamedTupleMember) {
7184
7386
  return false;
7185
7387
  }
7186
7388
  return true;
@@ -7199,11 +7401,11 @@ var generateUniqueTupleMemberName = (preferredName, usedNames) => {
7199
7401
  return generatedName;
7200
7402
  };
7201
7403
  var getTupleMemberReplacementText = (tupleElement, memberName2, sourceCode) => {
7202
- if (tupleElement.type === "TSOptionalType") {
7404
+ if (tupleElement.type === import_utils49.AST_NODE_TYPES.TSOptionalType) {
7203
7405
  return `${memberName2}?: ${sourceCode.getText(tupleElement.typeAnnotation)}`;
7204
7406
  }
7205
- if (tupleElement.type === "TSRestType") {
7206
- if (tupleElement.typeAnnotation.type === "TSNamedTupleMember") {
7407
+ if (tupleElement.type === import_utils49.AST_NODE_TYPES.TSRestType) {
7408
+ if (tupleElement.typeAnnotation.type === import_utils49.AST_NODE_TYPES.TSNamedTupleMember) {
7207
7409
  return sourceCode.getText(tupleElement);
7208
7410
  }
7209
7411
  return `...${memberName2}: ${sourceCode.getText(tupleElement.typeAnnotation)}`;
@@ -7220,10 +7422,7 @@ var rule104 = ruleCreator({
7220
7422
  return;
7221
7423
  }
7222
7424
  const usedNames = new Set(node.elementTypes.flatMap((tupleElement) => {
7223
- if (tupleElement.type !== "TSNamedTupleMember") {
7224
- return [];
7225
- }
7226
- if (tupleElement.label.type !== "Identifier") {
7425
+ if (tupleElement.type !== import_utils49.AST_NODE_TYPES.TSNamedTupleMember) {
7227
7426
  return [];
7228
7427
  }
7229
7428
  return [tupleElement.label.name];
@@ -7279,23 +7478,24 @@ var rule104 = ruleCreator({
7279
7478
  var typescript_prefer_named_tuple_members_default = rule104;
7280
7479
 
7281
7480
  // dist/rules/typescript-prefer-readonly-array-parameter.js
7481
+ var import_utils50 = require("@typescript-eslint/utils");
7282
7482
  var functionLikeNodeSelector2 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
7283
7483
  var getParametersFromFunctionLikeNode2 = (node) => {
7284
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
7484
+ if (node.type === import_utils50.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils50.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils50.AST_NODE_TYPES.FunctionExpression || node.type === import_utils50.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils50.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils50.AST_NODE_TYPES.TSConstructorType || node.type === import_utils50.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils50.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils50.AST_NODE_TYPES.TSFunctionType || node.type === import_utils50.AST_NODE_TYPES.TSMethodSignature) {
7285
7485
  return node.params;
7286
7486
  }
7287
7487
  return void 0;
7288
7488
  };
7289
7489
  var getTypeAnnotationFromPattern = (pattern) => {
7290
- if (pattern.type === "AssignmentPattern") {
7490
+ if (pattern.type === import_utils50.AST_NODE_TYPES.AssignmentPattern) {
7291
7491
  return getTypeAnnotationFromPattern(pattern.left);
7292
7492
  }
7293
- if (pattern.type === "RestElement") {
7493
+ if (pattern.type === import_utils50.AST_NODE_TYPES.RestElement) {
7294
7494
  if (pattern.typeAnnotation !== void 0) {
7295
7495
  return pattern.typeAnnotation;
7296
7496
  }
7297
7497
  const argument = pattern.argument;
7298
- if (argument.type !== "ArrayPattern" && argument.type !== "Identifier" && argument.type !== "ObjectPattern") {
7498
+ if (argument.type !== import_utils50.AST_NODE_TYPES.ArrayPattern && argument.type !== import_utils50.AST_NODE_TYPES.Identifier && argument.type !== import_utils50.AST_NODE_TYPES.ObjectPattern) {
7299
7499
  return void 0;
7300
7500
  }
7301
7501
  return argument.typeAnnotation;
@@ -7303,20 +7503,20 @@ var getTypeAnnotationFromPattern = (pattern) => {
7303
7503
  return pattern.typeAnnotation;
7304
7504
  };
7305
7505
  var getTypeAnnotationFromParameter = (parameter) => {
7306
- if (parameter.type === "TSParameterProperty") {
7506
+ if (parameter.type === import_utils50.AST_NODE_TYPES.TSParameterProperty) {
7307
7507
  return getTypeAnnotationFromPattern(parameter.parameter);
7308
7508
  }
7309
7509
  return getTypeAnnotationFromPattern(parameter);
7310
7510
  };
7311
- var isArrayTypeReference = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Array";
7511
+ var isArrayTypeReference = (node) => node.typeName.type === import_utils50.AST_NODE_TYPES.Identifier && node.typeName.name === "Array";
7312
7512
  var collectMutableArrayLikeTypeNodes = (typeNode) => {
7313
- if (typeNode.type === "TSArrayType" || typeNode.type === "TSTupleType") {
7513
+ if (typeNode.type === import_utils50.AST_NODE_TYPES.TSArrayType || typeNode.type === import_utils50.AST_NODE_TYPES.TSTupleType) {
7314
7514
  return [typeNode];
7315
7515
  }
7316
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
7516
+ if (typeNode.type === import_utils50.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils50.AST_NODE_TYPES.TSUnionType) {
7317
7517
  return typeNode.types.flatMap((subTypeNode) => collectMutableArrayLikeTypeNodes(subTypeNode));
7318
7518
  }
7319
- if (typeNode.type === "TSTypeReference") {
7519
+ if (typeNode.type === import_utils50.AST_NODE_TYPES.TSTypeReference) {
7320
7520
  if (!isArrayTypeReference(typeNode)) {
7321
7521
  return [];
7322
7522
  }
@@ -7325,7 +7525,7 @@ var collectMutableArrayLikeTypeNodes = (typeNode) => {
7325
7525
  return [];
7326
7526
  };
7327
7527
  var buildReadonlyArrayLikeFix = (node, sourceCode) => {
7328
- if (node.type === "Identifier") {
7528
+ if (node.type === import_utils50.AST_NODE_TYPES.Identifier) {
7329
7529
  return (fixer) => fixer.replaceText(node, "ReadonlyArray");
7330
7530
  }
7331
7531
  return (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
@@ -7386,8 +7586,9 @@ var rule105 = ruleCreator({
7386
7586
  var typescript_prefer_readonly_array_parameter_default = rule105;
7387
7587
 
7388
7588
  // dist/rules/typescript-prefer-readonly-array.js
7389
- var import_ts_extras64 = require("ts-extras");
7390
- var selector17 = (0, import_ts_extras64.arrayJoin)([
7589
+ var import_utils51 = require("@typescript-eslint/utils");
7590
+ var import_ts_extras66 = require("ts-extras");
7591
+ var selector17 = (0, import_ts_extras66.arrayJoin)([
7391
7592
  ":not(TSTypeOperator[operator='readonly']) > :matches(TSArrayType, TSTupleType)",
7392
7593
  "TSTypeReference > Identifier[name='Array']"
7393
7594
  ], ", ");
@@ -7396,10 +7597,10 @@ var rule106 = ruleCreator({
7396
7597
  const sourceCode = context.sourceCode;
7397
7598
  return {
7398
7599
  [selector17]: (node) => {
7399
- if (node.type !== "Identifier" && node.type !== "TSArrayType" && node.type !== "TSTupleType") {
7600
+ if (node.type !== import_utils51.AST_NODE_TYPES.Identifier && node.type !== import_utils51.AST_NODE_TYPES.TSArrayType && node.type !== import_utils51.AST_NODE_TYPES.TSTupleType) {
7400
7601
  return;
7401
7602
  }
7402
- const fix = node.type === "Identifier" ? (fixer) => fixer.replaceText(node, "ReadonlyArray") : (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
7603
+ const fix = node.type === import_utils51.AST_NODE_TYPES.Identifier ? (fixer) => fixer.replaceText(node, "ReadonlyArray") : (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
7403
7604
  context.report({
7404
7605
  fix,
7405
7606
  messageId: "forbidden",
@@ -7430,11 +7631,12 @@ var rule106 = ruleCreator({
7430
7631
  var typescript_prefer_readonly_array_default = rule106;
7431
7632
 
7432
7633
  // dist/rules/typescript-prefer-readonly-index-signature.js
7634
+ var import_utils52 = require("@typescript-eslint/utils");
7433
7635
  var selector18 = "TSIndexSignature[readonly!=true]";
7434
7636
  var rule107 = ruleCreator({
7435
7637
  create: (context) => ({
7436
7638
  [selector18]: (node) => {
7437
- if (node.type !== "TSIndexSignature" || node.readonly) {
7639
+ if (node.type !== import_utils52.AST_NODE_TYPES.TSIndexSignature || node.readonly) {
7438
7640
  return;
7439
7641
  }
7440
7642
  context.report({
@@ -7466,11 +7668,12 @@ var rule107 = ruleCreator({
7466
7668
  var typescript_prefer_readonly_index_signature_default = rule107;
7467
7669
 
7468
7670
  // dist/rules/typescript-prefer-readonly-map.js
7671
+ var import_utils53 = require("@typescript-eslint/utils");
7469
7672
  var selector19 = "TSTypeReference > Identifier[name='Map']";
7470
7673
  var rule108 = ruleCreator({
7471
7674
  create: (context) => ({
7472
7675
  [selector19]: (node) => {
7473
- if (node.type !== "Identifier") {
7676
+ if (node.type !== import_utils53.AST_NODE_TYPES.Identifier) {
7474
7677
  return;
7475
7678
  }
7476
7679
  context.report({
@@ -7502,20 +7705,21 @@ var rule108 = ruleCreator({
7502
7705
  var typescript_prefer_readonly_map_default = rule108;
7503
7706
 
7504
7707
  // dist/rules/typescript-prefer-readonly-property.js
7505
- var import_ts_extras65 = require("ts-extras");
7708
+ var import_utils54 = require("@typescript-eslint/utils");
7709
+ var import_ts_extras67 = require("ts-extras");
7506
7710
  var selector20 = ":matches(PropertyDefinition, TSPropertySignature)[readonly!=true]";
7507
7711
  var rule109 = ruleCreator({
7508
7712
  create: (context) => ({
7509
7713
  [selector20]: (node) => {
7510
- if (node.type !== "PropertyDefinition" && node.type !== "TSPropertySignature") {
7714
+ if (node.type !== import_utils54.AST_NODE_TYPES.PropertyDefinition && node.type !== import_utils54.AST_NODE_TYPES.TSPropertySignature) {
7511
7715
  return;
7512
7716
  }
7513
7717
  const keyNode = node.key;
7514
- const fix = keyNode.type === "Identifier" || keyNode.type === "PrivateIdentifier" || keyNode.type === "Literal" ? (fixer) => fixer.insertTextBefore(keyNode, "readonly ") : void 0;
7718
+ const fix = keyNode.type === import_utils54.AST_NODE_TYPES.Identifier || keyNode.type === import_utils54.AST_NODE_TYPES.PrivateIdentifier || keyNode.type === import_utils54.AST_NODE_TYPES.Literal ? (fixer) => fixer.insertTextBefore(keyNode, "readonly ") : void 0;
7515
7719
  context.report({
7516
7720
  messageId: "forbidden",
7517
7721
  node,
7518
- ...(0, import_ts_extras65.isDefined)(fix) ? {
7722
+ ...(0, import_ts_extras67.isDefined)(fix) ? {
7519
7723
  fix,
7520
7724
  suggest: [
7521
7725
  {
@@ -7550,23 +7754,24 @@ var rule109 = ruleCreator({
7550
7754
  var typescript_prefer_readonly_property_default = rule109;
7551
7755
 
7552
7756
  // dist/rules/typescript-prefer-readonly-record.js
7757
+ var import_utils55 = require("@typescript-eslint/utils");
7553
7758
  var selector21 = "TSTypeReference > Identifier[name='Record']";
7554
7759
  var isReadonlyWrappedRecord = (typeReference) => {
7555
7760
  const parent = typeReference.parent;
7556
- if (parent?.type !== "TSTypeParameterInstantiation") {
7761
+ if (parent.type !== import_utils55.AST_NODE_TYPES.TSTypeParameterInstantiation) {
7557
7762
  return false;
7558
7763
  }
7559
7764
  const maybeReadonlyTypeReference = parent.parent;
7560
- return maybeReadonlyTypeReference?.type === "TSTypeReference" && maybeReadonlyTypeReference.typeName.type === "Identifier" && maybeReadonlyTypeReference.typeName.name === "Readonly";
7765
+ return maybeReadonlyTypeReference.type === import_utils55.AST_NODE_TYPES.TSTypeReference && maybeReadonlyTypeReference.typeName.type === import_utils55.AST_NODE_TYPES.Identifier && maybeReadonlyTypeReference.typeName.name === "Readonly";
7561
7766
  };
7562
7767
  var rule110 = ruleCreator({
7563
7768
  create: (context) => ({
7564
7769
  [selector21]: (node) => {
7565
- if (node.type !== "Identifier") {
7770
+ if (node.type !== import_utils55.AST_NODE_TYPES.Identifier) {
7566
7771
  return;
7567
7772
  }
7568
7773
  const typeReference = node.parent;
7569
- if (typeReference?.type !== "TSTypeReference" || typeReference.typeName.type !== "Identifier" || typeReference.typeName.name !== "Record" || isReadonlyWrappedRecord(typeReference)) {
7774
+ if (typeReference.type !== import_utils55.AST_NODE_TYPES.TSTypeReference || typeReference.typeName.type !== import_utils55.AST_NODE_TYPES.Identifier || typeReference.typeName.name !== "Record" || isReadonlyWrappedRecord(typeReference)) {
7570
7775
  return;
7571
7776
  }
7572
7777
  context.report({
@@ -7601,11 +7806,12 @@ var rule110 = ruleCreator({
7601
7806
  var typescript_prefer_readonly_record_default = rule110;
7602
7807
 
7603
7808
  // dist/rules/typescript-prefer-readonly-set.js
7809
+ var import_utils56 = require("@typescript-eslint/utils");
7604
7810
  var selector22 = "TSTypeReference > Identifier[name='Set']";
7605
7811
  var rule111 = ruleCreator({
7606
7812
  create: (context) => ({
7607
7813
  [selector22]: (node) => {
7608
- if (node.type !== "Identifier") {
7814
+ if (node.type !== import_utils56.AST_NODE_TYPES.Identifier) {
7609
7815
  return;
7610
7816
  }
7611
7817
  context.report({
@@ -7637,20 +7843,21 @@ var rule111 = ruleCreator({
7637
7843
  var typescript_prefer_readonly_set_default = rule111;
7638
7844
 
7639
7845
  // dist/rules/typescript-require-prop-type-annotation.js
7640
- var import_ts_extras66 = require("ts-extras");
7846
+ var import_utils57 = require("@typescript-eslint/utils");
7847
+ var import_ts_extras68 = require("ts-extras");
7641
7848
  var selector23 = "PropertyDefinition[typeAnnotation=undefined][value=null]";
7642
7849
  var rule112 = ruleCreator({
7643
7850
  create: (context) => ({
7644
7851
  [selector23]: (node) => {
7645
- if (node.type !== "PropertyDefinition") {
7852
+ if (node.type !== import_utils57.AST_NODE_TYPES.PropertyDefinition) {
7646
7853
  return;
7647
7854
  }
7648
- const canProvideSafeSuggestion = !node.computed && node.key.type === "Identifier" && !node.optional && !node.definite;
7855
+ const canProvideSafeSuggestion = !node.computed && node.key.type === import_utils57.AST_NODE_TYPES.Identifier && !node.optional && !node.definite;
7649
7856
  const fix = canProvideSafeSuggestion ? (fixer) => fixer.insertTextAfter(node.key, ": unknown") : void 0;
7650
7857
  context.report({
7651
7858
  messageId: "forbidden",
7652
7859
  node,
7653
- ...(0, import_ts_extras66.isDefined)(fix) ? {
7860
+ ...(0, import_ts_extras68.isDefined)(fix) ? {
7654
7861
  fix,
7655
7862
  suggest: [
7656
7863
  {
@@ -7685,15 +7892,16 @@ var rule112 = ruleCreator({
7685
7892
  var typescript_require_prop_type_annotation_default = rule112;
7686
7893
 
7687
7894
  // dist/rules/typescript-require-readonly-array-property-type.js
7688
- var isArrayTypeReference2 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Array";
7895
+ var import_utils58 = require("@typescript-eslint/utils");
7896
+ var isArrayTypeReference2 = (node) => node.typeName.type === import_utils58.AST_NODE_TYPES.Identifier && node.typeName.name === "Array";
7689
7897
  var collectMutableArrayLikeTypeNodes2 = (typeNode) => {
7690
- if (typeNode.type === "TSArrayType" || typeNode.type === "TSTupleType") {
7898
+ if (typeNode.type === import_utils58.AST_NODE_TYPES.TSArrayType || typeNode.type === import_utils58.AST_NODE_TYPES.TSTupleType) {
7691
7899
  return [typeNode];
7692
7900
  }
7693
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
7901
+ if (typeNode.type === import_utils58.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils58.AST_NODE_TYPES.TSUnionType) {
7694
7902
  return typeNode.types.flatMap((subTypeNode) => collectMutableArrayLikeTypeNodes2(subTypeNode));
7695
7903
  }
7696
- if (typeNode.type === "TSTypeReference") {
7904
+ if (typeNode.type === import_utils58.AST_NODE_TYPES.TSTypeReference) {
7697
7905
  if (!isArrayTypeReference2(typeNode)) {
7698
7906
  return [];
7699
7907
  }
@@ -7702,21 +7910,18 @@ var collectMutableArrayLikeTypeNodes2 = (typeNode) => {
7702
7910
  return [];
7703
7911
  };
7704
7912
  var buildReadonlyArrayLikeFix2 = (node, sourceCode) => {
7705
- if (node.type === "Identifier") {
7913
+ if (node.type === import_utils58.AST_NODE_TYPES.Identifier) {
7706
7914
  return (fixer) => fixer.replaceText(node, "ReadonlyArray");
7707
7915
  }
7708
7916
  return (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
7709
7917
  };
7710
7918
  var isTopLevelPropertySignature = (node) => {
7711
7919
  const parent = node.parent;
7712
- if (parent?.type === "TSInterfaceBody") {
7920
+ if (parent.type === import_utils58.AST_NODE_TYPES.TSInterfaceBody) {
7713
7921
  return true;
7714
7922
  }
7715
- if (parent?.type !== "TSTypeLiteral") {
7716
- return false;
7717
- }
7718
7923
  const maybeTypeAliasDeclaration = parent.parent;
7719
- return maybeTypeAliasDeclaration?.type === "TSTypeAliasDeclaration";
7924
+ return maybeTypeAliasDeclaration.type === import_utils58.AST_NODE_TYPES.TSTypeAliasDeclaration;
7720
7925
  };
7721
7926
  var rule113 = ruleCreator({
7722
7927
  create: (context) => {
@@ -7771,22 +7976,23 @@ var rule113 = ruleCreator({
7771
7976
  var typescript_require_readonly_array_property_type_default = rule113;
7772
7977
 
7773
7978
  // dist/rules/typescript-require-readonly-array-return-type.js
7979
+ var import_utils59 = require("@typescript-eslint/utils");
7774
7980
  var functionLikeNodeSelector3 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
7775
7981
  var getReturnTypeAnnotationFromFunctionLikeNode = (node) => {
7776
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
7982
+ if (node.type === import_utils59.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils59.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils59.AST_NODE_TYPES.FunctionExpression || node.type === import_utils59.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils59.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils59.AST_NODE_TYPES.TSConstructorType || node.type === import_utils59.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils59.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils59.AST_NODE_TYPES.TSFunctionType || node.type === import_utils59.AST_NODE_TYPES.TSMethodSignature) {
7777
7983
  return node.returnType;
7778
7984
  }
7779
7985
  return void 0;
7780
7986
  };
7781
- var isArrayTypeReference3 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Array";
7987
+ var isArrayTypeReference3 = (node) => node.typeName.type === import_utils59.AST_NODE_TYPES.Identifier && node.typeName.name === "Array";
7782
7988
  var collectMutableArrayLikeTypeNodes3 = (typeNode) => {
7783
- if (typeNode.type === "TSArrayType" || typeNode.type === "TSTupleType") {
7989
+ if (typeNode.type === import_utils59.AST_NODE_TYPES.TSArrayType || typeNode.type === import_utils59.AST_NODE_TYPES.TSTupleType) {
7784
7990
  return [typeNode];
7785
7991
  }
7786
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
7992
+ if (typeNode.type === import_utils59.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils59.AST_NODE_TYPES.TSUnionType) {
7787
7993
  return typeNode.types.flatMap((subTypeNode) => collectMutableArrayLikeTypeNodes3(subTypeNode));
7788
7994
  }
7789
- if (typeNode.type === "TSTypeReference") {
7995
+ if (typeNode.type === import_utils59.AST_NODE_TYPES.TSTypeReference) {
7790
7996
  if (!isArrayTypeReference3(typeNode)) {
7791
7997
  return [];
7792
7998
  }
@@ -7795,7 +8001,7 @@ var collectMutableArrayLikeTypeNodes3 = (typeNode) => {
7795
8001
  return [];
7796
8002
  };
7797
8003
  var buildReadonlyArrayLikeFix3 = (node, sourceCode) => {
7798
- if (node.type === "Identifier") {
8004
+ if (node.type === import_utils59.AST_NODE_TYPES.Identifier) {
7799
8005
  return (fixer) => fixer.replaceText(node, "ReadonlyArray");
7800
8006
  }
7801
8007
  return (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
@@ -7850,15 +8056,16 @@ var rule114 = ruleCreator({
7850
8056
  var typescript_require_readonly_array_return_type_default = rule114;
7851
8057
 
7852
8058
  // dist/rules/typescript-require-readonly-array-type-alias.js
7853
- var isArrayTypeReference4 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Array";
8059
+ var import_utils60 = require("@typescript-eslint/utils");
8060
+ var isArrayTypeReference4 = (node) => node.typeName.type === import_utils60.AST_NODE_TYPES.Identifier && node.typeName.name === "Array";
7854
8061
  var collectMutableArrayLikeTypeNodes4 = (typeNode) => {
7855
- if (typeNode.type === "TSArrayType" || typeNode.type === "TSTupleType") {
8062
+ if (typeNode.type === import_utils60.AST_NODE_TYPES.TSArrayType || typeNode.type === import_utils60.AST_NODE_TYPES.TSTupleType) {
7856
8063
  return [typeNode];
7857
8064
  }
7858
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8065
+ if (typeNode.type === import_utils60.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils60.AST_NODE_TYPES.TSUnionType) {
7859
8066
  return typeNode.types.flatMap((subTypeNode) => collectMutableArrayLikeTypeNodes4(subTypeNode));
7860
8067
  }
7861
- if (typeNode.type === "TSTypeReference") {
8068
+ if (typeNode.type === import_utils60.AST_NODE_TYPES.TSTypeReference) {
7862
8069
  if (!isArrayTypeReference4(typeNode)) {
7863
8070
  return [];
7864
8071
  }
@@ -7867,7 +8074,7 @@ var collectMutableArrayLikeTypeNodes4 = (typeNode) => {
7867
8074
  return [];
7868
8075
  };
7869
8076
  var buildReadonlyArrayLikeFix4 = (node, sourceCode) => {
7870
- if (node.type === "Identifier") {
8077
+ if (node.type === import_utils60.AST_NODE_TYPES.Identifier) {
7871
8078
  return (fixer) => fixer.replaceText(node, "ReadonlyArray");
7872
8079
  }
7873
8080
  return (fixer) => fixer.replaceText(node, `readonly ${sourceCode.getText(node)}`);
@@ -7918,23 +8125,24 @@ var rule115 = ruleCreator({
7918
8125
  var typescript_require_readonly_array_type_alias_default = rule115;
7919
8126
 
7920
8127
  // dist/rules/typescript-require-readonly-map-parameter-type.js
8128
+ var import_utils61 = require("@typescript-eslint/utils");
7921
8129
  var functionLikeNodeSelector4 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
7922
8130
  var getParametersFromFunctionLikeNode3 = (node) => {
7923
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8131
+ if (node.type === import_utils61.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils61.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils61.AST_NODE_TYPES.FunctionExpression || node.type === import_utils61.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils61.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils61.AST_NODE_TYPES.TSConstructorType || node.type === import_utils61.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils61.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils61.AST_NODE_TYPES.TSFunctionType || node.type === import_utils61.AST_NODE_TYPES.TSMethodSignature) {
7924
8132
  return node.params;
7925
8133
  }
7926
8134
  return void 0;
7927
8135
  };
7928
8136
  var getTypeAnnotationFromPattern2 = (pattern) => {
7929
- if (pattern.type === "AssignmentPattern") {
8137
+ if (pattern.type === import_utils61.AST_NODE_TYPES.AssignmentPattern) {
7930
8138
  return getTypeAnnotationFromPattern2(pattern.left);
7931
8139
  }
7932
- if (pattern.type === "RestElement") {
8140
+ if (pattern.type === import_utils61.AST_NODE_TYPES.RestElement) {
7933
8141
  if (pattern.typeAnnotation !== void 0) {
7934
8142
  return pattern.typeAnnotation;
7935
8143
  }
7936
8144
  const argument = pattern.argument;
7937
- if (argument.type !== "ArrayPattern" && argument.type !== "Identifier" && argument.type !== "ObjectPattern") {
8145
+ if (argument.type !== import_utils61.AST_NODE_TYPES.ArrayPattern && argument.type !== import_utils61.AST_NODE_TYPES.Identifier && argument.type !== import_utils61.AST_NODE_TYPES.ObjectPattern) {
7938
8146
  return void 0;
7939
8147
  }
7940
8148
  return argument.typeAnnotation;
@@ -7942,17 +8150,17 @@ var getTypeAnnotationFromPattern2 = (pattern) => {
7942
8150
  return pattern.typeAnnotation;
7943
8151
  };
7944
8152
  var getTypeAnnotationFromParameter2 = (parameter) => {
7945
- if (parameter.type === "TSParameterProperty") {
8153
+ if (parameter.type === import_utils61.AST_NODE_TYPES.TSParameterProperty) {
7946
8154
  return getTypeAnnotationFromPattern2(parameter.parameter);
7947
8155
  }
7948
8156
  return getTypeAnnotationFromPattern2(parameter);
7949
8157
  };
7950
- var isMapTypeReference = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Map";
8158
+ var isMapTypeReference = (node) => node.typeName.type === import_utils61.AST_NODE_TYPES.Identifier && node.typeName.name === "Map";
7951
8159
  var collectMutableMapTypeNodes = (typeNode) => {
7952
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8160
+ if (typeNode.type === import_utils61.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils61.AST_NODE_TYPES.TSUnionType) {
7953
8161
  return typeNode.types.flatMap((subTypeNode) => collectMutableMapTypeNodes(subTypeNode));
7954
8162
  }
7955
- if (typeNode.type !== "TSTypeReference" || !isMapTypeReference(typeNode)) {
8163
+ if (typeNode.type !== import_utils61.AST_NODE_TYPES.TSTypeReference || !isMapTypeReference(typeNode)) {
7956
8164
  return [];
7957
8165
  }
7958
8166
  return [typeNode.typeName];
@@ -8011,12 +8219,13 @@ var rule116 = ruleCreator({
8011
8219
  var typescript_require_readonly_map_parameter_type_default = rule116;
8012
8220
 
8013
8221
  // dist/rules/typescript-require-readonly-map-property-type.js
8014
- var isMapTypeReference2 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Map";
8222
+ var import_utils62 = require("@typescript-eslint/utils");
8223
+ var isMapTypeReference2 = (node) => node.typeName.type === import_utils62.AST_NODE_TYPES.Identifier && node.typeName.name === "Map";
8015
8224
  var collectMutableMapTypeNodes2 = (typeNode) => {
8016
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8225
+ if (typeNode.type === import_utils62.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils62.AST_NODE_TYPES.TSUnionType) {
8017
8226
  return typeNode.types.flatMap((subTypeNode) => collectMutableMapTypeNodes2(subTypeNode));
8018
8227
  }
8019
- if (typeNode.type !== "TSTypeReference" || !isMapTypeReference2(typeNode)) {
8228
+ if (typeNode.type !== import_utils62.AST_NODE_TYPES.TSTypeReference || !isMapTypeReference2(typeNode)) {
8020
8229
  return [];
8021
8230
  }
8022
8231
  return [typeNode.typeName];
@@ -8024,14 +8233,11 @@ var collectMutableMapTypeNodes2 = (typeNode) => {
8024
8233
  var buildReadonlyMapFix2 = (node) => (fixer) => fixer.replaceText(node, "ReadonlyMap");
8025
8234
  var isTopLevelPropertySignature2 = (node) => {
8026
8235
  const parent = node.parent;
8027
- if (parent?.type === "TSInterfaceBody") {
8236
+ if (parent.type === import_utils62.AST_NODE_TYPES.TSInterfaceBody) {
8028
8237
  return true;
8029
8238
  }
8030
- if (parent?.type !== "TSTypeLiteral") {
8031
- return false;
8032
- }
8033
8239
  const maybeTypeAliasDeclaration = parent.parent;
8034
- return maybeTypeAliasDeclaration?.type === "TSTypeAliasDeclaration";
8240
+ return maybeTypeAliasDeclaration.type === import_utils62.AST_NODE_TYPES.TSTypeAliasDeclaration;
8035
8241
  };
8036
8242
  var rule117 = ruleCreator({
8037
8243
  create: (context) => ({
@@ -8083,19 +8289,20 @@ var rule117 = ruleCreator({
8083
8289
  var typescript_require_readonly_map_property_type_default = rule117;
8084
8290
 
8085
8291
  // dist/rules/typescript-require-readonly-map-return-type.js
8292
+ var import_utils63 = require("@typescript-eslint/utils");
8086
8293
  var functionLikeNodeSelector5 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
8087
8294
  var getReturnTypeAnnotationFromFunctionLikeNode2 = (node) => {
8088
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8295
+ if (node.type === import_utils63.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils63.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils63.AST_NODE_TYPES.FunctionExpression || node.type === import_utils63.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils63.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils63.AST_NODE_TYPES.TSConstructorType || node.type === import_utils63.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils63.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils63.AST_NODE_TYPES.TSFunctionType || node.type === import_utils63.AST_NODE_TYPES.TSMethodSignature) {
8089
8296
  return node.returnType;
8090
8297
  }
8091
8298
  return void 0;
8092
8299
  };
8093
- var isMapTypeReference3 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Map";
8300
+ var isMapTypeReference3 = (node) => node.typeName.type === import_utils63.AST_NODE_TYPES.Identifier && node.typeName.name === "Map";
8094
8301
  var collectMutableMapTypeNodes3 = (typeNode) => {
8095
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8302
+ if (typeNode.type === import_utils63.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils63.AST_NODE_TYPES.TSUnionType) {
8096
8303
  return typeNode.types.flatMap((subTypeNode) => collectMutableMapTypeNodes3(subTypeNode));
8097
8304
  }
8098
- if (typeNode.type !== "TSTypeReference" || !isMapTypeReference3(typeNode)) {
8305
+ if (typeNode.type !== import_utils63.AST_NODE_TYPES.TSTypeReference || !isMapTypeReference3(typeNode)) {
8099
8306
  return [];
8100
8307
  }
8101
8308
  return [typeNode.typeName];
@@ -8148,12 +8355,13 @@ var rule118 = ruleCreator({
8148
8355
  var typescript_require_readonly_map_return_type_default = rule118;
8149
8356
 
8150
8357
  // dist/rules/typescript-require-readonly-map-type-alias.js
8151
- var isMapTypeReference4 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Map";
8358
+ var import_utils64 = require("@typescript-eslint/utils");
8359
+ var isMapTypeReference4 = (node) => node.typeName.type === import_utils64.AST_NODE_TYPES.Identifier && node.typeName.name === "Map";
8152
8360
  var collectMutableMapTypeNodes4 = (typeNode) => {
8153
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8361
+ if (typeNode.type === import_utils64.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils64.AST_NODE_TYPES.TSUnionType) {
8154
8362
  return typeNode.types.flatMap((subTypeNode) => collectMutableMapTypeNodes4(subTypeNode));
8155
8363
  }
8156
- if (typeNode.type !== "TSTypeReference" || !isMapTypeReference4(typeNode)) {
8364
+ if (typeNode.type !== import_utils64.AST_NODE_TYPES.TSTypeReference || !isMapTypeReference4(typeNode)) {
8157
8365
  return [];
8158
8366
  }
8159
8367
  return [typeNode.typeName];
@@ -8202,23 +8410,24 @@ var rule119 = ruleCreator({
8202
8410
  var typescript_require_readonly_map_type_alias_default = rule119;
8203
8411
 
8204
8412
  // dist/rules/typescript-require-readonly-record-parameter-type.js
8413
+ var import_utils65 = require("@typescript-eslint/utils");
8205
8414
  var functionLikeNodeSelector6 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
8206
8415
  var getParametersFromFunctionLikeNode4 = (node) => {
8207
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8416
+ if (node.type === import_utils65.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils65.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils65.AST_NODE_TYPES.FunctionExpression || node.type === import_utils65.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils65.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils65.AST_NODE_TYPES.TSConstructorType || node.type === import_utils65.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils65.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils65.AST_NODE_TYPES.TSFunctionType || node.type === import_utils65.AST_NODE_TYPES.TSMethodSignature) {
8208
8417
  return node.params;
8209
8418
  }
8210
8419
  return void 0;
8211
8420
  };
8212
8421
  var getTypeAnnotationFromPattern3 = (pattern) => {
8213
- if (pattern.type === "AssignmentPattern") {
8422
+ if (pattern.type === import_utils65.AST_NODE_TYPES.AssignmentPattern) {
8214
8423
  return getTypeAnnotationFromPattern3(pattern.left);
8215
8424
  }
8216
- if (pattern.type === "RestElement") {
8425
+ if (pattern.type === import_utils65.AST_NODE_TYPES.RestElement) {
8217
8426
  if (pattern.typeAnnotation !== void 0) {
8218
8427
  return pattern.typeAnnotation;
8219
8428
  }
8220
8429
  const argument = pattern.argument;
8221
- if (argument.type !== "ArrayPattern" && argument.type !== "Identifier" && argument.type !== "ObjectPattern") {
8430
+ if (argument.type !== import_utils65.AST_NODE_TYPES.ArrayPattern && argument.type !== import_utils65.AST_NODE_TYPES.Identifier && argument.type !== import_utils65.AST_NODE_TYPES.ObjectPattern) {
8222
8431
  return void 0;
8223
8432
  }
8224
8433
  return argument.typeAnnotation;
@@ -8226,22 +8435,22 @@ var getTypeAnnotationFromPattern3 = (pattern) => {
8226
8435
  return pattern.typeAnnotation;
8227
8436
  };
8228
8437
  var getTypeAnnotationFromParameter3 = (parameter) => {
8229
- if (parameter.type === "TSParameterProperty") {
8438
+ if (parameter.type === import_utils65.AST_NODE_TYPES.TSParameterProperty) {
8230
8439
  return getTypeAnnotationFromPattern3(parameter.parameter);
8231
8440
  }
8232
8441
  return getTypeAnnotationFromPattern3(parameter);
8233
8442
  };
8234
- var isRecordTypeReference = (typeNode) => typeNode.type === "TSTypeReference" && typeNode.typeName.type === "Identifier" && typeNode.typeName.name === "Record";
8443
+ var isRecordTypeReference = (typeNode) => typeNode.type === import_utils65.AST_NODE_TYPES.TSTypeReference && typeNode.typeName.type === import_utils65.AST_NODE_TYPES.Identifier && typeNode.typeName.name === "Record";
8235
8444
  var isReadonlyWrappedRecord2 = (typeReference) => {
8236
8445
  const maybeTypeParameterInstantiation = typeReference.parent;
8237
- if (maybeTypeParameterInstantiation?.type !== "TSTypeParameterInstantiation") {
8446
+ if (maybeTypeParameterInstantiation.type !== import_utils65.AST_NODE_TYPES.TSTypeParameterInstantiation) {
8238
8447
  return false;
8239
8448
  }
8240
8449
  const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;
8241
- return maybeReadonlyTypeReference?.type === "TSTypeReference" && maybeReadonlyTypeReference.typeName.type === "Identifier" && maybeReadonlyTypeReference.typeName.name === "Readonly";
8450
+ return maybeReadonlyTypeReference.type === import_utils65.AST_NODE_TYPES.TSTypeReference && maybeReadonlyTypeReference.typeName.type === import_utils65.AST_NODE_TYPES.Identifier && maybeReadonlyTypeReference.typeName.name === "Readonly";
8242
8451
  };
8243
8452
  var collectMutableRecordTypeNodes = (typeNode) => {
8244
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8453
+ if (typeNode.type === import_utils65.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils65.AST_NODE_TYPES.TSUnionType) {
8245
8454
  return typeNode.types.flatMap((subTypeNode) => collectMutableRecordTypeNodes(subTypeNode));
8246
8455
  }
8247
8456
  if (!isRecordTypeReference(typeNode) || isReadonlyWrappedRecord2(typeNode)) {
@@ -8306,17 +8515,18 @@ var rule120 = ruleCreator({
8306
8515
  var typescript_require_readonly_record_parameter_type_default = rule120;
8307
8516
 
8308
8517
  // dist/rules/typescript-require-readonly-record-property-type.js
8309
- var isRecordTypeReference2 = (typeNode) => typeNode.type === "TSTypeReference" && typeNode.typeName.type === "Identifier" && typeNode.typeName.name === "Record";
8518
+ var import_utils66 = require("@typescript-eslint/utils");
8519
+ var isRecordTypeReference2 = (typeNode) => typeNode.type === import_utils66.AST_NODE_TYPES.TSTypeReference && typeNode.typeName.type === import_utils66.AST_NODE_TYPES.Identifier && typeNode.typeName.name === "Record";
8310
8520
  var isReadonlyWrappedRecord3 = (typeReference) => {
8311
8521
  const maybeTypeParameterInstantiation = typeReference.parent;
8312
- if (maybeTypeParameterInstantiation?.type !== "TSTypeParameterInstantiation") {
8522
+ if (maybeTypeParameterInstantiation.type !== import_utils66.AST_NODE_TYPES.TSTypeParameterInstantiation) {
8313
8523
  return false;
8314
8524
  }
8315
8525
  const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;
8316
- return maybeReadonlyTypeReference?.type === "TSTypeReference" && maybeReadonlyTypeReference.typeName.type === "Identifier" && maybeReadonlyTypeReference.typeName.name === "Readonly";
8526
+ return maybeReadonlyTypeReference.type === import_utils66.AST_NODE_TYPES.TSTypeReference && maybeReadonlyTypeReference.typeName.type === import_utils66.AST_NODE_TYPES.Identifier && maybeReadonlyTypeReference.typeName.name === "Readonly";
8317
8527
  };
8318
8528
  var collectMutableRecordTypeNodes2 = (typeNode) => {
8319
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8529
+ if (typeNode.type === import_utils66.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils66.AST_NODE_TYPES.TSUnionType) {
8320
8530
  return typeNode.types.flatMap((subTypeNode) => collectMutableRecordTypeNodes2(subTypeNode));
8321
8531
  }
8322
8532
  if (!isRecordTypeReference2(typeNode) || isReadonlyWrappedRecord3(typeNode)) {
@@ -8330,14 +8540,11 @@ var buildReadonlyRecordFix2 = (node) => (fixer) => [
8330
8540
  ];
8331
8541
  var isTopLevelPropertySignature3 = (node) => {
8332
8542
  const parent = node.parent;
8333
- if (parent?.type === "TSInterfaceBody") {
8543
+ if (parent.type === import_utils66.AST_NODE_TYPES.TSInterfaceBody) {
8334
8544
  return true;
8335
8545
  }
8336
- if (parent?.type !== "TSTypeLiteral") {
8337
- return false;
8338
- }
8339
8546
  const maybeTypeAliasDeclaration = parent.parent;
8340
- return maybeTypeAliasDeclaration?.type === "TSTypeAliasDeclaration";
8547
+ return maybeTypeAliasDeclaration.type === import_utils66.AST_NODE_TYPES.TSTypeAliasDeclaration;
8341
8548
  };
8342
8549
  var rule121 = ruleCreator({
8343
8550
  create: (context) => ({
@@ -8389,24 +8596,25 @@ var rule121 = ruleCreator({
8389
8596
  var typescript_require_readonly_record_property_type_default = rule121;
8390
8597
 
8391
8598
  // dist/rules/typescript-require-readonly-record-return-type.js
8599
+ var import_utils67 = require("@typescript-eslint/utils");
8392
8600
  var functionLikeNodeSelector7 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
8393
8601
  var getReturnTypeAnnotationFromFunctionLikeNode3 = (node) => {
8394
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8602
+ if (node.type === import_utils67.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils67.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils67.AST_NODE_TYPES.FunctionExpression || node.type === import_utils67.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils67.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils67.AST_NODE_TYPES.TSConstructorType || node.type === import_utils67.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils67.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils67.AST_NODE_TYPES.TSFunctionType || node.type === import_utils67.AST_NODE_TYPES.TSMethodSignature) {
8395
8603
  return node.returnType;
8396
8604
  }
8397
8605
  return void 0;
8398
8606
  };
8399
- var isRecordTypeReference3 = (typeNode) => typeNode.type === "TSTypeReference" && typeNode.typeName.type === "Identifier" && typeNode.typeName.name === "Record";
8607
+ var isRecordTypeReference3 = (typeNode) => typeNode.type === import_utils67.AST_NODE_TYPES.TSTypeReference && typeNode.typeName.type === import_utils67.AST_NODE_TYPES.Identifier && typeNode.typeName.name === "Record";
8400
8608
  var isReadonlyWrappedRecord4 = (typeReference) => {
8401
8609
  const maybeTypeParameterInstantiation = typeReference.parent;
8402
- if (maybeTypeParameterInstantiation?.type !== "TSTypeParameterInstantiation") {
8610
+ if (maybeTypeParameterInstantiation.type !== import_utils67.AST_NODE_TYPES.TSTypeParameterInstantiation) {
8403
8611
  return false;
8404
8612
  }
8405
8613
  const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;
8406
- return maybeReadonlyTypeReference?.type === "TSTypeReference" && maybeReadonlyTypeReference.typeName.type === "Identifier" && maybeReadonlyTypeReference.typeName.name === "Readonly";
8614
+ return maybeReadonlyTypeReference.type === import_utils67.AST_NODE_TYPES.TSTypeReference && maybeReadonlyTypeReference.typeName.type === import_utils67.AST_NODE_TYPES.Identifier && maybeReadonlyTypeReference.typeName.name === "Readonly";
8407
8615
  };
8408
8616
  var collectMutableRecordTypeNodes3 = (typeNode) => {
8409
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8617
+ if (typeNode.type === import_utils67.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils67.AST_NODE_TYPES.TSUnionType) {
8410
8618
  return typeNode.types.flatMap((subTypeNode) => collectMutableRecordTypeNodes3(subTypeNode));
8411
8619
  }
8412
8620
  if (!isRecordTypeReference3(typeNode) || isReadonlyWrappedRecord4(typeNode)) {
@@ -8465,17 +8673,18 @@ var rule122 = ruleCreator({
8465
8673
  var typescript_require_readonly_record_return_type_default = rule122;
8466
8674
 
8467
8675
  // dist/rules/typescript-require-readonly-record-type-alias.js
8468
- var isRecordTypeReference4 = (typeNode) => typeNode.type === "TSTypeReference" && typeNode.typeName.type === "Identifier" && typeNode.typeName.name === "Record";
8676
+ var import_utils68 = require("@typescript-eslint/utils");
8677
+ var isRecordTypeReference4 = (typeNode) => typeNode.type === import_utils68.AST_NODE_TYPES.TSTypeReference && typeNode.typeName.type === import_utils68.AST_NODE_TYPES.Identifier && typeNode.typeName.name === "Record";
8469
8678
  var isReadonlyWrappedRecord5 = (typeReference) => {
8470
8679
  const maybeTypeParameterInstantiation = typeReference.parent;
8471
- if (maybeTypeParameterInstantiation?.type !== "TSTypeParameterInstantiation") {
8680
+ if (maybeTypeParameterInstantiation.type !== import_utils68.AST_NODE_TYPES.TSTypeParameterInstantiation) {
8472
8681
  return false;
8473
8682
  }
8474
8683
  const maybeReadonlyTypeReference = maybeTypeParameterInstantiation.parent;
8475
- return maybeReadonlyTypeReference?.type === "TSTypeReference" && maybeReadonlyTypeReference.typeName.type === "Identifier" && maybeReadonlyTypeReference.typeName.name === "Readonly";
8684
+ return maybeReadonlyTypeReference.type === import_utils68.AST_NODE_TYPES.TSTypeReference && maybeReadonlyTypeReference.typeName.type === import_utils68.AST_NODE_TYPES.Identifier && maybeReadonlyTypeReference.typeName.name === "Readonly";
8476
8685
  };
8477
8686
  var collectMutableRecordTypeNodes4 = (typeNode) => {
8478
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8687
+ if (typeNode.type === import_utils68.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils68.AST_NODE_TYPES.TSUnionType) {
8479
8688
  return typeNode.types.flatMap((subTypeNode) => collectMutableRecordTypeNodes4(subTypeNode));
8480
8689
  }
8481
8690
  if (!isRecordTypeReference4(typeNode) || isReadonlyWrappedRecord5(typeNode)) {
@@ -8530,23 +8739,24 @@ var rule123 = ruleCreator({
8530
8739
  var typescript_require_readonly_record_type_alias_default = rule123;
8531
8740
 
8532
8741
  // dist/rules/typescript-require-readonly-set-parameter-type.js
8742
+ var import_utils69 = require("@typescript-eslint/utils");
8533
8743
  var functionLikeNodeSelector8 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
8534
8744
  var getParametersFromFunctionLikeNode5 = (node) => {
8535
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8745
+ if (node.type === import_utils69.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils69.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils69.AST_NODE_TYPES.FunctionExpression || node.type === import_utils69.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils69.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils69.AST_NODE_TYPES.TSConstructorType || node.type === import_utils69.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils69.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils69.AST_NODE_TYPES.TSFunctionType || node.type === import_utils69.AST_NODE_TYPES.TSMethodSignature) {
8536
8746
  return node.params;
8537
8747
  }
8538
8748
  return void 0;
8539
8749
  };
8540
8750
  var getTypeAnnotationFromPattern4 = (pattern) => {
8541
- if (pattern.type === "AssignmentPattern") {
8751
+ if (pattern.type === import_utils69.AST_NODE_TYPES.AssignmentPattern) {
8542
8752
  return getTypeAnnotationFromPattern4(pattern.left);
8543
8753
  }
8544
- if (pattern.type === "RestElement") {
8754
+ if (pattern.type === import_utils69.AST_NODE_TYPES.RestElement) {
8545
8755
  if (pattern.typeAnnotation !== void 0) {
8546
8756
  return pattern.typeAnnotation;
8547
8757
  }
8548
8758
  const argument = pattern.argument;
8549
- if (argument.type !== "ArrayPattern" && argument.type !== "Identifier" && argument.type !== "ObjectPattern") {
8759
+ if (argument.type !== import_utils69.AST_NODE_TYPES.ArrayPattern && argument.type !== import_utils69.AST_NODE_TYPES.Identifier && argument.type !== import_utils69.AST_NODE_TYPES.ObjectPattern) {
8550
8760
  return void 0;
8551
8761
  }
8552
8762
  return argument.typeAnnotation;
@@ -8554,17 +8764,17 @@ var getTypeAnnotationFromPattern4 = (pattern) => {
8554
8764
  return pattern.typeAnnotation;
8555
8765
  };
8556
8766
  var getTypeAnnotationFromParameter4 = (parameter) => {
8557
- if (parameter.type === "TSParameterProperty") {
8767
+ if (parameter.type === import_utils69.AST_NODE_TYPES.TSParameterProperty) {
8558
8768
  return getTypeAnnotationFromPattern4(parameter.parameter);
8559
8769
  }
8560
8770
  return getTypeAnnotationFromPattern4(parameter);
8561
8771
  };
8562
- var isSetTypeReference = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Set";
8772
+ var isSetTypeReference = (node) => node.typeName.type === import_utils69.AST_NODE_TYPES.Identifier && node.typeName.name === "Set";
8563
8773
  var collectMutableSetTypeNodes = (typeNode) => {
8564
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8774
+ if (typeNode.type === import_utils69.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils69.AST_NODE_TYPES.TSUnionType) {
8565
8775
  return typeNode.types.flatMap((subTypeNode) => collectMutableSetTypeNodes(subTypeNode));
8566
8776
  }
8567
- if (typeNode.type !== "TSTypeReference" || !isSetTypeReference(typeNode)) {
8777
+ if (typeNode.type !== import_utils69.AST_NODE_TYPES.TSTypeReference || !isSetTypeReference(typeNode)) {
8568
8778
  return [];
8569
8779
  }
8570
8780
  return [typeNode.typeName];
@@ -8623,12 +8833,13 @@ var rule124 = ruleCreator({
8623
8833
  var typescript_require_readonly_set_parameter_type_default = rule124;
8624
8834
 
8625
8835
  // dist/rules/typescript-require-readonly-set-property-type.js
8626
- var isSetTypeReference2 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Set";
8836
+ var import_utils70 = require("@typescript-eslint/utils");
8837
+ var isSetTypeReference2 = (node) => node.typeName.type === import_utils70.AST_NODE_TYPES.Identifier && node.typeName.name === "Set";
8627
8838
  var collectMutableSetTypeNodes2 = (typeNode) => {
8628
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8839
+ if (typeNode.type === import_utils70.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils70.AST_NODE_TYPES.TSUnionType) {
8629
8840
  return typeNode.types.flatMap((subTypeNode) => collectMutableSetTypeNodes2(subTypeNode));
8630
8841
  }
8631
- if (typeNode.type !== "TSTypeReference" || !isSetTypeReference2(typeNode)) {
8842
+ if (typeNode.type !== import_utils70.AST_NODE_TYPES.TSTypeReference || !isSetTypeReference2(typeNode)) {
8632
8843
  return [];
8633
8844
  }
8634
8845
  return [typeNode.typeName];
@@ -8636,14 +8847,11 @@ var collectMutableSetTypeNodes2 = (typeNode) => {
8636
8847
  var buildReadonlySetFix2 = (node) => (fixer) => fixer.replaceText(node, "ReadonlySet");
8637
8848
  var isTopLevelPropertySignature4 = (node) => {
8638
8849
  const parent = node.parent;
8639
- if (parent?.type === "TSInterfaceBody") {
8850
+ if (parent.type === import_utils70.AST_NODE_TYPES.TSInterfaceBody) {
8640
8851
  return true;
8641
8852
  }
8642
- if (parent?.type !== "TSTypeLiteral") {
8643
- return false;
8644
- }
8645
8853
  const maybeTypeAliasDeclaration = parent.parent;
8646
- return maybeTypeAliasDeclaration?.type === "TSTypeAliasDeclaration";
8854
+ return maybeTypeAliasDeclaration.type === import_utils70.AST_NODE_TYPES.TSTypeAliasDeclaration;
8647
8855
  };
8648
8856
  var rule125 = ruleCreator({
8649
8857
  create: (context) => ({
@@ -8695,19 +8903,20 @@ var rule125 = ruleCreator({
8695
8903
  var typescript_require_readonly_set_property_type_default = rule125;
8696
8904
 
8697
8905
  // dist/rules/typescript-require-readonly-set-return-type.js
8906
+ var import_utils71 = require("@typescript-eslint/utils");
8698
8907
  var functionLikeNodeSelector9 = ":matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSConstructorType, TSDeclareFunction, TSEmptyBodyFunctionExpression, TSFunctionType, TSMethodSignature)";
8699
8908
  var getReturnTypeAnnotationFromFunctionLikeNode4 = (node) => {
8700
- if (node.type === "ArrowFunctionExpression" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "TSCallSignatureDeclaration" || node.type === "TSConstructSignatureDeclaration" || node.type === "TSConstructorType" || node.type === "TSDeclareFunction" || node.type === "TSEmptyBodyFunctionExpression" || node.type === "TSFunctionType" || node.type === "TSMethodSignature") {
8909
+ if (node.type === import_utils71.AST_NODE_TYPES.ArrowFunctionExpression || node.type === import_utils71.AST_NODE_TYPES.FunctionDeclaration || node.type === import_utils71.AST_NODE_TYPES.FunctionExpression || node.type === import_utils71.AST_NODE_TYPES.TSCallSignatureDeclaration || node.type === import_utils71.AST_NODE_TYPES.TSConstructSignatureDeclaration || node.type === import_utils71.AST_NODE_TYPES.TSConstructorType || node.type === import_utils71.AST_NODE_TYPES.TSDeclareFunction || node.type === import_utils71.AST_NODE_TYPES.TSEmptyBodyFunctionExpression || node.type === import_utils71.AST_NODE_TYPES.TSFunctionType || node.type === import_utils71.AST_NODE_TYPES.TSMethodSignature) {
8701
8910
  return node.returnType;
8702
8911
  }
8703
8912
  return void 0;
8704
8913
  };
8705
- var isSetTypeReference3 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Set";
8914
+ var isSetTypeReference3 = (node) => node.typeName.type === import_utils71.AST_NODE_TYPES.Identifier && node.typeName.name === "Set";
8706
8915
  var collectMutableSetTypeNodes3 = (typeNode) => {
8707
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8916
+ if (typeNode.type === import_utils71.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils71.AST_NODE_TYPES.TSUnionType) {
8708
8917
  return typeNode.types.flatMap((subTypeNode) => collectMutableSetTypeNodes3(subTypeNode));
8709
8918
  }
8710
- if (typeNode.type !== "TSTypeReference" || !isSetTypeReference3(typeNode)) {
8919
+ if (typeNode.type !== import_utils71.AST_NODE_TYPES.TSTypeReference || !isSetTypeReference3(typeNode)) {
8711
8920
  return [];
8712
8921
  }
8713
8922
  return [typeNode.typeName];
@@ -8760,12 +8969,13 @@ var rule126 = ruleCreator({
8760
8969
  var typescript_require_readonly_set_return_type_default = rule126;
8761
8970
 
8762
8971
  // dist/rules/typescript-require-readonly-set-type-alias.js
8763
- var isSetTypeReference4 = (node) => node.typeName.type === "Identifier" && node.typeName.name === "Set";
8972
+ var import_utils72 = require("@typescript-eslint/utils");
8973
+ var isSetTypeReference4 = (node) => node.typeName.type === import_utils72.AST_NODE_TYPES.Identifier && node.typeName.name === "Set";
8764
8974
  var collectMutableSetTypeNodes4 = (typeNode) => {
8765
- if (typeNode.type === "TSIntersectionType" || typeNode.type === "TSUnionType") {
8975
+ if (typeNode.type === import_utils72.AST_NODE_TYPES.TSIntersectionType || typeNode.type === import_utils72.AST_NODE_TYPES.TSUnionType) {
8766
8976
  return typeNode.types.flatMap((subTypeNode) => collectMutableSetTypeNodes4(subTypeNode));
8767
8977
  }
8768
- if (typeNode.type !== "TSTypeReference" || !isSetTypeReference4(typeNode)) {
8978
+ if (typeNode.type !== import_utils72.AST_NODE_TYPES.TSTypeReference || !isSetTypeReference4(typeNode)) {
8769
8979
  return [];
8770
8980
  }
8771
8981
  return [typeNode.typeName];
@@ -8814,11 +9024,12 @@ var rule127 = ruleCreator({
8814
9024
  var typescript_require_readonly_set_type_alias_default = rule127;
8815
9025
 
8816
9026
  // dist/rules/typescript-require-this-void.js
8817
- var import_ts_extras67 = require("ts-extras");
9027
+ var import_utils73 = require("@typescript-eslint/utils");
9028
+ var import_ts_extras69 = require("ts-extras");
8818
9029
  var selector24 = "MethodDefinition[static=true] > FunctionExpression:not([params.0.name='this'][params.0.typeAnnotation.typeAnnotation.type='TSVoidKeyword'])";
8819
9030
  var createThisVoidSuggestionFix = (sourceCode, functionExpression) => {
8820
- const firstParameter = (0, import_ts_extras67.arrayFirst)(functionExpression.params);
8821
- if (firstParameter?.type === "Identifier" && firstParameter.name === "this") {
9031
+ const firstParameter = (0, import_ts_extras69.arrayFirst)(functionExpression.params);
9032
+ if (firstParameter?.type === import_utils73.AST_NODE_TYPES.Identifier && firstParameter.name === "this") {
8822
9033
  const existingTypeAnnotation = firstParameter.typeAnnotation;
8823
9034
  if (existingTypeAnnotation === void 0) {
8824
9035
  return (fixer) => fixer.insertTextAfter(firstParameter, ": void");
@@ -8836,7 +9047,7 @@ var rule128 = ruleCreator({
8836
9047
  const sourceCode = context.sourceCode;
8837
9048
  return {
8838
9049
  [selector24]: (node) => {
8839
- if (node.type !== "FunctionExpression") {
9050
+ if (node.type !== import_utils73.AST_NODE_TYPES.FunctionExpression) {
8840
9051
  return;
8841
9052
  }
8842
9053
  const suggestionFix = createThisVoidSuggestionFix(sourceCode, node);
@@ -8879,9 +9090,10 @@ var rule128 = ruleCreator({
8879
9090
  var typescript_require_this_void_default = rule128;
8880
9091
 
8881
9092
  // dist/rules/underscore-internal.js
8882
- var internalTagPattern = /@internal\b/u;
9093
+ var import_utils74 = require("@typescript-eslint/utils");
9094
+ var internalTagPattern = /@internal\b/v;
8883
9095
  var isNonUnderscoreIdentifier = (identifier) => !identifier.name.startsWith("_");
8884
- var isExportDeclaration = (node) => node?.type === "ExportDefaultDeclaration" || node?.type === "ExportNamedDeclaration";
9096
+ var isExportDeclaration = (node) => node?.type === import_utils74.AST_NODE_TYPES.ExportDefaultDeclaration || node?.type === import_utils74.AST_NODE_TYPES.ExportNamedDeclaration;
8885
9097
  var rule129 = ruleCreator({
8886
9098
  create: (context) => {
8887
9099
  const hasInternalTag = (node) => {
@@ -8917,13 +9129,13 @@ var rule129 = ruleCreator({
8917
9129
  reportIfInternal(node.id, node);
8918
9130
  },
8919
9131
  "MethodDefinition[key.type='Identifier']": (node) => {
8920
- if (node.key.type !== "Identifier") {
9132
+ if (node.key.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8921
9133
  return;
8922
9134
  }
8923
9135
  reportIfInternal(node.key, node);
8924
9136
  },
8925
9137
  "PropertyDefinition[key.type='Identifier']": (node) => {
8926
- if (node.key.type !== "Identifier") {
9138
+ if (node.key.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8927
9139
  return;
8928
9140
  }
8929
9141
  reportIfInternal(node.key, node);
@@ -8932,7 +9144,7 @@ var rule129 = ruleCreator({
8932
9144
  reportIfInternal(node.id, node);
8933
9145
  },
8934
9146
  "TSEnumMember[id.type='Identifier']": (node) => {
8935
- if (node.id.type !== "Identifier") {
9147
+ if (node.id.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8936
9148
  return;
8937
9149
  }
8938
9150
  reportIfInternal(node.id, node);
@@ -8941,13 +9153,13 @@ var rule129 = ruleCreator({
8941
9153
  reportIfInternal(node.id, node);
8942
9154
  },
8943
9155
  "TSMethodSignature[key.type='Identifier']": (node) => {
8944
- if (node.key.type !== "Identifier") {
9156
+ if (node.key.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8945
9157
  return;
8946
9158
  }
8947
9159
  reportIfInternal(node.key, node);
8948
9160
  },
8949
9161
  "TSPropertySignature[key.type='Identifier']": (node) => {
8950
- if (node.key.type !== "Identifier") {
9162
+ if (node.key.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8951
9163
  return;
8952
9164
  }
8953
9165
  reportIfInternal(node.key, node);
@@ -8956,13 +9168,10 @@ var rule129 = ruleCreator({
8956
9168
  reportIfInternal(node.id, node);
8957
9169
  },
8958
9170
  "VariableDeclarator[id.type='Identifier']": (node) => {
8959
- if (node.id.type !== "Identifier") {
9171
+ if (node.id.type !== import_utils74.AST_NODE_TYPES.Identifier) {
8960
9172
  return;
8961
9173
  }
8962
9174
  const declaration = node.parent;
8963
- if (declaration?.type !== "VariableDeclaration") {
8964
- return;
8965
- }
8966
9175
  reportIfInternal(node.id, declaration);
8967
9176
  }
8968
9177
  };
@@ -8990,7 +9199,7 @@ var underscore_internal_default = rule129;
8990
9199
  // dist/rules/unused-internal-properties.js
8991
9200
  var import_eslint_plugin_unicorn3 = __toESM(require("eslint-plugin-unicorn"), 1);
8992
9201
  var rule130 = adaptExternalRule(getExternalRuleFromPlugin(import_eslint_plugin_unicorn3.default, "no-unused-properties", "eslint-plugin-unicorn"), "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/unused-internal-properties");
8993
- var deprecatedRule27 = withDeprecatedRuleLifecycle(rule130, {
9202
+ var deprecatedRule26 = withDeprecatedRuleLifecycle(rule130, {
8994
9203
  message: "Deprecated in favor of unicorn/no-unused-properties.",
8995
9204
  replacedBy: [
8996
9205
  createReplacementRuleInfo({
@@ -9006,12 +9215,12 @@ var deprecatedRule27 = withDeprecatedRuleLifecycle(rule130, {
9006
9215
  ],
9007
9216
  ruleId: "unused-internal-properties"
9008
9217
  });
9009
- var unused_internal_properties_default = deprecatedRule27;
9218
+ var unused_internal_properties_default = deprecatedRule26;
9010
9219
 
9011
9220
  // dist/rules/uppercase-iife.js
9012
9221
  var import_eslint_plugin_unicorn4 = __toESM(require("eslint-plugin-unicorn"), 1);
9013
9222
  var rule131 = adaptExternalRule(getExternalRuleFromPlugin(import_eslint_plugin_unicorn4.default, "no-unreadable-iife", "eslint-plugin-unicorn"), "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/uppercase-iife");
9014
- var deprecatedRule28 = withDeprecatedRuleLifecycle(rule131, {
9223
+ var deprecatedRule27 = withDeprecatedRuleLifecycle(rule131, {
9015
9224
  message: "Deprecated in favor of unicorn/no-unreadable-iife.",
9016
9225
  replacedBy: [
9017
9226
  createReplacementRuleInfo({
@@ -9027,12 +9236,12 @@ var deprecatedRule28 = withDeprecatedRuleLifecycle(rule131, {
9027
9236
  ],
9028
9237
  ruleId: "uppercase-iife"
9029
9238
  });
9030
- var uppercase_iife_default = deprecatedRule28;
9239
+ var uppercase_iife_default = deprecatedRule27;
9031
9240
 
9032
9241
  // dist/rules/words.js
9033
9242
  var import_eslint_plugin_write_good_comments_2 = __toESM(require("eslint-plugin-write-good-comments-2"), 1);
9034
9243
  var rule132 = adaptExternalRule(getExternalRuleFromPlugin(import_eslint_plugin_write_good_comments_2.default, "write-good-comments", "eslint-plugin-write-good-comments-2"), "https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/words");
9035
- var deprecatedRule29 = withDeprecatedRuleLifecycle(rule132, {
9244
+ var deprecatedRule28 = withDeprecatedRuleLifecycle(rule132, {
9036
9245
  message: "Deprecated in favor of write-good-comments/write-good-comments.",
9037
9246
  replacedBy: [
9038
9247
  createReplacementRuleInfo({
@@ -9048,7 +9257,7 @@ var deprecatedRule29 = withDeprecatedRuleLifecycle(rule132, {
9048
9257
  ],
9049
9258
  ruleId: "words"
9050
9259
  });
9051
- var words_default = deprecatedRule29;
9260
+ var words_default = deprecatedRule28;
9052
9261
 
9053
9262
  // dist/rules.js
9054
9263
  var rulesWithRequiredTypeChecking = /* @__PURE__ */ new Set([
@@ -9224,7 +9433,7 @@ var baseRules = {
9224
9433
  "uppercase-iife": uppercase_iife_default,
9225
9434
  words: words_default
9226
9435
  };
9227
- var ruleCatalog = buildRuleCatalog((0, import_ts_extras68.objectKeys)(baseRules));
9436
+ var ruleCatalog = buildRuleCatalog((0, import_ts_extras70.objectKeys)(baseRules));
9228
9437
  var ruleCatalogEntries = ruleCatalog.ordered;
9229
9438
  var ruleCatalogByRuleName = ruleCatalog.byRuleName;
9230
9439
  var ruleCatalogByDocId = ruleCatalog.byDocId;
@@ -9233,8 +9442,9 @@ var withCatalogDocsMetadata = (ruleName, ruleModule) => {
9233
9442
  if (!catalogEntry) {
9234
9443
  throw new Error(`Missing rule catalog entry for rule "${ruleName}".`);
9235
9444
  }
9236
- const currentDocsMetadata = (0, import_ts_extras68.safeCastTo)(ruleModule.meta.docs ?? {});
9237
- const hasRequiredTypeChecking = (0, import_ts_extras68.setHas)(rulesWithRequiredTypeChecking, ruleName);
9445
+ const currentDocsMetadata = ruleModule.meta.docs;
9446
+ (0, import_ts_extras70.assertDefined)(currentDocsMetadata);
9447
+ const hasRequiredTypeChecking = (0, import_ts_extras70.setHas)(rulesWithRequiredTypeChecking, ruleName);
9238
9448
  const deprecatedMetadata = ruleModule.meta.deprecated ?? false;
9239
9449
  const isDeprecatedRule = deprecatedMetadata !== false;
9240
9450
  const docsWithCatalogMetadata = {
@@ -9243,7 +9453,7 @@ var withCatalogDocsMetadata = (ruleName, ruleModule) => {
9243
9453
  catalogIndex: catalogEntry.catalogIndex,
9244
9454
  deprecated: currentDocsMetadata.deprecated ?? isDeprecatedRule,
9245
9455
  frozen: currentDocsMetadata.frozen ?? currentDocsMetadata.deprecated ?? isDeprecatedRule,
9246
- recommended: (0, import_ts_extras68.setHas)(recommendedRuleNames, ruleName),
9456
+ recommended: (0, import_ts_extras70.setHas)(recommendedRuleNames, ruleName),
9247
9457
  requiresTypeChecking: currentDocsMetadata.requiresTypeChecking ?? hasRequiredTypeChecking,
9248
9458
  ruleName
9249
9459
  };
@@ -9256,7 +9466,7 @@ var withCatalogDocsMetadata = (ruleName, ruleModule) => {
9256
9466
  }
9257
9467
  };
9258
9468
  };
9259
- var decoratedRuleEntries = (0, import_ts_extras68.objectEntries)(baseRules).map(([ruleName, ruleModule]) => [ruleName, withCatalogDocsMetadata(ruleName, ruleModule)]);
9469
+ var decoratedRuleEntries = (0, import_ts_extras70.objectEntries)(baseRules).map(([ruleName, ruleModule]) => [ruleName, withCatalogDocsMetadata(ruleName, ruleModule)]);
9260
9470
  var decoratedRulesAccumulator = {};
9261
9471
  for (const [ruleName, ruleModule] of decoratedRuleEntries) {
9262
9472
  decoratedRulesAccumulator = {
@@ -9268,26 +9478,35 @@ var decoratedRules = decoratedRulesAccumulator;
9268
9478
  var rules = Object.freeze(decoratedRules);
9269
9479
 
9270
9480
  // dist/configs/all-strict.js
9271
- var allStrictRuleEntries = (0, import_ts_extras69.objectEntries)(rules).map(([ruleName, ruleModule]) => [
9272
- `etc-misc/${ruleName}`,
9273
- ruleModule.meta.deprecated === false ? "error" : "warn"
9274
- ]);
9275
- var allStrictRules = (0, import_ts_extras69.objectFromEntries)(allStrictRuleEntries);
9481
+ var allStrictRulesAccumulator = {};
9482
+ for (const [ruleName, ruleModule] of (0, import_ts_extras71.objectEntries)(rules)) {
9483
+ allStrictRulesAccumulator = {
9484
+ ...allStrictRulesAccumulator,
9485
+ [`etc-misc/${ruleName}`]: ruleModule.meta.deprecated === false ? "error" : "warn"
9486
+ };
9487
+ }
9488
+ var allStrictRules = Object.freeze(allStrictRulesAccumulator);
9276
9489
  var allStrict = {
9277
9490
  name: "etc-misc/all-strict",
9278
9491
  rules: allStrictRules
9279
9492
  };
9280
9493
 
9281
9494
  // dist/configs/all.js
9282
- var import_ts_extras70 = require("ts-extras");
9495
+ var import_ts_extras72 = require("ts-extras");
9283
9496
  var getAllPresetSeverity = (ruleModule) => {
9284
9497
  if (ruleModule.meta.deprecated !== false) {
9285
9498
  return "warn";
9286
9499
  }
9287
9500
  return ruleModule.meta.type === "problem" ? "error" : "warn";
9288
9501
  };
9289
- var allRuleEntries = (0, import_ts_extras70.objectEntries)(rules).map(([ruleName, ruleModule]) => [`etc-misc/${ruleName}`, getAllPresetSeverity(ruleModule)]);
9290
- var allRules = (0, import_ts_extras70.objectFromEntries)(allRuleEntries);
9502
+ var allRulesAccumulator = {};
9503
+ for (const [ruleName, ruleModule] of (0, import_ts_extras72.objectEntries)(rules)) {
9504
+ allRulesAccumulator = {
9505
+ ...allRulesAccumulator,
9506
+ [`etc-misc/${ruleName}`]: getAllPresetSeverity(ruleModule)
9507
+ };
9508
+ }
9509
+ var allRules = Object.freeze(allRulesAccumulator);
9291
9510
  var all = {
9292
9511
  name: "etc-misc/all",
9293
9512
  rules: allRules
@@ -9347,35 +9566,41 @@ var recommended = {
9347
9566
  };
9348
9567
 
9349
9568
  // dist/configs/strict-type-checked.js
9350
- var import_ts_extras72 = require("ts-extras");
9569
+ var import_ts_extras74 = require("ts-extras");
9351
9570
 
9352
9571
  // dist/configs/strict.js
9353
- var import_ts_extras71 = require("ts-extras");
9354
- var recommendedRuleNames2 = (0, import_ts_extras71.safeCastTo)((0, import_ts_extras71.objectKeys)(recommended.rules));
9355
- var strictRules = (0, import_ts_extras71.objectFromEntries)(recommendedRuleNames2.map((ruleName) => [ruleName, "error"]));
9572
+ var import_ts_extras73 = require("ts-extras");
9573
+ var recommendedRuleNames2 = (0, import_ts_extras73.safeCastTo)((0, import_ts_extras73.objectKeys)(recommended.rules));
9574
+ var strictRulesCandidate = (0, import_ts_extras73.objectFromEntries)(recommendedRuleNames2.map((ruleName) => [ruleName, "error"]));
9575
+ var hasStrictRuleCoverage = (candidateRules) => recommendedRuleNames2.every((ruleName) => candidateRules[ruleName] === "error");
9576
+ if (!hasStrictRuleCoverage(strictRulesCandidate)) {
9577
+ throw new Error("Strict preset synthesis failed to include every recommended rule.");
9578
+ }
9579
+ var strictRules = strictRulesCandidate;
9356
9580
  var strict = {
9357
9581
  name: "etc-misc/strict",
9358
9582
  rules: strictRules
9359
9583
  };
9360
9584
 
9361
9585
  // dist/configs/strict-type-checked.js
9362
- var additionalTypeCheckedRuleEntries = (0, import_ts_extras72.objectEntries)(rules).flatMap(([ruleName, ruleModule]) => {
9586
+ var additionalTypeCheckedRuleEntries = (0, import_ts_extras74.objectEntries)(rules).flatMap(([ruleName, ruleModule]) => {
9363
9587
  if (ruleModule.meta.deprecated !== false) {
9364
9588
  return [];
9365
9589
  }
9366
- const docsMetadata = ruleModule.meta.docs;
9590
+ const docsMetadata = (0, import_ts_extras74.safeCastTo)(ruleModule.meta.docs);
9367
9591
  if (docsMetadata?.requiresTypeChecking !== true) {
9368
9592
  return [];
9369
9593
  }
9370
9594
  const qualifiedRuleName = `etc-misc/${ruleName}`;
9371
- if ((0, import_ts_extras72.keyIn)(strict.rules, qualifiedRuleName)) {
9595
+ if ((0, import_ts_extras74.objectHasOwn)(strict.rules, qualifiedRuleName)) {
9372
9596
  return [];
9373
9597
  }
9374
- return [[qualifiedRuleName, "error"]];
9598
+ const severity = "error";
9599
+ return [[qualifiedRuleName, severity]];
9375
9600
  });
9376
9601
  var strictTypeCheckedRules = {
9377
9602
  ...strict.rules,
9378
- ...(0, import_ts_extras72.objectFromEntries)(additionalTypeCheckedRuleEntries)
9603
+ ...(0, import_ts_extras74.objectFromEntries)(additionalTypeCheckedRuleEntries)
9379
9604
  };
9380
9605
  var strictTypeChecked = {
9381
9606
  languageOptions: {
@@ -9412,13 +9637,13 @@ var configs = {
9412
9637
  };
9413
9638
 
9414
9639
  // dist/plugin.js
9415
- var plugin = {
9640
+ var plugin2 = {
9416
9641
  configs,
9417
9642
  meta: pluginMeta,
9418
9643
  processors: {},
9419
9644
  rules
9420
9645
  };
9421
- var plugin_default = plugin;
9646
+ var plugin_default = plugin2;
9422
9647
  /**
9423
9648
  * @license Use of this source code is governed by an MIT-style license that can
9424
9649
  * be found in the LICENSE file at