Thanks for your interest in contributing! This guide will help you get started.
- Clone the repository:
git clone https://github.com/Nikoro/many_lints.git
cd many_lints- Install dependencies:
dart pub get- Verify everything works:
dart analyze
dart testThe easiest way to add a new rule is using the /new-lint skill in Claude Code, which guides you step by step.
-
Create the rule in
lib/src/rules/<rule_name>.dart- Extend
AnalysisRule - Define a static
LintCodewithname,problemMessage, andcorrectionMessage - Implement
registerNodeProcessors()to register visitors - Create a
_VisitorextendingSimpleAstVisitor
- Extend
-
Register the rule in
lib/many_lints.dartviaregistry.registerWarningRule() -
Create tests in
test/<rule_name>_test.dartusing theanalyzer_testingframework -
Optionally add a quick fix in
lib/src/fixes/<rule_name>_fix.dart- Extend
ResolvedCorrectionProducer - Register with
registry.registerFixForRule()inlib/many_lints.dart
- Extend
-
Add an example in
example/lib/<rule_name>_example.dart -
Update documentation:
- Add the rule to
README.md(Available Lints section) - Add the rule to
example/README.md(All Rules table) - Add to
CHANGELOG.mdunder[Unreleased]
- Add the rule to
dart test # Run all tests
dart test test/<rule_name>_test.dart # Run a specific test file
dart test --fail-fast # Stop on first failure- Run
dart format .before committing - Run
dart analyzeand fix any issues - Use English for all code, comments, and commit messages
- Follow existing naming conventions (snake_case for rules, PascalCase for classes)
Use conventional commit format:
feat(lint): add <rule_name> rule with quick fix
fix(lint): handle edge case in <rule_name>
refactor: extract shared utility for <description>
docs: update README with new rules
lib/
many_lints.dart # Plugin entry point — register all rules here
src/
rules/ # Lint rules
fixes/ # Quick fixes
assists/ # Code assists
type_checker.dart # Type matching utilities
type_inference.dart # Context type inference
test/ # Test files
example/lib/ # Example files demonstrating each rule