U07

Warning

Declared and never read

U07 — An allow that allows nothing

A // wf-allow(CODE) comment covers the next line of code (or its own, at the end of one); when nothing it names is reported there, or it names an error no allow may silence, it is reported itself — so allows cannot outlive what they were written for.

What the compiler said

warning[U07]: `wf-allow(U01)` allows nothing: no `U01` is reported on the line it covers --> src/App.wf:2:5 | 2 | // wf-allow(U01) | ^^^^^^^^^^^^^^^^ = help: Remove it — what it was written for is gone = docs: https://webfluent.monzeromer.dev/errors/U07

Your editor offers this fix: Remove the allow. wf fix --code U07 applies it to every place it fits.

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { // wf-allow(U01) state shown = 0 Heading("Count {shown}").h1 }

Fixed

wf

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

Remove the allow — what it was written for is gone.

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

A // wf-allow(CODE) comment accepts one finding on purpose: on a line of its own it covers the next line of code, and at the end of a line it covers that line. It names codes (U01) or families (U), comma-separated, and only what lints could lower — a warning, or an error that ships no broken page. An allow that covers nothing it names is reported, so allows cannot outlive what they were written for.

lints may lower it:

"lints": { "U07": "off" } // wf-allow(U07)