avoid-banned-annotations

Path
lint/suspicious/avoid-banned-annotations
Default
Off, opt in
Origin
Falcon
Rule
17 of 512

Ban configured dotted annotation names, without the leading @.

Invalid

example.dartdart
const legacy = 1;
class Marker {
  const Marker.old();
}
@legacy
class Example {}
@Marker.old()
void example() {}
Use the supported alternative.
4}
5@legacy
Use the supported alternative.
6class Example {}
7@Marker.old()

Valid

example.dartdart
const modern = 1;
class Marker {
  const Marker();
}
@modern
class Example {}
@Marker()
void example() {}
const text = '@legacy';

Configure avoid-banned-annotations

Set its severity in falcon.json. See the configuration guide.

falcon.jsonjson
{
  "linter": {
    "rules": {
      "suspicious": {
        "avoid-banned-annotations": "error"
      }
    }
  }
}

Or silence one occurrence with a suppression comment; the reason is required.

example.dartdart
// falcon-ignore lint/suspicious/avoid-banned-annotations: <reason>