@blumintinc/eslint-plugin-blumint 1.19.15 → 1.19.16
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
|
@@ -661,6 +661,15 @@ exports.preferGetterOverParameterlessMethod = (0, createRule_1.createRule)({
|
|
|
661
661
|
? (suggestedNameCounts.get(classBody)?.get(scopeKey) ?? 0) > 1
|
|
662
662
|
: false;
|
|
663
663
|
const isAsync = node.value.async;
|
|
664
|
+
// Only `private` methods are safe to autofix. A public / protected /
|
|
665
|
+
// unspecified-accessibility method is API surface whose call sites of
|
|
666
|
+
// the form `instance.method()` may live in other files this
|
|
667
|
+
// single-file rule never sees. Converting such a method to a getter
|
|
668
|
+
// silently breaks every external caller (the call would invoke the
|
|
669
|
+
// getter's return value), so the fix must be withheld for anything
|
|
670
|
+
// not demonstrably private. The report (nudge) is still emitted.
|
|
671
|
+
const isPrivate = node.accessibility === 'private' ||
|
|
672
|
+
node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier;
|
|
664
673
|
context.report({
|
|
665
674
|
node: node.key,
|
|
666
675
|
messageId: sideEffectReason
|
|
@@ -671,7 +680,8 @@ exports.preferGetterOverParameterlessMethod = (0, createRule_1.createRule)({
|
|
|
671
680
|
suggestedName,
|
|
672
681
|
reason: sideEffectReason ?? 'it returns a value',
|
|
673
682
|
},
|
|
674
|
-
fix:
|
|
683
|
+
fix: !isPrivate ||
|
|
684
|
+
sideEffectReason ||
|
|
675
685
|
isAsync ||
|
|
676
686
|
!leftParen ||
|
|
677
687
|
!rightParen ||
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.19.16",
|
|
4
|
+
"date": "2026-07-18T06:29:03.568Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "prefer-getter-over-parameterless-method",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1318
|
|
11
|
+
],
|
|
12
|
+
"summary": "withhold autofix for non-private methods (closes #1318)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.19.15",
|
|
4
18
|
"date": "2026-07-17T23:29:51.136Z",
|