avoid-unknown-pragma
preset: recommended
Warns when the @pragma
annotation has an unknown value.
Annotation values are checked against these lists:
- https://github.com/dart-lang/sdk/blob/main/runtime/docs/pragmas.md
- https://github.com/dart-lang/sdk/blob/main/pkg/compiler/doc/pragmas.md
Example
❌ Bad:
('vm:prefer-inlined') // LINT: Avoid unknown pragma annotations. Try checking this annotation for a potential typo.
Future<String> fn() {
...
}
✅ Good:
('vm:prefer-inline') // Correct, 'inline' instead of 'inlined'
Future<String> fn() {
...
}