deminearchiver_lints 2.0.2
deminearchiver_lints: ^2.0.2 copied to clipboard
Opinionated lints for Dart and Flutter projects.
deminearchiver lints #
Opinionated lints for Dart and Flutter projects.
Used in projects created or maintained by @deminearchiver.
Table of contents
Getting started #
Installation #
This package must only ever be added as a dev dependency to the consuming package.
Manually
You can manually specify the dependency in pubspec.yaml.
dev_dependencies:
deminearchiver_lints: ^2.0.0
In Dart projects
For Dart-only projects, prefer using dart pub.
dart pub add dev:deminearchiver_lints
In Flutter projects
For Flutter projects, prefer using flutter pub.
flutter pub add dev:deminearchiver_lints
Usage #
Composition over inheritance #
This package is built on the principle of using composition over inheritance:
include:
- package:deminearchiver_lints/a.yaml
- package:deminearchiver_lints/b.yaml
- package:deminearchiver_lints/c.yaml
Always include the base preset first #
The intended way to use the provided presets is to include the base preset first, as following:
include:
- package:deminearchiver_lints/base.yaml
# Further overlays must be added after the base.
Additional information #
Composite presets table #
The table below presents information about the composite presets included in this package.
For brevity, the package name (package:deminearchiver_lints/) and the file extension (.yaml) have been omitted from preset names. So, given a preset name {preset}, the full path for inclusion in analysis_options.yaml would be package:deminearchiver_lints/{preset}.yaml.
While possible, it's not recommended to mix together presets marked as incompatible.
Base layer
| Name | Incompatibilities | Description |
|---|---|---|
base |
None. | The base for all other presets to be overlayed onto. |
Public APIs layer
| Name | Incompatibilities | Description |
|---|---|---|
app |
package, package_loose. |
Relaxes all the requirements which are enabled by the package preset, as they mostly don't matter when building Flutter apps that don't have a public API surface, unlike packages. |
package_loose |
app, package. |
Same as package, but relaxes the requirement of having to document every public API member. |
package |
app, package_loose. |
The strictest of the three, requiring to both annotate with types and document public API members. |
Acknowledgements #
-
very_good_analysispackage for being the solid foundation for linting production-ready Dart & Flutter projects. -
linterventionpackage for inspiring the separation of linter rules for package and app projects.