@blumintinc/eslint-plugin-blumint 1.20.3 → 1.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +1 -1
- package/lib/rules/no-unnecessary-verb-suffix.js +21 -0
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -595,6 +595,27 @@ exports.noUnnecessaryVerbSuffix = (0, createRule_1.createRule)({
|
|
|
595
595
|
// Skip the declaration identifier itself — already handled.
|
|
596
596
|
if (ref.identifier === declarationIdNode)
|
|
597
597
|
continue;
|
|
598
|
+
const refParent = ref.identifier.parent;
|
|
599
|
+
// An object-literal shorthand `{ fooBar }` desugars to
|
|
600
|
+
// `{ fooBar: fooBar }`: the one token is both the property
|
|
601
|
+
// key and its value. Renaming it would rename the KEY too,
|
|
602
|
+
// silently changing the object's shape so every
|
|
603
|
+
// `obj.fooBar` consumer reads undefined. Expand to
|
|
604
|
+
// `oldKey: newName` so only the value moves (#1352).
|
|
605
|
+
if (refParent?.type === utils_1.AST_NODE_TYPES.Property &&
|
|
606
|
+
refParent.shorthand &&
|
|
607
|
+
refParent.parent?.type === utils_1.AST_NODE_TYPES.ObjectExpression) {
|
|
608
|
+
fixes.push(fixer.replaceText(ref.identifier, `${name}: ${suggestion}`));
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
// A re-export specifier `export { fooBar }` binds the public
|
|
612
|
+
// export name to this identifier, a cross-file contract a
|
|
613
|
+
// single-file fixer cannot rewrite. The declaration-level
|
|
614
|
+
// export guard misses this form because the declaration
|
|
615
|
+
// itself carries no `export` keyword (#1352).
|
|
616
|
+
if (refParent?.type === utils_1.AST_NODE_TYPES.ExportSpecifier) {
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
598
619
|
fixes.push(renameIdentifier(fixer, sourceCode, ref.identifier, suggestion));
|
|
599
620
|
}
|
|
600
621
|
}
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.4",
|
|
4
|
+
"date": "2026-07-25T03:08:45.043Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "no-unnecessary-verb-suffix",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1352
|
|
11
|
+
],
|
|
12
|
+
"summary": "stop the rename autofix from renaming shorthand keys and re-exported names (closes #1352)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.20.3",
|
|
4
18
|
"date": "2026-07-25T02:54:46.197Z",
|