@blumintinc/eslint-plugin-blumint 1.19.10 → 1.19.11
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 +1 -1
- package/lib/rules/global-const-style.js +23 -2
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -340,13 +340,34 @@ exports.default = (0, createRule_1.createRule)({
|
|
|
340
340
|
fixer.replaceText(idNode, typeAnnotation ? `${newName}${typeText}` : newName),
|
|
341
341
|
];
|
|
342
342
|
for (const ref of declaredVariable.references) {
|
|
343
|
+
const refId = ref.identifier;
|
|
343
344
|
// The declaration write reference is the id node itself and
|
|
344
345
|
// is already handled above. Skipping it also avoids emitting
|
|
345
346
|
// overlapping fix ranges, which ESLint rejects.
|
|
346
|
-
if (
|
|
347
|
+
if (refId === idNode) {
|
|
347
348
|
continue;
|
|
348
349
|
}
|
|
349
|
-
|
|
350
|
+
const refParent = refId.parent;
|
|
351
|
+
// An object-literal shorthand `{ fooBar }` desugars to
|
|
352
|
+
// `{ fooBar: fooBar }`: the one token is both the property key
|
|
353
|
+
// and its value. Rewriting it to `{ FOO_BAR }` would rename
|
|
354
|
+
// the KEY too, silently changing the object's shape. Expand to
|
|
355
|
+
// `oldKey: NEW_NAME` so only the value is renamed.
|
|
356
|
+
if (refParent?.type === utils_1.AST_NODE_TYPES.Property &&
|
|
357
|
+
refParent.shorthand &&
|
|
358
|
+
refParent.parent?.type === utils_1.AST_NODE_TYPES.ObjectExpression) {
|
|
359
|
+
fixes.push(fixer.replaceText(refId, `${name}: ${newName}`));
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
// A re-export specifier `export { fooBar }` binds the public
|
|
363
|
+
// export name to this identifier. Renaming it would change the
|
|
364
|
+
// exported name — a cross-file contract a single-file fixer
|
|
365
|
+
// cannot safely rewrite (the declaration-level export guard
|
|
366
|
+
// above only catches inline `export const`). Decline the fix.
|
|
367
|
+
if (refParent?.type === utils_1.AST_NODE_TYPES.ExportSpecifier) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
fixes.push(fixer.replaceText(refId, newName));
|
|
350
371
|
}
|
|
351
372
|
return fixes;
|
|
352
373
|
},
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.19.11",
|
|
4
|
+
"date": "2026-07-17T10:46:20.593Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "global-const-style",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1313
|
|
11
|
+
],
|
|
12
|
+
"summary": "keep rename autofix reference-safe for shorthand props and re-exports (refs #1313)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.19.10",
|
|
4
18
|
"date": "2026-07-17T10:33:03.696Z",
|