release: WRNexusJS 0.5.10

This commit is contained in:
2026-07-30 13:36:29 +05:30
parent 8fc6f15402
commit d1b0c55b53
159 changed files with 7509 additions and 604 deletions
+11 -7
View File
@@ -1155,18 +1155,21 @@ function validateRequiredView(document, source, rootKind, rootMatch) {
];
}
function validateLayoutUsage(document, source, rootKind) {
function validateLayoutUsage(document, source, rootKind, rootMatch) {
const diagnostics = [];
if (rootKind !== "page" && /^\s*layout\s*=/m.test(source)) {
const match = /^\s*layout\s*=/m.exec(source);
if (rootKind !== "page") {
const bodyRange = getRootBodyRange(source, rootMatch);
const layoutMember = findRootMembers(source, bodyRange.start, bodyRange.end).find(
(member) => member.name === "layout",
);
if (match) {
if (layoutMember) {
diagnostics.push(
createDiagnostic(
document,
match.index,
match.index + match[0].length,
layoutMember.start,
layoutMember.end,
'`layout = "..."` is only valid inside a page.',
vscode.DiagnosticSeverity.Error,
"wrn-invalid-layout-member",
@@ -1229,7 +1232,7 @@ function validateDocument(document) {
diagnostics.push(...validateRequiredView(document, source, declaration.kind, declaration.match));
diagnostics.push(...validateLayoutUsage(document, source, declaration.kind));
diagnostics.push(...validateLayoutUsage(document, source, declaration.kind, declaration.match));
return diagnostics;
}
@@ -1325,6 +1328,7 @@ module.exports = {
validateDocument,
validateHtmlTags,
validateLifecycleBlocks,
validateLayoutUsage,
validateRootMembers,
validateWatchBlocks,
};