From bbad8847155196dea54849ba66851fbc71bd078c Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 11 May 2021 13:33:11 +0200 Subject: [PATCH 1/5] Update README.md Fixes https://github.com/dart-lang/lints/issues/15 --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0e8355..91862f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,46 @@ [![pub package](https://img.shields.io/pub/v/lints.svg)](https://pub.dev/packages/lints) [![Build Status](https://github.com/dart-lang/lints/workflows/validate/badge.svg)](https://github.com/dart-lang/lints/actions?query=branch%3Amain) -This repo contains official Dart lint rules. +# Official Dart lint rules. +The Dart linter is a static analyzer for identifying possible problems in your +Dart source code. More than a hundred [linter rules][rules] are available, +checking anything from potential typing issues, coding style, and formatting. + +The current `package:lints` contains the official selections of lints that the +Dart team encourages using. + +Two sets of lints are available: + +* ***Core lints***: Lints that help identify critical issues that are likely to +lead to problems when running or consuming Dart code. All code should pass these +lints. + +* ***Recommended lints***: Lints that help identify additional issues that may +to lead to problems when running or consuming Dart code, and lints that enforce +writing Dart using a single, ideomatic style and format. All code is encouraged +to pass these lints. The recommended lints include all the core lints. + +## How these lints are used + +When creating new Dart project using the [`dart create`][dart create] command, +the 'recommended' set of lints are enabled by default. + +When uploading a package to the [pub.dev] package repository, packages [are +scored pub point][scoring] depending on whether they pass at least the 'core' +lints (note: the recommended lints automatically include all core lints). + +For documentation on the individual lints, see the [Linter rules][rules] page on +dart.dev. + +## Customizing the pre-defined lint sets + +You can customize the pre-defined lint sets, both to disable one or more of the +lints included, or to add additional lints. For details see [customizing static +analysis]. + +[dart create]: https://dart.dev/tools/dart-tool +[scoring]: https://pub.dev/help/scoring +[customizing static analysis]: https://dart.dev/guides/language/analysis-options +[rules]: https://dart.dev/tools/linter-rules +[pub.dev]: https://pub.dev From 5fdb874fd63e9df4453a4e6e734cab52cb6314eb Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 11 May 2021 18:29:58 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 91862f2..da2a215 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ lead to problems when running or consuming Dart code. All code should pass these lints. * ***Recommended lints***: Lints that help identify additional issues that may -to lead to problems when running or consuming Dart code, and lints that enforce -writing Dart using a single, ideomatic style and format. All code is encouraged +lead to problems when running or consuming Dart code, and lints that enforce +writing Dart using a single, idiomatic style and format. All code is encouraged to pass these lints. The recommended lints include all the core lints. ## How these lints are used @@ -26,11 +26,11 @@ to pass these lints. The recommended lints include all the core lints. When creating new Dart project using the [`dart create`][dart create] command, the 'recommended' set of lints are enabled by default. -When uploading a package to the [pub.dev] package repository, packages [are -scored pub point][scoring] depending on whether they pass at least the 'core' +When uploading a package to the [pub.dev] package repository, packages are +[awarded pub point][scoring] depending on whether they pass at least the 'core' lints (note: the recommended lints automatically include all core lints). -For documentation on the individual lints, see the [Linter rules][rules] page on +For documentation on the individual lints, see the [linter rules][rules] page on dart.dev. ## Customizing the pre-defined lint sets From 446c5fa4c76cbbbd6ab39eae6f7ea6b60620ff3d Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 11 May 2021 19:49:21 +0200 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da2a215..7dde922 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ When creating new Dart project using the [`dart create`][dart create] command, the 'recommended' set of lints are enabled by default. When uploading a package to the [pub.dev] package repository, packages are -[awarded pub point][scoring] depending on whether they pass at least the 'core' +[awarded pub points][scoring] depending on whether they pass at least the 'core' lints (note: the recommended lints automatically include all core lints). For documentation on the individual lints, see the [linter rules][rules] page on From 3ce2dcb2e73085e09c8f36062683f591c1811909 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 11 May 2021 21:18:33 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7dde922..48cfb56 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ lead to problems when running or consuming Dart code, and lints that enforce writing Dart using a single, idiomatic style and format. All code is encouraged to pass these lints. The recommended lints include all the core lints. -## How these lints are used +## Where these lints are used When creating new Dart project using the [`dart create`][dart create] command, the 'recommended' set of lints are enabled by default. @@ -33,6 +33,26 @@ lints (note: the recommended lints automatically include all core lints). For documentation on the individual lints, see the [linter rules][rules] page on dart.dev. +## How to enable these lints + +For new apps created with `dart create`, the lints are enabled by default. + +For existing apps or packages, take these steps to enable these lints: + +1. Add a *dev* dependency on this package to your `pubspec.yaml` file: + +```yaml +dev_dependencies: + lints: ^1.0.0 +``` + +2. Create a new `analysis_options.yaml` file, next to the pubspec, that includes +the lints package: + +```yaml +include: package:lints/core.yaml +``` + ## Customizing the pre-defined lint sets You can customize the pre-defined lint sets, both to disable one or more of the From 142a9ea2f1baafcfe2cee67c234d511e6bc15700 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 11 May 2021 22:00:31 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48cfb56..15cd96c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ to pass these lints. The recommended lints include all the core lints. ## Where these lints are used When creating new Dart project using the [`dart create`][dart create] command, -the 'recommended' set of lints are enabled by default. +the lints from `package:lints` are enabled by default. When uploading a package to the [pub.dev] package repository, packages are [awarded pub points][scoring] depending on whether they pass at least the 'core'