← → or space · progress saves for Continue on the roadmap
Goal
Make consistent style and static checks automatic, not a debate in review.
dart format
- Formats Dart source to the canonical style.
- Run on save in the editor, or
dart format .before commit.
dart analyze
- Runs the static analyzer (types, null safety, unresolved names, many lints).
- Fix or suppress with care; prefer fixing.
analysis_options.yaml
- Lives at package root (or repo root for a single package).
- Extends
package:lints/recommended.yamlorpackage:flutter_lints/flutter.yamlin Flutter projects. - Add or tighten rules as the team agrees.
CI
- In pipelines, run
dart format --output=none --set-exit-if-changed .anddart analyzeso drift fails the build.
Practice tasks
- Add
analysis_options.yamlto a small Dart package if missing; extend recommended lints. - Turn on one stricter lint (for example
prefer_final_locals) and fix five violations. - Run
dart analyzeon a legacy file and fix the first three issues without disabling rules.