eslint-plugin-ts-data-forge 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/index.d.mts +5 -0
  2. package/dist/index.d.mts.map +1 -0
  3. package/dist/index.mjs +3 -0
  4. package/dist/index.mjs.map +1 -0
  5. package/dist/plugin.d.mts +3 -0
  6. package/dist/plugin.d.mts.map +1 -0
  7. package/dist/plugin.mjs +11 -0
  8. package/dist/plugin.mjs.map +1 -0
  9. package/dist/rule-types.d.mts +279 -0
  10. package/dist/rule-types.d.mts.map +1 -0
  11. package/dist/rule-types.mjs +2 -0
  12. package/dist/rule-types.mjs.map +1 -0
  13. package/dist/rules/ast-utils.d.mts +29 -0
  14. package/dist/rules/ast-utils.d.mts.map +1 -0
  15. package/dist/rules/ast-utils.mjs +54 -0
  16. package/dist/rules/ast-utils.mjs.map +1 -0
  17. package/dist/rules/branded-number-types.d.mts +5 -0
  18. package/dist/rules/branded-number-types.d.mts.map +1 -0
  19. package/dist/rules/branded-number-types.mjs +40 -0
  20. package/dist/rules/branded-number-types.mjs.map +1 -0
  21. package/dist/rules/constants.d.mts +2 -0
  22. package/dist/rules/constants.d.mts.map +1 -0
  23. package/dist/rules/constants.mjs +4 -0
  24. package/dist/rules/constants.mjs.map +1 -0
  25. package/dist/rules/import-utils.d.mts +30 -0
  26. package/dist/rules/import-utils.d.mts.map +1 -0
  27. package/dist/rules/import-utils.mjs +61 -0
  28. package/dist/rules/import-utils.mjs.map +1 -0
  29. package/dist/rules/index.d.mts +2 -0
  30. package/dist/rules/index.d.mts.map +1 -0
  31. package/dist/rules/index.mjs +2 -0
  32. package/dist/rules/index.mjs.map +1 -0
  33. package/dist/rules/no-unnecessary-type-guard.d.mts +11 -0
  34. package/dist/rules/no-unnecessary-type-guard.d.mts.map +1 -0
  35. package/dist/rules/no-unnecessary-type-guard.mjs +278 -0
  36. package/dist/rules/no-unnecessary-type-guard.mjs.map +1 -0
  37. package/dist/rules/prefer-arr-is-array.d.mts +6 -0
  38. package/dist/rules/prefer-arr-is-array.d.mts.map +1 -0
  39. package/dist/rules/prefer-arr-is-array.mjs +57 -0
  40. package/dist/rules/prefer-arr-is-array.mjs.map +1 -0
  41. package/dist/rules/prefer-arr-is-bounded-length-array.d.mts +6 -0
  42. package/dist/rules/prefer-arr-is-bounded-length-array.d.mts.map +1 -0
  43. package/dist/rules/prefer-arr-is-bounded-length-array.mjs +89 -0
  44. package/dist/rules/prefer-arr-is-bounded-length-array.mjs.map +1 -0
  45. package/dist/rules/prefer-arr-is-fixed-length-array.d.mts +6 -0
  46. package/dist/rules/prefer-arr-is-fixed-length-array.d.mts.map +1 -0
  47. package/dist/rules/prefer-arr-is-fixed-length-array.mjs +87 -0
  48. package/dist/rules/prefer-arr-is-fixed-length-array.mjs.map +1 -0
  49. package/dist/rules/prefer-arr-is-max-length-array.d.mts +6 -0
  50. package/dist/rules/prefer-arr-is-max-length-array.d.mts.map +1 -0
  51. package/dist/rules/prefer-arr-is-max-length-array.mjs +83 -0
  52. package/dist/rules/prefer-arr-is-max-length-array.mjs.map +1 -0
  53. package/dist/rules/prefer-arr-is-min-length-array.d.mts +6 -0
  54. package/dist/rules/prefer-arr-is-min-length-array.d.mts.map +1 -0
  55. package/dist/rules/prefer-arr-is-min-length-array.mjs +83 -0
  56. package/dist/rules/prefer-arr-is-min-length-array.mjs.map +1 -0
  57. package/dist/rules/prefer-arr-is-non-empty.d.mts +6 -0
  58. package/dist/rules/prefer-arr-is-non-empty.d.mts.map +1 -0
  59. package/dist/rules/prefer-arr-is-non-empty.mjs +80 -0
  60. package/dist/rules/prefer-arr-is-non-empty.mjs.map +1 -0
  61. package/dist/rules/prefer-arr-sum.d.mts +6 -0
  62. package/dist/rules/prefer-arr-sum.d.mts.map +1 -0
  63. package/dist/rules/prefer-arr-sum.mjs +136 -0
  64. package/dist/rules/prefer-arr-sum.mjs.map +1 -0
  65. package/dist/rules/prefer-as-int.d.mts +6 -0
  66. package/dist/rules/prefer-as-int.d.mts.map +1 -0
  67. package/dist/rules/prefer-as-int.mjs +77 -0
  68. package/dist/rules/prefer-as-int.mjs.map +1 -0
  69. package/dist/rules/prefer-canonical-array-slicing.d.mts +6 -0
  70. package/dist/rules/prefer-canonical-array-slicing.d.mts.map +1 -0
  71. package/dist/rules/prefer-canonical-array-slicing.mjs +362 -0
  72. package/dist/rules/prefer-canonical-array-slicing.mjs.map +1 -0
  73. package/dist/rules/prefer-comparison-over-nullish-guard.d.mts +6 -0
  74. package/dist/rules/prefer-comparison-over-nullish-guard.d.mts.map +1 -0
  75. package/dist/rules/prefer-comparison-over-nullish-guard.mjs +80 -0
  76. package/dist/rules/prefer-comparison-over-nullish-guard.mjs.map +1 -0
  77. package/dist/rules/prefer-is-non-null-object.d.mts +6 -0
  78. package/dist/rules/prefer-is-non-null-object.d.mts.map +1 -0
  79. package/dist/rules/prefer-is-non-null-object.mjs +81 -0
  80. package/dist/rules/prefer-is-non-null-object.mjs.map +1 -0
  81. package/dist/rules/prefer-is-record-and-has-key.d.mts +6 -0
  82. package/dist/rules/prefer-is-record-and-has-key.d.mts.map +1 -0
  83. package/dist/rules/prefer-is-record-and-has-key.mjs +97 -0
  84. package/dist/rules/prefer-is-record-and-has-key.mjs.map +1 -0
  85. package/dist/rules/prefer-num-safe-parse-float.d.mts +14 -0
  86. package/dist/rules/prefer-num-safe-parse-float.d.mts.map +1 -0
  87. package/dist/rules/prefer-num-safe-parse-float.mjs +84 -0
  88. package/dist/rules/prefer-num-safe-parse-float.mjs.map +1 -0
  89. package/dist/rules/prefer-num-safe-parse-int.d.mts +14 -0
  90. package/dist/rules/prefer-num-safe-parse-int.d.mts.map +1 -0
  91. package/dist/rules/prefer-num-safe-parse-int.mjs +88 -0
  92. package/dist/rules/prefer-num-safe-parse-int.mjs.map +1 -0
  93. package/dist/rules/prefer-range-for-loop.d.mts +6 -0
  94. package/dist/rules/prefer-range-for-loop.d.mts.map +1 -0
  95. package/dist/rules/prefer-range-for-loop.mjs +103 -0
  96. package/dist/rules/prefer-range-for-loop.mjs.map +1 -0
  97. package/dist/rules/rules.d.mts +21 -0
  98. package/dist/rules/rules.d.mts.map +1 -0
  99. package/dist/rules/rules.mjs +38 -0
  100. package/dist/rules/rules.mjs.map +1 -0
  101. package/dist/types.d.mts +4 -0
  102. package/dist/types.d.mts.map +1 -0
  103. package/dist/types.mjs +2 -0
  104. package/dist/types.mjs.map +1 -0
  105. package/package.json +20 -20
@@ -0,0 +1,5 @@
1
+ export { eslintPluginTsDataForge } from './plugin.mjs';
2
+ export type { EslintTsDataForgeRules, EslintTsDataForgeRulesOption, } from './rule-types.mjs';
3
+ export { tsDataForgeRules } from './rules/index.mjs';
4
+ export { type ESLintPlugin } from './types.mjs';
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EACV,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ export { eslintPluginTsDataForge } from './plugin.mjs';
2
+ export { tsDataForgeRules } from './rules/rules.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
1
+ import { type ESLintPlugin } from './types.mjs';
2
+ export declare const eslintPluginTsDataForge: ESLintPlugin;
3
+ //# sourceMappingURL=plugin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../src/plugin.mts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,uBAAuB,EAAE,YAK5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { tsDataForgeRules } from './rules/rules.mjs';
2
+
3
+ const eslintPluginTsDataForge = {
4
+ meta: {
5
+ name: "eslint-plugin-ts-data-forge"
6
+ },
7
+ rules: tsDataForgeRules
8
+ };
9
+
10
+ export { eslintPluginTsDataForge };
11
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","sources":["../src/plugin.mts"],"sourcesContent":["import { tsDataForgeRules } from './rules/index.mjs';\nimport { type ESLintPlugin } from './types.mjs';\n\nexport const eslintPluginTsDataForge: ESLintPlugin = {\n meta: {\n name: 'eslint-plugin-ts-data-forge',\n },\n rules: tsDataForgeRules,\n} as const;\n"],"names":[],"mappings":";;AAGO,MAAM,uBAAA,GAAwC;AAAA,EACnD,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA,EACA,KAAA,EAAO;AACT;;;;"}
@@ -0,0 +1,279 @@
1
+ import { type TSESLint } from '@typescript-eslint/utils';
2
+ import { type Linter } from 'eslint';
3
+ import { type tsDataForgeRules } from './rules/index.mjs';
4
+ type SpreadOptionsIfIsArray<T extends readonly [Linter.StringSeverity, unknown]> = T[1] extends readonly unknown[] ? readonly [Linter.StringSeverity, ...T[1]] : T;
5
+ /**
6
+ * Extracts the options tuple type of a rule from its TypeScript
7
+ * implementation, so that option types stay in sync with the rule source
8
+ * without converting `meta.schema` (JSON Schema) back into TypeScript types.
9
+ */
10
+ type RuleOptionsOf<Name extends keyof typeof tsDataForgeRules> = (typeof tsDataForgeRules)[Name] extends TSESLint.RuleModule<infer _MessageIds extends string, infer Options extends readonly unknown[]> ? Options : never;
11
+ /**
12
+ * @description Unify non-mutating array element addition/removal patterns (`slice` / `toSpliced` / `filter` / `concat` / spread) into the corresponding ts-data-forge functions: `Arr.tail`, `Arr.skip`, `Arr.take`, `Arr.butLast`, `Arr.skipLast`, `Arr.takeLast`, `Arr.toUnshifted`, `Arr.toPushed`.
13
+ *
14
+ * ```md
15
+ * | key | value |
16
+ * | :--------- | :--------- |
17
+ * | type | suggestion |
18
+ * | deprecated | false |
19
+ * | fixable | code |
20
+ * ```
21
+ */
22
+ declare namespace PreferCanonicalArraySlicing {
23
+ type RuleEntry = Linter.StringSeverity;
24
+ }
25
+ /**
26
+ * @description Replace `xs.length >= n` with `Arr.isMinLengthArray(xs, n)` from ts-data-forge.
27
+ *
28
+ * ```md
29
+ * | key | value |
30
+ * | :--------- | :--------- |
31
+ * | type | suggestion |
32
+ * | deprecated | false |
33
+ * | fixable | code |
34
+ * ```
35
+ */
36
+ declare namespace PreferArrIsMinLengthArray {
37
+ type RuleEntry = Linter.StringSeverity;
38
+ }
39
+ /**
40
+ * @description Replace `xs.length <= n` with `Arr.isMaxLengthArray(xs, n)` from ts-data-forge.
41
+ *
42
+ * ```md
43
+ * | key | value |
44
+ * | :--------- | :--------- |
45
+ * | type | suggestion |
46
+ * | deprecated | false |
47
+ * | fixable | code |
48
+ * ```
49
+ */
50
+ declare namespace PreferArrIsMaxLengthArray {
51
+ type RuleEntry = Linter.StringSeverity;
52
+ }
53
+ /**
54
+ * @description Replace `xs.length >= min && xs.length <= max` with `Arr.isBoundedLengthArray(xs, min, max)` from ts-data-forge.
55
+ *
56
+ * ```md
57
+ * | key | value |
58
+ * | :--------- | :--------- |
59
+ * | type | suggestion |
60
+ * | deprecated | false |
61
+ * | fixable | code |
62
+ * ```
63
+ */
64
+ declare namespace PreferArrIsBoundedLengthArray {
65
+ type RuleEntry = Linter.StringSeverity;
66
+ }
67
+ /**
68
+ * @description Replace `xs.length === n` with `Arr.isFixedLengthArray(xs, n)` from ts-data-forge.
69
+ *
70
+ * ```md
71
+ * | key | value |
72
+ * | :--------- | :--------- |
73
+ * | type | suggestion |
74
+ * | deprecated | false |
75
+ * | fixable | code |
76
+ * ```
77
+ */
78
+ declare namespace PreferArrIsFixedLengthArray {
79
+ type RuleEntry = Linter.StringSeverity;
80
+ }
81
+ /**
82
+ * @description Replace `Array.isArray` with `Arr.isArray` from ts-data-forge.
83
+ *
84
+ * ```md
85
+ * | key | value |
86
+ * | :--------- | :--------- |
87
+ * | type | suggestion |
88
+ * | deprecated | false |
89
+ * | fixable | code |
90
+ * ```
91
+ */
92
+ declare namespace PreferArrIsArray {
93
+ type RuleEntry = Linter.StringSeverity;
94
+ }
95
+ /**
96
+ * @description Replace `xs.length > 0` with `Arr.isNonEmpty(xs)` from ts-data-forge.
97
+ *
98
+ * ```md
99
+ * | key | value |
100
+ * | :--------- | :--------- |
101
+ * | type | suggestion |
102
+ * | deprecated | false |
103
+ * | fixable | code |
104
+ * ```
105
+ */
106
+ declare namespace PreferArrIsNonEmpty {
107
+ type RuleEntry = Linter.StringSeverity;
108
+ }
109
+ /**
110
+ * @description Replace `xs.reduce((a, b) => a + b, 0)` with `Arr.sum(xs)` or `Arr.sumBy(xs, fn)` from ts-data-forge.
111
+ *
112
+ * ```md
113
+ * | key | value |
114
+ * | :--------- | :--------- |
115
+ * | type | suggestion |
116
+ * | deprecated | false |
117
+ * | fixable | code |
118
+ * ```
119
+ */
120
+ declare namespace PreferArrSum {
121
+ type RuleEntry = Linter.StringSeverity;
122
+ }
123
+ /**
124
+ * @description Replace branded number type assertions (e.g., `as Int`) with corresponding functions (e.g., `asInt()`) from ts-data-forge.
125
+ *
126
+ * ```md
127
+ * | key | value |
128
+ * | :--------- | :--------- |
129
+ * | type | suggestion |
130
+ * | deprecated | false |
131
+ * | fixable | code |
132
+ * ```
133
+ */
134
+ declare namespace PreferAsInt {
135
+ type RuleEntry = Linter.StringSeverity;
136
+ }
137
+ /**
138
+ * @description Replace `typeof u === "object" && u !== null` with `isNonNullObject(u)` from ts-data-forge.
139
+ *
140
+ * ```md
141
+ * | key | value |
142
+ * | :--------- | :--------- |
143
+ * | type | suggestion |
144
+ * | deprecated | false |
145
+ * | fixable | code |
146
+ * ```
147
+ */
148
+ declare namespace PreferIsNonNullObject {
149
+ type RuleEntry = Linter.StringSeverity;
150
+ }
151
+ /**
152
+ * @description Replace `for (let i = begin; i < end; ++i)` with `for (const i of range(begin, end))` from ts-data-forge.
153
+ *
154
+ * ```md
155
+ * | key | value |
156
+ * | :--------- | :--------- |
157
+ * | type | suggestion |
158
+ * | deprecated | false |
159
+ * | fixable | code |
160
+ * ```
161
+ */
162
+ declare namespace PreferRangeForLoop {
163
+ type RuleEntry = Linter.StringSeverity;
164
+ }
165
+ /**
166
+ * @description Replace `Object.hasOwn(obj, key)` or `key in obj` with `isRecord(obj) && hasKey(obj, key)` from ts-data-forge
167
+ *
168
+ * ```md
169
+ * | key | value |
170
+ * | :--------- | :--------- |
171
+ * | type | suggestion |
172
+ * | deprecated | false |
173
+ * | fixable | code |
174
+ * ```
175
+ */
176
+ declare namespace PreferIsRecordAndHasKey {
177
+ type RuleEntry = Linter.StringSeverity;
178
+ }
179
+ /**
180
+ * @description Replace `parseInt(x, 10)` with `Result.unwrapOkOr(Num.safeParseInt(x), Number.NaN)` from ts-data-forge.
181
+ *
182
+ * ```md
183
+ * | key | value |
184
+ * | :--------- | :--------- |
185
+ * | type | suggestion |
186
+ * | deprecated | false |
187
+ * | fixable | code |
188
+ * ```
189
+ */
190
+ declare namespace PreferNumSafeParseInt {
191
+ type RuleEntry = Linter.StringSeverity;
192
+ }
193
+ /**
194
+ * @description Replace `parseFloat(x)`, `Number.parseFloat(x)`, or `Number(x)` (when x is a string) with `Result.unwrapOkOr(Num.safeParseFloat(x), Number.NaN)` from ts-data-forge.
195
+ *
196
+ * ```md
197
+ * | key | value |
198
+ * | :--------- | :--------- |
199
+ * | type | suggestion |
200
+ * | deprecated | false |
201
+ * | fixable | code |
202
+ * ```
203
+ */
204
+ declare namespace PreferNumSafeParseFloat {
205
+ type RuleEntry = Linter.StringSeverity;
206
+ }
207
+ /**
208
+ * @description Detect ts-data-forge type guard calls that perform no narrowing (the argument type already satisfies, or can never satisfy, the guard).
209
+ *
210
+ * ```md
211
+ * | key | value |
212
+ * | :--------- | :--------- |
213
+ * | type | suggestion |
214
+ * | deprecated | false |
215
+ * | fixable | code |
216
+ * ```
217
+ */
218
+ declare namespace NoUnnecessaryTypeGuard {
219
+ /**
220
+ * ### schema
221
+ *
222
+ * ```json
223
+ * [
224
+ * {
225
+ * "type": "object",
226
+ * "properties": {
227
+ * "ignore": {
228
+ * "type": "array",
229
+ * "items": {
230
+ * "type": "string"
231
+ * },
232
+ * "description": "Names of ts-data-forge guard functions to skip checking."
233
+ * }
234
+ * },
235
+ * "additionalProperties": false
236
+ * }
237
+ * ]
238
+ * ```
239
+ */
240
+ type Options = NonNullable<RuleOptionsOf<'no-unnecessary-type-guard'>[0]>;
241
+ type RuleEntry = 'off' | Linter.Severity | SpreadOptionsIfIsArray<readonly [Linter.StringSeverity, Options]>;
242
+ }
243
+ /**
244
+ * @description Prefer a direct `=== null` / `!== undefined` comparison over calling `isNull`, `isNotNull`, `isUndefined`, or `isNotUndefined` with an explicit argument (those guards are intended for point-free use such as `xs.filter(isNotUndefined)`).
245
+ *
246
+ * ```md
247
+ * | key | value |
248
+ * | :--------- | :--------- |
249
+ * | type | suggestion |
250
+ * | deprecated | false |
251
+ * | fixable | code |
252
+ * ```
253
+ */
254
+ declare namespace PreferComparisonOverNullishGuard {
255
+ type RuleEntry = Linter.StringSeverity;
256
+ }
257
+ export type EslintTsDataForgeRules = Readonly<{
258
+ 'ts-data-forge/prefer-canonical-array-slicing': PreferCanonicalArraySlicing.RuleEntry;
259
+ 'ts-data-forge/prefer-arr-is-min-length-array': PreferArrIsMinLengthArray.RuleEntry;
260
+ 'ts-data-forge/prefer-arr-is-max-length-array': PreferArrIsMaxLengthArray.RuleEntry;
261
+ 'ts-data-forge/prefer-arr-is-bounded-length-array': PreferArrIsBoundedLengthArray.RuleEntry;
262
+ 'ts-data-forge/prefer-arr-is-fixed-length-array': PreferArrIsFixedLengthArray.RuleEntry;
263
+ 'ts-data-forge/prefer-arr-is-array': PreferArrIsArray.RuleEntry;
264
+ 'ts-data-forge/prefer-arr-is-non-empty': PreferArrIsNonEmpty.RuleEntry;
265
+ 'ts-data-forge/prefer-arr-sum': PreferArrSum.RuleEntry;
266
+ 'ts-data-forge/prefer-as-int': PreferAsInt.RuleEntry;
267
+ 'ts-data-forge/prefer-is-non-null-object': PreferIsNonNullObject.RuleEntry;
268
+ 'ts-data-forge/prefer-range-for-loop': PreferRangeForLoop.RuleEntry;
269
+ 'ts-data-forge/prefer-is-record-and-has-key': PreferIsRecordAndHasKey.RuleEntry;
270
+ 'ts-data-forge/prefer-num-safe-parse-int': PreferNumSafeParseInt.RuleEntry;
271
+ 'ts-data-forge/prefer-num-safe-parse-float': PreferNumSafeParseFloat.RuleEntry;
272
+ 'ts-data-forge/no-unnecessary-type-guard': NoUnnecessaryTypeGuard.RuleEntry;
273
+ 'ts-data-forge/prefer-comparison-over-nullish-guard': PreferComparisonOverNullishGuard.RuleEntry;
274
+ }>;
275
+ export type EslintTsDataForgeRulesOption = Readonly<{
276
+ 'ts-data-forge/no-unnecessary-type-guard': NoUnnecessaryTypeGuard.Options;
277
+ }>;
278
+ export {};
279
+ //# sourceMappingURL=rule-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-types.d.mts","sourceRoot":"","sources":["../src/rule-types.mts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,KAAK,sBAAsB,CACzB,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC,IACjD,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAC/B,SAAS,CAAC,MAAM,CA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C,SAAS,CAAC;IACxF,mCAAmC,EAAE,gBAAgB,CAAC,SAAS,CAAC;IAChE,uCAAuC,EAAE,mBAAmB,CAAC,SAAS,CAAC;IACvE,8BAA8B,EAAE,YAAY,CAAC,SAAS,CAAC;IACvD,6BAA6B,EAAE,WAAW,CAAC,SAAS,CAAC;IACrD,yCAAyC,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAC3E,qCAAqC,EAAE,kBAAkB,CAAC,SAAS,CAAC;IACpE,4CAA4C,EAAE,uBAAuB,CAAC,SAAS,CAAC;IAChF,yCAAyC,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAC3E,2CAA2C,EAAE,uBAAuB,CAAC,SAAS,CAAC;IAC/E,yCAAyC,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAC5E,oDAAoD,EAAE,gCAAgC,CAAC,SAAS,CAAC;CAClG,CAAC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,yCAAyC,EAAE,sBAAsB,CAAC,OAAO,CAAC;CAC3E,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import 'ts-data-forge';
2
+ //# sourceMappingURL=rule-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
2
+ import { type DeepReadonly } from 'ts-type-forge';
3
+ export declare const isIntegerLiteralOrConstant: (node: DeepReadonly<TSESTree.Expression>, sourceCode: TSESLint.SourceCode) => boolean;
4
+ export declare const isLengthAccess: (node: DeepReadonly<TSESTree.Expression>) => node is TSESTree.MemberExpression;
5
+ type LengthComparison = Readonly<{
6
+ array: TSESTree.Expression;
7
+ bound: TSESTree.Expression;
8
+ kind: 'max' | 'min';
9
+ }>;
10
+ /**
11
+ * Parses a `<array>.length <op> <bound>` comparison (in either operand order)
12
+ * into its array expression, integer-literal/`const` `bound`, and whether it is
13
+ * a lower (`min`) or upper (`max`) length bound. Returns `undefined` for
14
+ * anything else.
15
+ *
16
+ * - `xs.length >= n` / `n <= xs.length` → `min`
17
+ * - `xs.length <= n` / `n >= xs.length` → `max`
18
+ */
19
+ export declare const parseLengthComparison: (node: TSESTree.Expression, sourceCode: TSESLint.SourceCode) => LengthComparison | undefined;
20
+ /**
21
+ * `true` when `node` is one operand of an `a && b` whose other operand is the
22
+ * complementary length bound (`min` vs `max`) on the same array — i.e. the two
23
+ * together form the `Arr.isBoundedLengthArray` pattern handled by
24
+ * `prefer-arr-is-bounded-length-array`. The single-bound rules skip such
25
+ * operands so the bounded rule rewrites the whole `&&` instead of the parts.
26
+ */
27
+ export declare const isPartOfBoundedLengthCheck: (node: TSESTree.BinaryExpression, sourceCode: TSESLint.SourceCode) => boolean;
28
+ export {};
29
+ //# sourceMappingURL=ast-utils.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-utils.d.mts","sourceRoot":"","sources":["../../src/rules/ast-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAOlD,eAAO,MAAM,0BAA0B,SAC/B,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,cAE3B,QAAQ,CAAC,UAAU,KAC9B,OAgCF,CAAC;AAEF,eAAO,MAAM,cAAc,SACnB,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,KACtC,IAAI,IAAI,QAAQ,CAAC,gBAGa,CAAC;AAElC,KAAK,gBAAgB,GAAG,QAAQ,CAAC;IAC/B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC3B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC;IAC3B,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAE1B,QAAQ,CAAC,UAAU,cAEb,QAAQ,CAAC,UAAU,KAC9B,gBAAgB,GAAG,SA2BrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,SAE/B,QAAQ,CAAC,gBAAgB,cAEnB,QAAQ,CAAC,UAAU,KAC9B,OAwBF,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
2
+
3
+ const isIntegerLiteral = (node) => node.type === AST_NODE_TYPES.Literal && typeof node.value === "number" && Number.isInteger(node.value);
4
+ const isIntegerLiteralOrConstant = (node, sourceCode) => {
5
+ if (isIntegerLiteral(node)) return true;
6
+ if (node.type !== AST_NODE_TYPES.Identifier) return false;
7
+ const scope = sourceCode.getScope(node);
8
+ const variable = findVariable(scope, node.name);
9
+ if (variable === void 0) return false;
10
+ if (variable.defs.length !== 1) return false;
11
+ const def = variable.defs[0];
12
+ if (def === void 0) return false;
13
+ if (!isVariableDefinition(def)) return false;
14
+ if (def.parent.kind !== "const") return false;
15
+ if (def.node.init == null) return false;
16
+ if (def.node.id.typeAnnotation !== void 0) return false;
17
+ return isIntegerLiteral(def.node.init);
18
+ };
19
+ const isLengthAccess = (node) => node.type === AST_NODE_TYPES.MemberExpression && node.property.type === AST_NODE_TYPES.Identifier && node.property.name === "length";
20
+ const parseLengthComparison = (node, sourceCode) => {
21
+ if (node.type !== AST_NODE_TYPES.BinaryExpression || node.operator !== ">=" && node.operator !== "<=") {
22
+ return void 0;
23
+ }
24
+ const { left, right, operator } = node;
25
+ const lengthOnLeft = isLengthAccess(left);
26
+ const lengthSide = lengthOnLeft ? left : right;
27
+ const boundSide = lengthOnLeft ? right : left;
28
+ if (!isLengthAccess(lengthSide)) return void 0;
29
+ if (!isIntegerLiteralOrConstant(boundSide, sourceCode)) return void 0;
30
+ const kind = (lengthOnLeft ? operator === ">=" : operator === "<=") ? "min" : "max";
31
+ return { array: lengthSide.object, bound: boundSide, kind };
32
+ };
33
+ const isPartOfBoundedLengthCheck = (node, sourceCode) => {
34
+ const { parent } = node;
35
+ if (parent.type !== AST_NODE_TYPES.LogicalExpression || parent.operator !== "&&") {
36
+ return false;
37
+ }
38
+ const self = parseLengthComparison(node, sourceCode);
39
+ if (self === void 0) return false;
40
+ const sibling = parent.left === node ? parent.right : parent.left;
41
+ const other = parseLengthComparison(sibling, sourceCode);
42
+ if (other === void 0) return false;
43
+ return self.kind !== other.kind && sourceCode.getText(self.array) === sourceCode.getText(other.array);
44
+ };
45
+ const isVariableDefinition = (def) => def.type === "Variable";
46
+ const findVariable = (scope, name) => {
47
+ const variable = scope.set.get(name);
48
+ if (variable !== void 0) return variable;
49
+ if (scope.upper === null) return void 0;
50
+ return findVariable(scope.upper, name);
51
+ };
52
+
53
+ export { isIntegerLiteralOrConstant, isLengthAccess, isPartOfBoundedLengthCheck, parseLengthComparison };
54
+ //# sourceMappingURL=ast-utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-utils.mjs","sources":["../../src/rules/ast-utils.mts"],"sourcesContent":["import {\n AST_NODE_TYPES,\n type TSESLint,\n type TSESTree,\n} from '@typescript-eslint/utils';\nimport { type DeepReadonly } from 'ts-type-forge';\n\nconst isIntegerLiteral = (node: DeepReadonly<TSESTree.Expression>): boolean =>\n node.type === AST_NODE_TYPES.Literal &&\n typeof node.value === 'number' &&\n Number.isInteger(node.value);\n\nexport const isIntegerLiteralOrConstant = (\n node: DeepReadonly<TSESTree.Expression>,\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n sourceCode: TSESLint.SourceCode,\n): boolean => {\n // Direct integer literal (e.g., 3)\n if (isIntegerLiteral(node)) return true;\n\n // Identifier referencing a const variable initialized with an integer literal\n if (node.type !== AST_NODE_TYPES.Identifier) return false;\n\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n const scope = sourceCode.getScope(node as TSESTree.Node);\n\n const variable = findVariable(scope, node.name);\n\n if (variable === undefined) return false;\n\n // Must have exactly one definition (const)\n if (variable.defs.length !== 1) return false;\n\n const def = variable.defs[0];\n\n if (def === undefined) return false;\n\n if (!isVariableDefinition(def)) return false;\n\n if (def.parent.kind !== 'const') return false;\n\n if (def.node.init == null) return false;\n\n // Reject if there is an explicit type annotation (e.g., `const n: number = 3`)\n // because the literal type is widened and type guard cannot narrow it.\n if (def.node.id.typeAnnotation !== undefined) return false;\n\n return isIntegerLiteral(def.node.init);\n};\n\nexport const isLengthAccess = (\n node: DeepReadonly<TSESTree.Expression>,\n): node is TSESTree.MemberExpression =>\n node.type === AST_NODE_TYPES.MemberExpression &&\n node.property.type === AST_NODE_TYPES.Identifier &&\n node.property.name === 'length';\n\ntype LengthComparison = Readonly<{\n array: TSESTree.Expression;\n bound: TSESTree.Expression;\n kind: 'max' | 'min';\n}>;\n\n/**\n * Parses a `<array>.length <op> <bound>` comparison (in either operand order)\n * into its array expression, integer-literal/`const` `bound`, and whether it is\n * a lower (`min`) or upper (`max`) length bound. Returns `undefined` for\n * anything else.\n *\n * - `xs.length >= n` / `n <= xs.length` → `min`\n * - `xs.length <= n` / `n >= xs.length` → `max`\n */\nexport const parseLengthComparison = (\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n node: TSESTree.Expression,\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n sourceCode: TSESLint.SourceCode,\n): LengthComparison | undefined => {\n if (\n node.type !== AST_NODE_TYPES.BinaryExpression ||\n (node.operator !== '>=' && node.operator !== '<=')\n ) {\n return undefined;\n }\n\n const { left, right, operator } = node;\n\n const lengthOnLeft = isLengthAccess(left);\n\n const lengthSide = lengthOnLeft ? left : right;\n\n const boundSide = lengthOnLeft ? right : left;\n\n if (!isLengthAccess(lengthSide)) return undefined;\n\n if (!isIntegerLiteralOrConstant(boundSide, sourceCode)) return undefined;\n\n const kind: LengthComparison['kind'] = (\n lengthOnLeft ? operator === '>=' : operator === '<='\n )\n ? 'min'\n : 'max';\n\n return { array: lengthSide.object, bound: boundSide, kind };\n};\n\n/**\n * `true` when `node` is one operand of an `a && b` whose other operand is the\n * complementary length bound (`min` vs `max`) on the same array — i.e. the two\n * together form the `Arr.isBoundedLengthArray` pattern handled by\n * `prefer-arr-is-bounded-length-array`. The single-bound rules skip such\n * operands so the bounded rule rewrites the whole `&&` instead of the parts.\n */\nexport const isPartOfBoundedLengthCheck = (\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n node: TSESTree.BinaryExpression,\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n sourceCode: TSESLint.SourceCode,\n): boolean => {\n const { parent } = node;\n\n if (\n parent.type !== AST_NODE_TYPES.LogicalExpression ||\n parent.operator !== '&&'\n ) {\n return false;\n }\n\n const self = parseLengthComparison(node, sourceCode);\n\n if (self === undefined) return false;\n\n const sibling = parent.left === node ? parent.right : parent.left;\n\n const other = parseLengthComparison(sibling, sourceCode);\n\n if (other === undefined) return false;\n\n return (\n self.kind !== other.kind &&\n sourceCode.getText(self.array) === sourceCode.getText(other.array)\n );\n};\n\ntype VariableDefinition = Readonly<{\n type: string;\n parent: TSESTree.VariableDeclaration;\n node: TSESTree.VariableDeclarator;\n}>;\n\nconst isVariableDefinition = (\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n def: TSESLint.Scope.Definition,\n): def is TSESLint.Scope.Definition & VariableDefinition =>\n (def.type as string) === 'Variable';\n\nconst findVariable = (\n // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types\n scope: TSESLint.Scope.Scope,\n name: string,\n): TSESLint.Scope.Variable | undefined => {\n const variable = scope.set.get(name);\n\n if (variable !== undefined) return variable;\n\n if (scope.upper === null) return undefined;\n\n return findVariable(scope.upper, name);\n};\n"],"names":[],"mappings":";;AAOA,MAAM,gBAAA,GAAmB,CAAC,IAAA,KACxB,IAAA,CAAK,SAAS,cAAA,CAAe,OAAA,IAC7B,OAAO,IAAA,CAAK,KAAA,KAAU,QAAA,IACtB,MAAA,CAA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BAAA,CAAsB,OAAA,EAAS,UAAU,CAAA;AAEvD,EAAA,IAAI,KAAA,KAAU,QAAW,OAAO,KAAA;AAEhC,EAAA,OACE,IAAA,CAAK,IAAA,KAAS,KAAA,CAAM,IAAA,IACpB,UAAA,CAAW,OAAA,CAAQ,IAAA,CAAK,KAAK,CAAA,KAAM,UAAA,CAAW,OAAA,CAAQ,KAAA,CAAM,KAAK,CAAA;AAErE;AAQA,MAAM,oBAAA,GAAuB,CAE3B,GAAA,KAEC,GAAA,CAAI,IAAA,KAAoB,UAAA;AAE3B,MAAM,YAAA,GAAe,CAEnB,KAAA,EACA,IAAA,KACwC;AACxC,EAAA,MAAM,QAAA,GAAW,KAAA,CAAM,GAAA,CAAI,GAAA,CAAI,IAAI,CAAA;AAEnC,EAAA,IAAI,QAAA,KAAa,QAAW,OAAO,QAAA;AAEnC,EAAA,IAAI,KAAA,CAAM,KAAA,KAAU,IAAA,EAAM,OAAO,MAAA;AAEjC,EAAA,OAAO,YAAA,CAAa,KAAA,CAAM,KAAA,EAAO,IAAI,CAAA;AACvC,CAAA;;;;"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Branded number types from ts-data-forge and their corresponding as* functions
3
+ */
4
+ export declare const brandedNumberTypeNameToFunctionName: ReadonlyMap<string, `as${string}`>;
5
+ //# sourceMappingURL=branded-number-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branded-number-types.d.mts","sourceRoot":"","sources":["../../src/rules/branded-number-types.mts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAC3D,MAAM,EACN,KAAK,MAAM,EAAE,CAC0C,CAAC"}
@@ -0,0 +1,40 @@
1
+ const brandedNumberTypes = [
2
+ "FiniteNumber",
3
+ "Int",
4
+ "Int16",
5
+ "Int32",
6
+ "Int8",
7
+ "NegativeFiniteNumber",
8
+ "NegativeInt",
9
+ "NegativeSafeInt",
10
+ "NonNegativeFiniteNumber",
11
+ "NonNegativeInt16",
12
+ "NonNegativeInt32",
13
+ "NonPositiveFiniteNumber",
14
+ "NonPositiveInt",
15
+ "NonPositiveSafeInt",
16
+ "NonZeroFiniteNumber",
17
+ "NonZeroInt",
18
+ "NonZeroInt16",
19
+ "NonZeroInt32",
20
+ "NonZeroSafeInt",
21
+ "NonZeroUint16",
22
+ "NonZeroUint32",
23
+ "PositiveFiniteNumber",
24
+ "PositiveInt",
25
+ "PositiveInt16",
26
+ "PositiveInt32",
27
+ "PositiveSafeInt",
28
+ "PositiveUint16",
29
+ "PositiveUint32",
30
+ "SafeInt",
31
+ "SafeUint",
32
+ "Uint",
33
+ "Uint16",
34
+ "Uint32",
35
+ "Uint8"
36
+ ];
37
+ const brandedNumberTypeNameToFunctionName = new Map(brandedNumberTypes.map((t) => [t, `as${t}`]));
38
+
39
+ export { brandedNumberTypeNameToFunctionName };
40
+ //# sourceMappingURL=branded-number-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branded-number-types.mjs","sources":["../../src/rules/branded-number-types.mts"],"sourcesContent":["// Keep this list in sync with the `as<Type>` cast functions exported by\n// ts-data-forge. `pnpm run check:branded-number-types` (also run during the\n// build) fails if a branded number type is missing here or no longer exists.\nconst brandedNumberTypes = [\n 'FiniteNumber',\n 'Int',\n 'Int16',\n 'Int32',\n 'Int8',\n 'NegativeFiniteNumber',\n 'NegativeInt',\n 'NegativeSafeInt',\n 'NonNegativeFiniteNumber',\n 'NonNegativeInt16',\n 'NonNegativeInt32',\n 'NonPositiveFiniteNumber',\n 'NonPositiveInt',\n 'NonPositiveSafeInt',\n 'NonZeroFiniteNumber',\n 'NonZeroInt',\n 'NonZeroInt16',\n 'NonZeroInt32',\n 'NonZeroSafeInt',\n 'NonZeroUint16',\n 'NonZeroUint32',\n 'PositiveFiniteNumber',\n 'PositiveInt',\n 'PositiveInt16',\n 'PositiveInt32',\n 'PositiveSafeInt',\n 'PositiveUint16',\n 'PositiveUint32',\n 'SafeInt',\n 'SafeUint',\n 'Uint',\n 'Uint16',\n 'Uint32',\n 'Uint8',\n] as const;\n\n/**\n * Branded number types from ts-data-forge and their corresponding as* functions\n */\nexport const brandedNumberTypeNameToFunctionName: ReadonlyMap<\n string,\n `as${string}`\n> = new Map(brandedNumberTypes.map((t) => [t, `as${t}`]));\n"],"names":[],"mappings":"AAGA,MAAM,kBAAA,GAAqB;AAAA,EACzB,cAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,sBAAA;AAAA,EACA,aAAA;AAAA,EACA,iBAAA;AAAA,EACA,yBAAA;AAAA,EACA,kBAAA;AAAA,EACA,kBAAA;AAAA,EACA,yBAAA;AAAA,EACA,gBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,sBAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,eAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA;AAKO,MAAM,mCAAA,GAGT,IAAI,GAAA,CAAI,kBAAA,CAAmB,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,EAAG,CAAA,EAAA,EAAK,CAAC,CAAA,CAAE,CAAC,CAAC;;;;"}
@@ -0,0 +1,2 @@
1
+ export declare const TS_DATA_FORGE_MODULE = "ts-data-forge";
2
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/rules/constants.mts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ const TS_DATA_FORGE_MODULE = "ts-data-forge";
2
+
3
+ export { TS_DATA_FORGE_MODULE };
4
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sources":["../../src/rules/constants.mts"],"sourcesContent":["export const TS_DATA_FORGE_MODULE = 'ts-data-forge';\n"],"names":[],"mappings":"AAAO,MAAM,oBAAA,GAAuB;;;;"}
@@ -0,0 +1,30 @@
1
+ import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
2
+ import { type DeepReadonly } from 'ts-type-forge';
3
+ export declare const getTsDataForgeImport: (program: TSESTree.Program) => TSESTree.ImportDeclaration | undefined;
4
+ export declare const getNamedImports: (node: DeepReadonly<TSESTree.ImportDeclaration> | undefined) => readonly string[];
5
+ /**
6
+ * Returns the in-scope local name a given canonical export is imported as
7
+ * (handling aliases such as `import { isX as y }` → `'y'`), or `undefined` when
8
+ * it is not imported. Used so autofixes reference the binding that actually
9
+ * exists rather than the canonical name.
10
+ */
11
+ export declare const getImportedLocalName: (node: DeepReadonly<TSESTree.ImportDeclaration> | undefined, importedName: string) => string | undefined;
12
+ type ResolvedCallee = Readonly<{
13
+ /** The canonical (imported) ts-data-forge name, regardless of local alias. */
14
+ canonicalName: string;
15
+ /** The identifier node to rewrite when replacing the callee name. */
16
+ propertyNode: TSESTree.Node;
17
+ /** Whether the call was made through a namespace import (`tf.isX(...)`). */
18
+ isNamespace: boolean;
19
+ }>;
20
+ /**
21
+ * Builds a resolver that maps a call expression's callee to the canonical
22
+ * ts-data-forge function it refers to. Handles named imports (including aliases
23
+ * such as `import { isX as y }`) and namespace imports (`import * as tf` →
24
+ * `tf.isX(...)`). Returns `undefined` for any callee that does not reference the
25
+ * given ts-data-forge import.
26
+ */
27
+ export declare const buildCalleeResolver: (importDecl: TSESTree.ImportDeclaration | undefined) => ((callee: DeepReadonly<TSESTree.Expression>) => ResolvedCallee | undefined);
28
+ export declare const buildImportFixes: (fixer: TSESLint.RuleFixer, program: TSESTree.Program, _tsDataForgeImport: TSESTree.ImportDeclaration | undefined, requiredNames: readonly string[]) => readonly TSESLint.RuleFix[];
29
+ export {};
30
+ //# sourceMappingURL=import-utils.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-utils.d.mts","sourceRoot":"","sources":["../../src/rules/import-utils.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,eAAO,MAAM,oBAAoB,YACtB,QAAQ,CAAC,OAAO,KACxB,QAAQ,CAAC,iBAAiB,GAAG,SAK7B,CAAC;AAEJ,eAAO,MAAM,eAAe,SACpB,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,SAAS,KACzD,SAAS,MAAM,EAejB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,SACzB,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,SAAS,gBAC5C,MAAM,KACnB,MAAM,GAAG,SAOG,CAAC;AAEhB,KAAK,cAAc,GAAG,QAAQ,CAAC;IAC7B,8EAA8E;IAC9E,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;IAC5B,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,eAClB,QAAQ,CAAC,iBAAiB,GAAG,SAAS,KACjD,CAAC,CACF,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,KACtC,cAAc,GAAG,SAAS,CAsD9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,UACpB,QAAQ,CAAC,SAAS,WAChB,QAAQ,CAAC,OAAO,sBACL,QAAQ,CAAC,iBAAiB,GAAG,SAAS,iBAC3C,SAAS,MAAM,EAAE,KAC/B,SAAS,QAAQ,CAAC,OAAO,EAa3B,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
2
+ import { TS_DATA_FORGE_MODULE } from './constants.mjs';
3
+
4
+ const getTsDataForgeImport = (program) => program.body.find(
5
+ (node) => node.type === AST_NODE_TYPES.ImportDeclaration && node.source.value === TS_DATA_FORGE_MODULE
6
+ );
7
+ const getNamedImports = (node) => {
8
+ if (node === void 0) return [];
9
+ return node.specifiers.flatMap(
10
+ (specifier) => specifier.type === AST_NODE_TYPES.ImportSpecifier ? (() => {
11
+ const importedName = specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;
12
+ return typeof importedName === "string" ? [importedName] : [];
13
+ })() : []
14
+ );
15
+ };
16
+ const getImportedLocalName = (node, importedName) => node?.specifiers.find(
17
+ (specifier) => specifier.type === AST_NODE_TYPES.ImportSpecifier && (specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value) === importedName
18
+ )?.local.name;
19
+ const buildCalleeResolver = (importDecl) => {
20
+ const specifiers = importDecl?.specifiers ?? [];
21
+ const namespaceName = specifiers.find(
22
+ (specifier) => specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier
23
+ )?.local.name;
24
+ const localToCanonical = new Map(
25
+ specifiers.flatMap((specifier) => {
26
+ if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) return [];
27
+ const importedName = specifier.imported.type === AST_NODE_TYPES.Identifier ? specifier.imported.name : specifier.imported.value;
28
+ return typeof importedName === "string" ? [[specifier.local.name, importedName]] : [];
29
+ })
30
+ );
31
+ return (callee) => {
32
+ if (callee.type === AST_NODE_TYPES.Identifier) {
33
+ const canonicalName = localToCanonical.get(callee.name);
34
+ return canonicalName === void 0 ? void 0 : {
35
+ canonicalName,
36
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion
37
+ propertyNode: callee,
38
+ isNamespace: false
39
+ };
40
+ }
41
+ if (callee.type === AST_NODE_TYPES.MemberExpression && !callee.computed && callee.object.type === AST_NODE_TYPES.Identifier && namespaceName !== void 0 && callee.object.name === namespaceName && callee.property.type === AST_NODE_TYPES.Identifier) {
42
+ return {
43
+ canonicalName: callee.property.name,
44
+ // eslint-disable-next-line total-functions/no-unsafe-type-assertion
45
+ propertyNode: callee.property,
46
+ isNamespace: true
47
+ };
48
+ }
49
+ return void 0;
50
+ };
51
+ };
52
+ const buildImportFixes = (fixer, program, _tsDataForgeImport, requiredNames) => {
53
+ const specifierText = requiredNames.join(", ");
54
+ const importStatement = `import { ${specifierText} } from '${TS_DATA_FORGE_MODULE}';`;
55
+ const newLine = "\n";
56
+ const insertionText = `${importStatement}${newLine}`;
57
+ return [fixer.insertTextBefore(program, insertionText)];
58
+ };
59
+
60
+ export { buildCalleeResolver, buildImportFixes, getImportedLocalName, getNamedImports, getTsDataForgeImport };
61
+ //# sourceMappingURL=import-utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-utils.mjs","sources":["../../src/rules/import-utils.mts"],"sourcesContent":["import {\n AST_NODE_TYPES,\n type TSESLint,\n type TSESTree,\n} from '@typescript-eslint/utils';\nimport { type DeepReadonly } from 'ts-type-forge';\nimport { TS_DATA_FORGE_MODULE } from './constants.mjs';\n\n/* eslint-disable @typescript-eslint/prefer-readonly-parameter-types */\n\nexport const getTsDataForgeImport = (\n program: TSESTree.Program,\n): TSESTree.ImportDeclaration | undefined =>\n program.body.find(\n (node): node is TSESTree.ImportDeclaration =>\n node.type === AST_NODE_TYPES.ImportDeclaration &&\n node.source.value === TS_DATA_FORGE_MODULE,\n );\n\nexport const getNamedImports = (\n node: DeepReadonly<TSESTree.ImportDeclaration> | undefined,\n): readonly string[] => {\n if (node === undefined) return [];\n\n return node.specifiers.flatMap((specifier) =>\n specifier.type === AST_NODE_TYPES.ImportSpecifier\n ? (() => {\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier\n ? specifier.imported.name\n : specifier.imported.value;\n\n return typeof importedName === 'string' ? [importedName] : [];\n })()\n : [],\n );\n};\n\n/**\n * Returns the in-scope local name a given canonical export is imported as\n * (handling aliases such as `import { isX as y }` → `'y'`), or `undefined` when\n * it is not imported. Used so autofixes reference the binding that actually\n * exists rather than the canonical name.\n */\nexport const getImportedLocalName = (\n node: DeepReadonly<TSESTree.ImportDeclaration> | undefined,\n importedName: string,\n): string | undefined =>\n node?.specifiers.find(\n (specifier) =>\n specifier.type === AST_NODE_TYPES.ImportSpecifier &&\n (specifier.imported.type === AST_NODE_TYPES.Identifier\n ? specifier.imported.name\n : specifier.imported.value) === importedName,\n )?.local.name;\n\ntype ResolvedCallee = Readonly<{\n /** The canonical (imported) ts-data-forge name, regardless of local alias. */\n canonicalName: string;\n /** The identifier node to rewrite when replacing the callee name. */\n propertyNode: TSESTree.Node;\n /** Whether the call was made through a namespace import (`tf.isX(...)`). */\n isNamespace: boolean;\n}>;\n\n/**\n * Builds a resolver that maps a call expression's callee to the canonical\n * ts-data-forge function it refers to. Handles named imports (including aliases\n * such as `import { isX as y }`) and namespace imports (`import * as tf` →\n * `tf.isX(...)`). Returns `undefined` for any callee that does not reference the\n * given ts-data-forge import.\n */\nexport const buildCalleeResolver = (\n importDecl: TSESTree.ImportDeclaration | undefined,\n): ((\n callee: DeepReadonly<TSESTree.Expression>,\n) => ResolvedCallee | undefined) => {\n const specifiers = importDecl?.specifiers ?? [];\n\n const namespaceName = specifiers.find(\n (specifier) => specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,\n )?.local.name;\n\n const localToCanonical = new Map<string, string>(\n specifiers.flatMap((specifier) => {\n if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) return [];\n\n const importedName =\n specifier.imported.type === AST_NODE_TYPES.Identifier\n ? specifier.imported.name\n : specifier.imported.value;\n\n return typeof importedName === 'string'\n ? [[specifier.local.name, importedName] as const]\n : [];\n }),\n );\n\n return (callee) => {\n if (callee.type === AST_NODE_TYPES.Identifier) {\n const canonicalName = localToCanonical.get(callee.name);\n\n return canonicalName === undefined\n ? undefined\n : {\n canonicalName,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n propertyNode: callee as TSESTree.Node,\n isNamespace: false,\n };\n }\n\n if (\n callee.type === AST_NODE_TYPES.MemberExpression &&\n !callee.computed &&\n callee.object.type === AST_NODE_TYPES.Identifier &&\n namespaceName !== undefined &&\n callee.object.name === namespaceName &&\n callee.property.type === AST_NODE_TYPES.Identifier\n ) {\n return {\n canonicalName: callee.property.name,\n // eslint-disable-next-line total-functions/no-unsafe-type-assertion\n propertyNode: callee.property as TSESTree.Node,\n isNamespace: true,\n };\n }\n\n return undefined;\n };\n};\n\nexport const buildImportFixes = (\n fixer: TSESLint.RuleFixer,\n program: TSESTree.Program,\n _tsDataForgeImport: TSESTree.ImportDeclaration | undefined,\n requiredNames: readonly string[],\n): readonly TSESLint.RuleFix[] => {\n const specifierText = requiredNames.join(', ');\n\n const importStatement =\n `import { ${specifierText} } from '${TS_DATA_FORGE_MODULE}';` as const;\n\n const newLine = '\\n';\n\n const insertionText = `${importStatement}${newLine}` as const;\n\n // Always insert at the beginning of the file\n // (organize-imports will handle merging/deduplication)\n return [fixer.insertTextBefore(program, insertionText)];\n};\n/* eslint-enable @typescript-eslint/prefer-readonly-parameter-types */\n"],"names":[],"mappings":";;;AAUO,MAAM,oBAAA,GAAuB,CAClC,OAAA,KAEA,OAAA,CAAQ,IAAA,CAAK,IAAA;AAAA,EACX,CAAC,SACC,IAAA,CAAK,IAAA,KAAS,eAAe,iBAAA,IAC7B,IAAA,CAAK,OAAO,KAAA,KAAU;AAC1B;AAEK,MAAM,eAAA,GAAkB,CAC7B,IAAA,KACsB;AACtB,EAAA,IAAI,IAAA,KAAS,MAAA,EAAW,OAAO,EAAC;AAEhC,EAAA,OAAO,KAAK,UAAA,CAAW,OAAA;AAAA,IAAQ,CAAC,SAAA,KAC9B,SAAA,CAAU,IAAA,KAAS,cAAA,CAAe,mBAC7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