release: WRNexusJS 0.3.5

This commit is contained in:
2026-07-24 12:46:44 +05:30
parent 44ba847210
commit c81dedff17
2114 changed files with 65790 additions and 150559 deletions
+35
View File
@@ -30,6 +30,7 @@ const {
findTopLevelDeclaration,
maskLeadingTrivia,
validateBalancedCharacters,
validateHtmlTags,
validateRootMembers,
} = require("../src/diagnostics");
Module._load = originalLoad;
@@ -115,3 +116,37 @@ test("accepts all WRN 0.3 root members without false unknown-member errors", ()
assert.deepEqual(validateRootMembers(document, source, declaration.kind, declaration.match), []);
});
test("ignores member-like words inside component line and block comments", () => {
const source = `component Counter {
// Props are passed as attributes on the mount element.
/* State and View are explained here, not declared here. */
props {
start = 0
label = "Count"
}
state count = start
view { <button>{label}: {count}</button> }
}`;
const declaration = findTopLevelDeclaration({}, source);
assert.deepEqual(
validateRootMembers(mockDocument(source), source, declaration.kind, declaration.match),
[],
);
});
test("ignores HTML-like tags inside WRN comments", () => {
const source = `// The <section> below listens for child events.
// <ComboBox> is only documentation in this comment.
page Test {
/*
Example markup: <article><strong>Preview</strong></article>
*/
view {
<main><section>Real content</section></main>
}
}`;
assert.deepEqual(validateHtmlTags(mockDocument(source), source), []);
});