@blumintinc/eslint-plugin-blumint 1.19.19 → 1.19.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js
CHANGED
|
@@ -177,7 +177,11 @@ exports.preferMapOverConditionalDispatch = (0, createRule_1.createRule)({
|
|
|
177
177
|
}
|
|
178
178
|
let text;
|
|
179
179
|
try {
|
|
180
|
-
|
|
180
|
+
// Pass the expression's TS node as the enclosing declaration so the
|
|
181
|
+
// printer qualifies namespaced symbols to their scoped name (e.g.
|
|
182
|
+
// `JSX.Element`, not the DOM global `Element`) at the fix site.
|
|
183
|
+
const enclosing = esTreeNodeToTSNodeMap.get(expr);
|
|
184
|
+
text = checker.typeToString(widened, enclosing);
|
|
181
185
|
}
|
|
182
186
|
catch {
|
|
183
187
|
return null;
|
|
@@ -192,9 +196,13 @@ exports.preferMapOverConditionalDispatch = (0, createRule_1.createRule)({
|
|
|
192
196
|
}
|
|
193
197
|
return parts.length > 0 ? parts.join(' | ') : null;
|
|
194
198
|
}
|
|
195
|
-
function discriminantTypeText(type) {
|
|
199
|
+
function discriminantTypeText(type, discriminant) {
|
|
196
200
|
try {
|
|
197
|
-
|
|
201
|
+
// Pass the discriminant's TS node as the enclosing declaration so the
|
|
202
|
+
// printer qualifies namespaced symbols to their scoped name at the fix
|
|
203
|
+
// site rather than printing an ambiguous short name.
|
|
204
|
+
const enclosing = esTreeNodeToTSNodeMap.get(discriminant);
|
|
205
|
+
const text = checker.typeToString(type, enclosing);
|
|
198
206
|
return text && text !== 'error' ? text : null;
|
|
199
207
|
}
|
|
200
208
|
catch {
|
|
@@ -542,7 +550,7 @@ exports.preferMapOverConditionalDispatch = (0, createRule_1.createRule)({
|
|
|
542
550
|
if (literalKeys.length === 0 || hasOther) {
|
|
543
551
|
return null;
|
|
544
552
|
}
|
|
545
|
-
const dText = discriminantTypeText(type);
|
|
553
|
+
const dText = discriminantTypeText(type, discriminant);
|
|
546
554
|
if (!dText) {
|
|
547
555
|
return null;
|
|
548
556
|
}
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.19.20",
|
|
4
|
+
"date": "2026-07-18T20:26:20.204Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "prefer-map-over-conditional-dispatch",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1322
|
|
11
|
+
],
|
|
12
|
+
"summary": "qualify JSX value/discriminant type via enclosingDeclaration (closes #1322)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.19.19",
|
|
4
18
|
"date": "2026-07-18T17:27:38.611Z",
|