@blumintinc/eslint-plugin-blumint 1.20.53 → 1.20.54
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/export-if-in-doubt.js +8 -3
- package/package.json +1 -1
- package/release-manifest.json +14 -0
package/lib/index.js
CHANGED
|
@@ -78,11 +78,16 @@ exports.exportIfInDoubt = (0, createRule_1.createRule)({
|
|
|
78
78
|
!exportedIdentifiers.includes(node.id.name)) {
|
|
79
79
|
const name = node.id.name;
|
|
80
80
|
const kind = getDeclarationKind(node);
|
|
81
|
+
// The only remedy is prepending `export` to the declaration that
|
|
82
|
+
// is already there, so everything past the name is elided with
|
|
83
|
+
// `…`. A concrete-looking stand-in (`= undefined`, `() {}`,
|
|
84
|
+
// `= unknown`) reads as code to paste over the declaration and
|
|
85
|
+
// silently destroys its initializer, parameters, body, or type.
|
|
81
86
|
const exportExample = node.type === 'VariableDeclarator'
|
|
82
|
-
? `export ${kind} ${name} =
|
|
87
|
+
? `export ${kind} ${name} = …;`
|
|
83
88
|
: node.type === 'FunctionDeclaration'
|
|
84
|
-
? `export function ${name}() {}`
|
|
85
|
-
: `export type ${name} =
|
|
89
|
+
? `export function ${name}(…) { … }`
|
|
90
|
+
: `export type ${name} = …;`;
|
|
86
91
|
context.report({
|
|
87
92
|
node,
|
|
88
93
|
messageId: 'exportIfInDoubt',
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.54",
|
|
4
|
+
"date": "2026-08-01T01:37:34.774Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "export-if-in-doubt",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
1543
|
|
11
|
+
],
|
|
12
|
+
"summary": "elide the remedy example instead of fabricating a destructive value (closes #1543)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.20.53",
|
|
4
18
|
"date": "2026-08-01T00:55:57.763Z",
|