U03
Warning
Declared and never read
U03 — A component nothing places
A component nothing places, names as a layout, or reaches as a part.
What the compiler said
warning[U03]: `Orphan` is declared but never placed --> src/App.wf:1:1 | 1 | component Orphan { Text("Nobody places me") } | ^^^^^^^^^ = help: Place it in a page, name it as a layout, or remove it = docs: https://webfluent.monzeromer.dev/errors/U03
Your editor offers this fix: Remove Orphan. wf fix --code U03 applies it to every place it fits.
The fix
Broken
component Orphan { Text("Nobody places me") }
page P(path: "/", title: "T", description: "D") {
Heading("Home").h1
}
Fixed
component Orphan { Text("Somebody places me") }
page P(path: "/", title: "T", description: "D") {
Heading("Home").h1
Orphan
}
Place it, name it as a layout:, publish it in build.elements, or remove it.
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
lints may lower it:
"lints": { "U03": "off" }
// wf-allow(U03)