C06
Warning
Components
C06 — A positional argument bound by order
Your component declares no positional prop (_ name), so the argument is bound to its first prop. Mark that prop with _ to say so.
What the compiler said
warning[C06]: `Tag2` declares no positional prop; the argument binds to `label` --> src/App.wf:4:10 | 4 | Tag2("new") | ^ = help: Mark the prop: `component Tag2(_ label: …)` = docs: https://webfluent.monzeromer.dev/errors/C06
Your editor offers this fix: Mark label positional in Tag2. wf fix --code C06 applies it to every place it fits.
The fix
Broken
component Tag2(label: String) { Text(label) }
page P(path: "/", title: "T", description: "D") {
Heading("Tags").h1
Tag2("new")
}
Fixed
component Tag2(_ label: String) { Text(label) }
page P(path: "/", title: "T", description: "D") {
Heading("Tags").h1
Tag2("new")
}
Mark the prop the call means: component Tag2(_ label: String).
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
Why this rule exists
Warning.
lints may lower it:
"lints": { "C06": "off" }
// wf-allow(C06)