leancode_lint
28.0.0, released 5 weeks ago by leancode.co
An opinionated set of high-quality, robust, and up-to-date lint rules used at LeanCode.
What it does
Provides a comprehensive set of custom lint rules and an analyzer plugin for Dart and Flutter. It enforces code conventions, helps avoid common anti-patterns like using BuildContext in Blocs, and catches structural code issues.
AI-written summary of version 28.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to enforce strict, high-quality code style and architecture rules in your Flutter projects.
- You want custom lint checks tailored towards Bloc-based state management.
- You want to catch potential bugs and stale UI reads during static analysis.
Skip it when
- You prefer default Flutter and Dart lints without strict opinionated additions.
- Your project does not use state management patterns or architectures covered by LeanCode's rules.
Strengths
- Includes helpful custom lints and quick fixes for common architectural mistakes.
- Supports custom configuration via a dedicated plugin package.
- Actively maintained with regular updates for newer Dart and analyzer versions.
Weaknesses
- Strict opinionated rules may require significant refactoring on existing legacy codebases.
- Requires proper setup of analyzer plugins in analysis_options.yaml.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add leancode_lint as a dev dependency, include its analysis_options.yaml in your project's configuration, and enable the analyzer plugin.
include: package:leancode_lint/analysis_options.yaml
plugins:
leancode_lint: ^20.0.0
analyzer:
exclude:
- '**/*.g.dart'Alternatives
Packages that do the same job and could replace leancode_lint.
- flutter_lints
Official and standard set of lint rules recommended by the Flutter team for general usage.
83Compare - lints
Official Dart team lint rules for general Dart packages and applications.
86Compare
Works with
Packages commonly used together with leancode_lint: ones it builds on, ones built on it, and its own family.
- analyzerleancode_lint depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlleancode_lint depends on itA Dart library for parsing YAML documents into Dart data structures.
- source_spanleancode_lint depends on itStandard representation for source code locations, spans, and human-friendly error messages.
- analyzer_pluginleancode_lint depends on itFramework for building plugins for the Dart analysis server
- analysis_server_pluginleancode_lint depends on itFramework and support code for building plugins for the Dart analysis server.
- leancode_cubit_utilsSame familyCubits and widgets to eliminate boilerplate for single requests and paginated pages.
- leancode_hooksSame familyA collection of utility hooks for Flutter, including BLoC integration and controllers.