Skip to content
pubscout

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.

$ flutter pub add leancode_lint
Source repository

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.

  • lints

    Official Dart team lint rules for general Dart packages and applications.

Works with

Packages commonly used together with leancode_lint: ones it builds on, ones built on it, and its own family.