leobit_lints 0.9.1 copy "leobit_lints: ^0.9.1" to clipboard
leobit_lints: ^0.9.1 copied to clipboard

Lints for Dart and Flutter with some custom rules from Leobit

Leobit Lints #

Lint rules for Dart and Flutter developed by Leobit.

Note: This package was inspired by Very Good Analysis.

Usage #

To use the lints, add as a dev dependency in your pubspec.yaml:

dev_dependencies:
  leobit_lints: <latest-version>

Then, add an include in analysis_options.yaml:

include: package:leobit_lints/leobit_lints.yaml

Or you can include lints from dart library only (same as leobit_lints.yaml, but without custom ones):

include: package:leobit_lints/standard_lints_only.yaml

Custom Rules: #

Here is the table of custom rules with information about them.

Name Version Description Exceptions
avoid_bang_operator v0.1.0 Forbids to use a bang operator ! as it may result in unexpected runtime exceptions. None.
avoid_dynamic_type v0.4.0 Forbids to use a dynamic keyword. dynamic is allowed inside Map<> for json serialization.
avoid_late_keyword v0.1.0 Forbids late keyword as it may result in unexpected runtime exceptions. late is allowed only with instant initializer.
avoid_redundant_async v0.3.0 Finds redundant async functions, method and keywords. Overridden methods and getters.
avoid_widget_function v0.4.0 Forbids return widget from getters, methods and functions, because it is anti-pattern in Flutter. Prefer extracting it to separate widget. Overridden methods and getters. Allows to return Provider and subtypes.
prefer_correct_dispose_order v0.5.0 Forces developers to put super.dispose() calls in the end of method. Only for StatefulWidget. None.
prefer_returning_condition v0.5.0 Finds if-else statements with 'return' of boolean literal in both 'then' and 'else' statements. Proposes to return condition instead. None.
strict_double_literal v0.6.0 Forces developers to remove redundant zeros from double literals. None.
use_const_border v0.2.0 Forces developers to use Border.fromBorderSide instead of Border.all, so const modifier can be added. Some of Border.all arguments are not const.
use_const_border_radius v0.2.0 Forces developers to use BorderRadius.all instead of BorderRadius.circular, so const modifier can be added. Some of BorderRadius.circular arguments are not const.
use_list_view v0.3.0 Forces developers to use ListView instead of SingleChildScrollView with nested Column None.
8
likes
140
points
283
downloads

Publisher

verified publisherleobit.com

Weekly Downloads

Lints for Dart and Flutter with some custom rules from Leobit

Repository (GitLab)
View/report issues

Topics

#linter #lints #analyzer #analysis

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, analyzer_plugin, collection, custom_lint, custom_lint_builder

More

Packages that depend on leobit_lints