Introducing Very Good Analysis

Enforce best practices with our Dart and Flutter lint rules.

1 min read

At Very Good Ventures, we hold our code to high standards and we want to help you do the same! 

Very Good Analysis is an open source package that contains lint rules for Dart and Flutter used internally at Very Good Ventures. It combines the Effective Dart Style Guide and the pedantic package with additional rules to keep your projects in tip-top shape.

About Very Good Analysis

After working on many client projects, we realized that we were continually copying lint rules from different sources and customizing them to fit our needs. To make things more efficient and consistent, we decided to put them all into one repository and make it widely available.

Introducing the Very Good Analysis package!

Very Good Analysis package listing on pub.dev Screenshot of Very Good Analysis on pub.dev

Some of the key aspects of Very Good Analysis include:

  • Stricter type checks enabled: Ensures that the Dart type inference engine does not implicitly cast or choose the dynamic type when the static type cannot be determined.
  • Prefer const constructors: Ensures that const constructors are used whenever possible for better performance.
  • Prefer final fields: When variable reassignments are not necessary, fields are marked final to ensure that they remain unchanged and promote optimization by the compiler.
  • Sort constructors first: Ensures that constructor declarations are placed above all other members to improve readability for developers.

The full list of rules can be found in the Very Good Analysis documentation.

Very Good Analysis Markdown Badge

Very Good Analysis badge

If you use Very Good Analysis in your project, you can also unlock the Very Good Analysis badge on GitHub. The documentation contains instructions for how to add the badge to your README.md.

Check out the package on pub.dev and give it a like if you find it useful!

Felix Angelov contributed to this article.

About the Author

Frequently Asked Questions

What is Very Good Analysis?

Very Good Analysis is an open source package of Dart and Flutter lint rules curated by Very Good Ventures. It combines the Effective Dart Style Guide with the pedantic rule set and adds extra rules VGV uses on its own projects.

What kind of rules does Very Good Analysis enable?

Highlights include stricter type checks that block implicit dynamic casts, a preference for const constructors to improve runtime performance, a preference for final fields when reassignment is not needed, and a rule that places constructors above other class members for readability. The full list lives in the analysis_options.yaml in the repo.

How do I add Very Good Analysis to my Dart or Flutter project?

Add the package from pub.dev, include it in dev_dependencies in your pubspec.yaml, and reference it from your analysis_options.yaml with include: package:very_good_analysis/analysis_options.yaml.

Can I show off that my project uses Very Good Analysis?

Yes. The repo provides a Markdown badge you can drop into your README. Setup instructions are in the Very Good Analysis documentation.