Skip to main content

avoid-unknown-pragma

added in: 1.15.0
Pro+
preset: recommended

Warns when the @pragma annotation has an unknown value.

Annotation values are checked against these lists:

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() {
...
}