types/strict/flutter
The Dart analyzer runs in all three strict modes
Implements types/strict for flutter.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | flutter |
| Scope | each |
| Kind | expr |
| Source | library v0.6.0 |
| Selected by | fleetlint-recommended@v0.6.0 |
Requirement
analyzer.language in the nearest analysis_options.yaml sets every mode in params.required to true, directly, through a local file it includes, or by including very_good_analysis.
Why
Each mode closes a different hole through which dynamic enters the program unnoticed.
Applies when
["", "../", "../../", "../../../"].exists(d, file(d + "analysis_options.yaml"))Check
For each item in:
params.required[["", "../", "../../", "../../../"].filter(d, file(d + "analysis_options.yaml"))] .exists(l, [l[0]].exists(d, [yaml(d + "analysis_options.yaml")].exists(a, a != null && (
(has(a.analyzer) && a.analyzer != null && "language" in a.analyzer && a.analyzer.language != null
&& item in a.analyzer.language)
? a.analyzer.language[item] == true
: has(a.include) && (type(a.include) == list ? a.include : dyn([a.include])).exists(i,
i.startsWith("package:very_good_analysis/")
|| (!i.startsWith("package:") && file(d + i) && [yaml(d + i)].exists(b, b != null && has(b.analyzer) && b.analyzer != null
&& "language" in b.analyzer && b.analyzer.language != null && item in b.analyzer.language
&& b.analyzer.language[item] == true)))))))Parameters
required:[strict-casts strict-inference strict-raw-types]
Fix
Set the missing modes to true under analyzer.language.
Agent instruction: Set each reported mode to true under analyzer.language and list the analyzer errors that appear instead of adding ignores.
fleetlint fix can apply this rule’s fix automatically (1 action(s)).
Sources
- https://fleetlint.org/baseline/#static-analysis (convention)
- https://dart.dev/tools/analysis (spec)
- https://fleetlint.org/stacks/#flutter–dart
Generated by fleetlint docs from catalog v0.6.0.