The analyzer package is a library that performs static analysis of Dart code, making it a valuable tool for developers and integrators alike. This package is designed to provide a comprehensive analysis of Dart code, allowing users to identify potential issues, improve code quality, and optimize performance.
To get the most out of the analyzer package, it's essential to configure it properly. This can be done using an analysis_options.yaml
file, which can control which files and paths are analyzed, which lints are applied, and more. The analysis options file should be located at the root of the project, and different embedders of the analyzer, such as dart analyze
or Dart Analysis Server, may choose to find the file in various ways.
Here are a few examples of how to configure the analyzer using the analysis_options.yaml
file:
analyzer:
exclude:
- test/_data/p4/lib/lib1.dart
- test/_data/p5/p5.dart
- test/_data/bad*.dart
- test/_brokendata/**
linter:
rules:
- camel_case_types
- empty_constructor_bodies
analyzer:
exclude:
- test/_data/p4/lib/lib1.dart
linter:
rules:
- camel_case_types
For more information on customizing static analysis, see the official Dart documentation.
The analyzer package is used by many tools, including:
For issues and feature requests, visit the GitHub issue tracker. Questions and discussions are welcome at the Dart Analyzer Discussion Group.
The APIs in this package were originally machine-generated by a translator and were based on an earlier Java implementation. The package is licensed under the BSD-3-Clause license.
The analyzer package is a powerful tool for static analysis of Dart code, providing a comprehensive analysis of code quality, performance, and security. By configuring the analyzer properly and using it in conjunction with other tools, developers can improve the overall quality and maintainability of their Dart projects. For more information, see the official documentation and GitHub repository.