@alint-js/plugin-js 0.0.32 → 0.0.33
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/dist/index.mjs +8 -2
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1946,7 +1946,10 @@ Finding granularity:
|
|
|
1946
1946
|
- Put supporting types and constants in relatedDeclarations unless they independently own an operation or policy.
|
|
1947
1947
|
- relatedDeclarations may cue supporting declarations and cooperation, movement, or call relationships between primary findings, but must not replace a primary finding for an independently owned operation, adaptation, or policy.
|
|
1948
1948
|
- Do not replace declaration findings with one file-level summary.
|
|
1949
|
-
- Each suggestion must
|
|
1949
|
+
- Each suggestion must identify the declarations that belong together, the focused boundary role they should form, and the lower-level knowledge that boundary should remove from the consumer.
|
|
1950
|
+
- Each suggestion must be directly actionable from the warning text alone without inventing concrete symbol names. Include: the boundary responsibility, the kind of semantic operation or result it should expose, the caller-side dependency to replace, and the migration grouping for related declarations.
|
|
1951
|
+
- Do not propose exact owner names, function names, type names, file paths, or API signatures unless those names already exist in the reviewed source. Prefer role-level wording such as "an account-resolution boundary" or "a semantic search operation" over fabricated names.
|
|
1952
|
+
- Do not merely restate that layers are mixed. Say what code should move or stay, what kind of boundary the consumer should call afterward, and what lower-level concepts the consumer should stop knowing.
|
|
1950
1953
|
- Use relatedDeclarations to cue declarations that should move together, call through the proposed boundary, or stop depending on each other directly.
|
|
1951
1954
|
|
|
1952
1955
|
Do not report:
|
|
@@ -2194,7 +2197,7 @@ function reportMixedLayerFindings(ctx, filePath, findings) {
|
|
|
2194
2197
|
column: 0,
|
|
2195
2198
|
line: finding.line
|
|
2196
2199
|
} },
|
|
2197
|
-
message: finding
|
|
2200
|
+
message: formatMixedLayerMessage(finding)
|
|
2198
2201
|
});
|
|
2199
2202
|
}
|
|
2200
2203
|
function selectReportedMixedLayerFindings(decisions) {
|
|
@@ -2213,6 +2216,9 @@ function selectReportedMixedLayerFindings(decisions) {
|
|
|
2213
2216
|
}
|
|
2214
2217
|
return selectedFindings;
|
|
2215
2218
|
}
|
|
2219
|
+
function formatMixedLayerMessage(finding) {
|
|
2220
|
+
return [finding.message, `Suggestion: ${finding.suggestion}`].join("\n");
|
|
2221
|
+
}
|
|
2216
2222
|
function renderMixedLayerDraft(findings) {
|
|
2217
2223
|
return JSON.stringify({ findings: findings.map((finding) => ({
|
|
2218
2224
|
boundaryKind: finding.boundaryKind,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alint-js/plugin-js",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.33",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.mts",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"@valibot/to-json-schema": "^1.7.1",
|
|
17
17
|
"apeira": "^0.0.7",
|
|
18
18
|
"valibot": "^1.4.2",
|
|
19
|
-
"@alint-js/
|
|
20
|
-
"@alint-js/
|
|
19
|
+
"@alint-js/core": "0.0.33",
|
|
20
|
+
"@alint-js/plugin": "0.0.33"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsdown",
|