@blumintinc/eslint-plugin-blumint 1.20.200 → 1.20.201
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
|
@@ -71,23 +71,27 @@ exports.useCustomLink = (0, createRule_1.createRule)({
|
|
|
71
71
|
const defaultAsSpecifier = importSpecifiers.find((specifier) => specifier.type === 'ImportSpecifier' &&
|
|
72
72
|
specifier.imported.name === 'default');
|
|
73
73
|
if (defaultSpecifier || defaultAsSpecifier) {
|
|
74
|
+
// The fix rebuilds the whole declaration from the default binding
|
|
75
|
+
// alone, so any other specifier would be deleted outright and
|
|
76
|
+
// whatever still references it left dangling — including an
|
|
77
|
+
// `export { LinkProps }` that keeps the exported NAME while losing
|
|
78
|
+
// what it resolves to. Relocating them instead is not available:
|
|
79
|
+
// whether the wrapper re-exports a given specifier is unknowable
|
|
80
|
+
// from here, so carrying them over would trade a silent dangling
|
|
81
|
+
// binding for a possibly unresolvable import. Decline the fix and
|
|
82
|
+
// keep the report, so the migration stays a deliberate edit.
|
|
83
|
+
const droppedSpecifiers = importSpecifiers.filter((specifier) => specifier !== defaultSpecifier &&
|
|
84
|
+
specifier !== defaultAsSpecifier);
|
|
85
|
+
const localName = defaultSpecifier?.local?.name ||
|
|
86
|
+
defaultAsSpecifier?.local?.name ||
|
|
87
|
+
'Link';
|
|
74
88
|
context.report({
|
|
75
89
|
node,
|
|
76
90
|
messageId: 'useCustomLink',
|
|
77
|
-
data: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
fix(fixer) {
|
|
83
|
-
// Get the local name of the imported Link component
|
|
84
|
-
const localName = defaultSpecifier?.local?.name ||
|
|
85
|
-
defaultAsSpecifier?.local?.name ||
|
|
86
|
-
'Link';
|
|
87
|
-
// Create the new import statement
|
|
88
|
-
const newImport = `import ${localName} from '${LINK_MODULE_PATH}';`;
|
|
89
|
-
return fixer.replaceText(node, newImport);
|
|
90
|
-
},
|
|
91
|
+
data: { localName },
|
|
92
|
+
fix: droppedSpecifiers.length > 0
|
|
93
|
+
? undefined
|
|
94
|
+
: (fixer) => fixer.replaceText(node, `import ${localName} from '${LINK_MODULE_PATH}';`),
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
97
|
}
|
|
@@ -49,7 +49,7 @@ export type HarvestResult = {
|
|
|
49
49
|
* Only suites that import the shared tester module can declare a case, since
|
|
50
50
|
* `src/tests/no-local-rule-tester.test.ts` forbids a locally-built tester. That
|
|
51
51
|
* makes the import a sound admission test rather than a heuristic, and it is
|
|
52
|
-
* what keeps this affordable: the
|
|
52
|
+
* what keeps this affordable: the files it excludes are the meta-suites
|
|
53
53
|
* (`fixer-type-safety`, `docs-examples-conformance`, `rule-crash-robustness`,
|
|
54
54
|
* this guard's own siblings) which run full corpus sweeps at module scope and
|
|
55
55
|
* cost more to load than every rule suite combined.
|
|
@@ -33,7 +33,7 @@ const TESTS_DIR = path.join(__dirname, '..', 'tests');
|
|
|
33
33
|
* Only suites that import the shared tester module can declare a case, since
|
|
34
34
|
* `src/tests/no-local-rule-tester.test.ts` forbids a locally-built tester. That
|
|
35
35
|
* makes the import a sound admission test rather than a heuristic, and it is
|
|
36
|
-
* what keeps this affordable: the
|
|
36
|
+
* what keeps this affordable: the files it excludes are the meta-suites
|
|
37
37
|
* (`fixer-type-safety`, `docs-examples-conformance`, `rule-crash-robustness`,
|
|
38
38
|
* this guard's own siblings) which run full corpus sweeps at module scope and
|
|
39
39
|
* cost more to load than every rule suite combined.
|
package/package.json
CHANGED
package/release-manifest.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "1.20.201",
|
|
4
|
+
"date": "2026-09-01T19:58:16.746Z",
|
|
5
|
+
"rules": [
|
|
6
|
+
{
|
|
7
|
+
"name": "use-custom-link",
|
|
8
|
+
"changeType": "fix",
|
|
9
|
+
"issues": [
|
|
10
|
+
2272
|
|
11
|
+
],
|
|
12
|
+
"summary": "decline the autofix when it would drop a specifier (closes #2272)"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"version": "1.20.200",
|
|
4
18
|
"date": "2026-09-01T14:50:44.328Z",
|