Linters
What is Clippy-like Dart Analyzer? An introduction to Dart's static analysis and linting tooling
Clippy-like Dart Analyzer is the Dart analyzer, which performs static analysis and linting of Dart code. It is customized through an analysis options file and code comments. Its audience is Dart developers, Flutter developers and package authors.
- Tool
- Clippy-like Dart Analyzer
- Made by
- Dart
- Official site
- dart.dev/tools/analysis
- Category
- Linters
Who makes Clippy-like Dart Analyzer
The analyzer is provided by Dart. Its official documentation is the Dart analysis page linked below this article.
Official website: dart.dev/tools/analysis
What Clippy-like Dart Analyzer is for
Static analysis finds problems before any code is executed. The analyzer can be customized to look for errors and warnings from the Dart language spec, and it can also apply linter rules that enforce the Dart Style Guide and Effective Dart guidelines.
The two parts behave differently. Linter rules can produce false positives, unlike static analysis, so it helps to know which kind of diagnostic you are looking at.
Analyzer diagnostics are documented with explanations and common fixes, which makes it practical to look up a message and decide what to do about it.
Who Clippy-like Dart Analyzer is for
The vendor names Dart developers, Flutter developers and package authors as its audience. Dart developers get analysis in their everyday workflow, and Flutter projects are directed to the flutter_lints rule set.
Package authors have an extra reason to care: passing the core lints contributes to the package score on pub.dev.
Notable capabilities
The analyzer is a shared foundation as much as a single command. The same analyzer package serves the command line, editors and other tooling, and its behaviour is controlled from one options file.
- Shared engine: the Dart Analysis Server and other tools use the analyzer package, as do dart analyze, flutter analyze and IDEs and editors.
- Options file: configuration lives in analysis_options.yaml, placed at the package root next to pubspec. If no options file is at the package root, the analyzer searches up the directory tree.
- Shared options: analysis options can be included from other files or packages, so settings can be reused.
- Analyzer section: it customizes checks such as stricter type checks, exclusions, rule severity and experiments.
- Strict language modes: optional modes give stricter checks than the Dart type system requires.
- Recommended rule sets: the Dart team provides recommended linter rule sets in the lints package.
- Flutter rules: Flutter projects should use flutter_lints, a superset of the recommended rules.
How Clippy-like Dart Analyzer fits linters
Within linters, the Dart analyzer is notable for combining two jobs in one tool: language-level static analysis and rule-based linting. Both run from the same options file and are surfaced through the same commands and editor integrations.
In Linthelm's wider niche of linters, static analysis and code quality, it is the built-in analysis layer for the Dart and Flutter ecosystem. Teams can start from the recommended rule sets in the lints package or flutter_lints and then tune severity, exclusions and strictness to fit their code.
Because the analyzer package is used by the tools developers already run, findings tend to appear in the terminal, in the editor and in package scoring, rather than in a separate step.
Frequently asked questions
What is the Dart analyzer used for?
It performs static analysis and linting of Dart code. Static analysis finds problems before any code is executed, and linter rules can enforce the Dart Style Guide and Effective Dart guidelines.
Where does the Dart analyzer look for its configuration?
It reads analysis_options.yaml, placed at the package root next to pubspec. If no options file is at the package root, the analyzer searches up the directory tree.
Which lint rules should Flutter projects use?
Flutter projects should use flutter_lints, a superset of the recommended rules. The Dart team provides the recommended linter rule sets in the lints package.
Can the Dart analyzer produce false positives?
Linter rules can produce false positives, unlike static analysis.
Do lints affect pub.dev?
Yes. Passing the core lints contributes to the package score on pub.dev.
Linthelm is independent and is not affiliated with Dart. Product names belong to their owners. Features change; confirm details on the official website.