many_lints 0.4.1 copy "many_lints: ^0.4.1" to clipboard
many_lints: ^0.4.1 copied to clipboard

A comprehensive collection of custom lint rules, quick fixes, and code assists for Flutter and Dart projects.

Pub Package Build Status coverage 98% MIT License analyzer version 12.1.0 Documentation

A useful collection of custom lints for Flutter & Dart projects. Uses the new analysis_server_plugin system for direct integration with dart analyze and IDEs.

Browse all rules on the documentation site

Getting started #

Requires Dart 3.10+ (Flutter 3.38+)

Add many_lints to the top-level plugins section in your analysis_options.yaml file (NOT under analyzer:):

plugins:
  many_lints: ^0.4.1

That's it — the analysis server will automatically download and resolve the plugin from pub.dev. There is no need to add it to your pubspec.yaml.

Important: After any change to the plugins section, you must restart the Dart Analysis Server.

For local development setup, see CONTRIBUTING.md.

Configuring diagnostics #

All rules are registered as warnings and enabled by default. You can enable or disable individual rules under the diagnostics key:

plugins:
  many_lints:
    version: ^0.4.1
    diagnostics:
      prefer_center_over_align: true
      use_bloc_suffix: false

Available Lints #

100 lints with 78 quick fixes, all enabled by default as warnings. Each rule links to its full documentation with examples and fix details.

Category Rules Description
Async Safety 2 Async/await and state mutation safety
BLoC & Riverpod 9 BLoC and Riverpod state management patterns
Class Naming 3 Class and type naming conventions
Code Organization 3 Code structure and organization
Code Quality 2 General code quality improvements
Collections & Types 13 Collection and type-related checks
Control Flow 11 Control flow statements and patterns
Hook Rules 2 Flutter Hooks conventions
Pattern Matching 4 Dart pattern matching best practices
Resource Management 3 Resource cleanup and disposal
Riverpod State 2 Riverpod-specific state rules
Shorthand Patterns 4 Dot shorthand syntax patterns
State Management 6 StatefulWidget and state patterns
Testing 4 Testing best practices and matchers
Type Annotations 5 Type annotation conventions
Widget Best Practices 14 General widget best practices
Widget Replacement 13 Simpler widget alternatives

Available Assists #

  • Convert to collection-for: Converts .map().toList() or .map().toSet() to collection-for syntax.

Suppressing Diagnostics #

To suppress a specific lint, use comments:

// ignore: many_lints/prefer_center_over_align
const Align(...);

// ignore_for_file: many_lints/use_bloc_suffix

Example #

See the example/ directory for a Flutter project that demonstrates every lint rule in action. Each file corresponds to a single rule and contains code that triggers the lint.

4
likes
0
points
349
downloads

Documentation

Documentation

Publisher

verified publisherdominikkrajcer.com

Weekly Downloads

A comprehensive collection of custom lint rules, quick fixes, and code assists for Flutter and Dart projects.

Homepage
Repository (GitHub)
View/report issues

Topics

#lint #lints #linter #analyzer #code

License

unknown (license)

Dependencies

analysis_server_plugin, analyzer, analyzer_plugin

More

Packages that depend on many_lints