All Projects → dart-lang → Linter

dart-lang / Linter

Licence: bsd-3-clause
Linter for Dart.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Linter

Exakat
The Exakat Engine : smart static analysis for PHP
Stars: ✭ 346 (-6.99%)
Mutual labels:  linter, lint
eslint-config
An ESLint shareable config that I used in my projects
Stars: ✭ 15 (-95.97%)
Mutual labels:  lint, linter
cpplint
Static code checker for C++
Stars: ✭ 1,014 (+172.58%)
Mutual labels:  lint, linter
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-95.43%)
Mutual labels:  lint, linter
elint
A easy way to lint your code
Stars: ✭ 38 (-89.78%)
Mutual labels:  lint, linter
lint-prepush
Lint committed files on pre-push 🔬
Stars: ✭ 18 (-95.16%)
Mutual labels:  lint, linter
ue5-style-guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,892 (+677.42%)
Mutual labels:  lint, linter
extra pedantic
Stricter Dart analyzer linter settings and best practices.
Stars: ✭ 28 (-92.47%)
Mutual labels:  lint, linter
selective
Statically find HTML anti patterns using CSS Selectors
Stars: ✭ 15 (-95.97%)
Mutual labels:  lint, linter
Format.cmake
💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.
Stars: ✭ 94 (-74.73%)
Mutual labels:  lint, linter
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-87.37%)
Mutual labels:  lint, linter
Reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+1120.7%)
Mutual labels:  linter, lint
AutoBindings
Set of annotations that aims to make your Android development experience easier along with lint checks.
Stars: ✭ 15 (-95.97%)
Mutual labels:  lint, linter
flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (-77.15%)
Mutual labels:  lint, linter
arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (-83.06%)
Mutual labels:  lint, linter
pahout
A pair programming partner for writing better PHP. Pahout means PHP mahout 🐘
Stars: ✭ 43 (-88.44%)
Mutual labels:  lint, linter
relint
General purpose RegEx based file linter.
Stars: ✭ 33 (-91.13%)
Mutual labels:  lint, linter
arcanist-linters
A collection of custom Arcanist linters
Stars: ✭ 64 (-82.8%)
Mutual labels:  lint, linter
JSONCustomLintr
Library to allow creation, running, and reporting of custom lint rules for JSON files
Stars: ✭ 19 (-94.89%)
Mutual labels:  lint, linter
gandalf-lint
Bad Code Shall Not Pass
Stars: ✭ 29 (-92.2%)
Mutual labels:  lint, linter

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

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. Enforceable lint rules (or "lints") are catalogued 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:

linter:
  rules:
    - 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. 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.

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

linter:
  rules:
    - camel_case_types
analyzer:
  errors:
    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.

Contributing

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].