Clone this repo:
  1. 9f3df65 remove obsolete comments (#1037) by Alexandre Ardhuin · 33 hours ago master
  2. bb3cc66 0.1.54 (#1033) by Phil Quitslund · 4 days ago
  3. ee8f50f update deprecated package references (#1032) by Phil Quitslund · 4 days ago
  4. b03cbd5 bump dependencies (#1031) by Alexandre Ardhuin · 5 days ago
  5. e5f5cb1 add avoid_keyword_to_create_instances (#936) by Alexandre Ardhuin · 6 days ago

Linter for Dart

A Dart style linter.

Build Status Build status Coverage Status Pub


The linter is bundled with the Dart SDK; if you have an updated Dart SDK already, you're done!

Alternatively, if you want to contribute to the linter or examine the source, clone the linter repo like this:

$ git clone


The linter gives you feedback to help you catch potential errors and keep your code in line with the published Dart Style Guide. Currently enforcable lint rules (or “lints”) are catalogued here and can be configured via an analysis options file. The linter is run from within the dartanalyzer command-line tool shipped with the Dart SDK. Assuming you have lints configured in an analysis_options.yaml file with these contents:

    - annotate_overrides
    - hash_and_equals
    - prefer_is_not_empty

you could lint your package like this:

$ dartanalyzer --options analysis_options.yaml .

and see any violations of the annotate_overrides, hash_and_equals, and prefer_is_not_empty rules in the console. In practice you would probably configure quite a few more rules (the full list is here).

If a specific lint warning should be ignored, it can be flagged with a comment. For example,

   // ignore: avoid_as
   (pm as Person).firstName = 'Seth'

tells the dartanalyzer to ignore this instance of avoid_as warning. As lints are treated the same as errors and warnings by the analyzer, their severity can similarly be configured in an options file. For example, an analysis options file that specifies

    - avoid_as
    avoid_as: error

tells the analyzer to treat avoid_as lints as errors. For more on configuring analysis see the analysis option file docs.


Feedback is, of course, greatly appreciated and contributions are welcome! Please read the contribution guidelines; mechanics of writing lints are covered here.

Features and bugs

Please file feature requests and bugs at the issue tracker.