Update README.md
1 file changed
tree: 49d74afce81266e303aebc1921e7441d535760bd
  1. bin/
  2. lib/
  3. test/
  4. tool/
  5. .gitignore
  6. .travis.yml
  7. AUTHORS
  8. codereview.settings
  9. CONTRIBUTING.md
  10. LICENSE
  11. pubspec.yaml
  12. README.md
README.md

Linter for Dart

A Dart style linter.

Build Status Coverage Status

Installing

Clone the linter repo like this:

git clone https://github.com/dart-lang/linter.git

When the source is more mature, we’ll push regular builds to pub.

Usage

The linter for Dart gives you feedback to help you keep your code in line with the published Dart Style Guide. Currently enforced lint rules (or “lints”) are catalogued here. When you run the linter all lints are enabled but don't worry, configuration, wherein you can specifically enable/disable lints, is in the works. While initial focus is on style lints, other lints that catch common programming errors are certainly of interest. If you have ideas, please file a feature request.

Since we are currently in such active development, running from source is the best way to try dart_lint out.

Running it looks like this:

dart path_to_lint_clone/bin/lint.dart my_library.dart

With example output looking like this:

Linting /Users/acme/dart/my_library/lib/my_library.dart...
[lint] PREFER using a public final field instead of a private field with 
a public getter.
(/Users/acme/dart/my_library/lib/my_library.dart, line 4, col 3)
1 lint found.

Supported options are

-h, --help            Shows usage information.
    --dart-sdk        Custom path to a Dart SDK.
-p, --package-root    Custom package root. (Discouraged.) Remove to use package information computed by pub.

Note that you should not need to specify an sdk or package-root. Other configuration options are on the way.

Contributing

Feedback is, of course, greatly appreciated and contributions are welcome! Please read the contribution guidelines.

Features and bugs

Please file feature requests and bugs at the issue tracker.