|
1 | 1 | [](https://pub.dev/packages/lints)
|
2 | 2 | [](https://github.com/dart-lang/lints/actions?query=branch%3Amain)
|
3 | 3 |
|
4 |
| -This repo contains official Dart lint rules. |
| 4 | +# Official Dart lint rules. |
5 | 5 |
|
| 6 | +The Dart linter is a static analyzer for identifying possible problems in your |
| 7 | +Dart source code. More than a hundred [linter rules][rules] are available, |
| 8 | +checking anything from potential typing issues, coding style, and formatting. |
| 9 | + |
| 10 | +The current `package:lints` contains the official selections of lints that the |
| 11 | +Dart team encourages using. |
| 12 | + |
| 13 | +Two sets of lints are available: |
| 14 | + |
| 15 | +* ***Core lints***: Lints that help identify critical issues that are likely to |
| 16 | +lead to problems when running or consuming Dart code. All code should pass these |
| 17 | +lints. |
| 18 | + |
| 19 | +* ***Recommended lints***: Lints that help identify additional issues that may |
| 20 | +to lead to problems when running or consuming Dart code, and lints that enforce |
| 21 | +writing Dart using a single, ideomatic style and format. All code is encouraged |
| 22 | +to pass these lints. The recommended lints include all the core lints. |
| 23 | + |
| 24 | +## How these lints are used |
| 25 | + |
| 26 | +When creating new Dart project using the [`dart create`][dart create] command, |
| 27 | +the 'recommended' set of lints are enabled by default. |
| 28 | + |
| 29 | +When uploading a package to the [pub.dev] package repository, packages [are |
| 30 | +scored pub point][scoring] depending on whether they pass at least the 'core' |
| 31 | +lints (note: the recommended lints automatically include all core lints). |
| 32 | + |
| 33 | +For documentation on the individual lints, see the [Linter rules][rules] page on |
| 34 | +dart.dev. |
| 35 | + |
| 36 | +## Customizing the pre-defined lint sets |
| 37 | + |
| 38 | +You can customize the pre-defined lint sets, both to disable one or more of the |
| 39 | +lints included, or to add additional lints. For details see [customizing static |
| 40 | +analysis]. |
| 41 | + |
| 42 | +[dart create]: https://dart.dev/tools/dart-tool |
| 43 | +[scoring]: https://pub.dev/help/scoring |
| 44 | +[customizing static analysis]: https://dart.dev/guides/language/analysis-options |
| 45 | +[rules]: https://dart.dev/tools/linter-rules |
| 46 | +[pub.dev]: https://pub.dev |
0 commit comments