Clone this repo:
  1. 86cc619 Merge pull request #638 from JPaulsen/fiX_linted_node_avoid_types_on_closure_parameters by Alexei Eleusis Diaz Vera · 8 hours ago master
  2. 583d625 Merge pull request #603 from JPaulsen/fix_cascade_invocations by Alexei Eleusis Diaz Vera · 8 hours ago
  3. 0e99706 Fix rule: cascade_invocations by Juan Pablo Paulsen · 9 hours ago
  4. 9c6d2ea Fix linted node: avoid_types_on_closure_parameters by Juan Pablo Paulsen · 10 hours ago
  5. 46ba3a4 Merge pull request #633 from a14n/add-test-always_put_control_body_on_new_line by Alexei Eleusis Diaz Vera · 27 hours ago

Linter for Dart

A Dart style linter.

Build Status Build status Coverage Status Pub

Installing

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 https://github.com/dart-lang/linter.git

Usage

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 file with these contents:

linter:
  rules:
    - annotate_overrides
    - hash_and_equals
    - prefer_is_not_empty

you could lint your package like this:

$ dartanalyzer --options .analysis_options .

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). For more on configuring analysis, see the analysis option file docs.

Contributing

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.