U05

Warning

Declared and never read

U05 — An action nothing calls

An action nothing calls; a name that starts with _ is understood to be unused on purpose.

What the compiler said

warning[U05]: `reset` is declared but never read --> src/App.wf:3:5 | 3 | action reset() { n = 0 } | ^^^^^^ = help: Nothing reads the action; remove it, or name it `_reset` to keep it = docs: https://webfluent.monzeromer.dev/errors/U05

Your editor offers this fix: Remove reset. wf fix --code U05 applies it to every place it fits.

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state n = 0 action reset() { n = 0 } Heading("{n}").h1 }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state n = 0 action reset() { n = 0 } Heading("{n}").h1 Button("Reset") { on click { reset() } } }

Call it, remove it, or name it _reset.

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": { "U05": "off" } // wf-allow(U05)