Clone this repo:
  1. 605b655 allow overrides with a doc comment only if they are abstract (#2723) by Sam Rawlins · 2 days ago master
  2. 12c2953 + bernardo (#2728) by Phil Quitslund · 4 days ago
  3. 82e4f0e Update unnecessary_getters_setters to allow for non-basic assignments (#2724) by Sam Rawlins · 5 days ago
  4. 47486d4 Allow interpolations on adjacent strings (#2721) by Sam Rawlins · 5 days ago
  5. fd36031 Allow unnecessary getters and setters with annotations (#2722) by Sam Rawlins · 5 days ago

Linter for Dart

The Dart Linter package defines lint rules that identify and report on “lints” found in Dart code. Linting is performed by the Dart analysis server and the dart analyze command in the Dart command-line tool.

Lint Count 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. Enforceable lint rules (or “lints”) are cataloged here and can be configured via an analysis options file. The linter is run from within the dart analyze command-line tool shipped with the Dart SDK. Assuming you have lints configured in an analysis_options.yaml file at the root of your project with these contents:

    - annotate_overrides
    - hash_and_equals
    - prefer_is_not_empty

you could lint your package like this:

$ dart analyze .

and see any violations of the annotate_overrides, hash_and_equals, and prefer_is_not_empty rules in the console. To help you choose the rules you want to enable for your package, we have provided a complete list of rules with lints recommended by the Dart team collected in package:lints. For the lints that are enforced internally at Google, see package:pedantic. For a set of rules corresponding to the Effective Dart guide, see package:effective_dart. Lints recommended for Flutter apps, packages, and plugins are documented in package:flutter_lints.

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

   // ignore: camel_case_types
   class whyOhWhy { }

tells the Dart analyzer to ignore this instance of the camel_case_types warning.

End-of-line comments are supported as well. The following communicates the same thing:

   class whyOhWhy { // ignore: camel_case_types

To ignore a rule for an entire file, use the ignore_for_file comment flag. For example,

// ignore_for_file: camel_case_types


class whyOhWhy { }

tells the Dart analyzer to ignore all occurrences of the camel_case_types warning in this file.

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

    - camel_case_types
    camel_case_types: error

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


Feedback is 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 in the issue tracker.