flutter_compositions_lints 0.2.3
flutter_compositions_lints: ^0.2.3 copied to clipboard
Custom lint rules for Flutter Compositions to ensure reactive props usage and best practices.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
0.2.2 - 2026-02-17 #
0.2.1 - 2026-02-15 #
Changed #
- Downgrade analyzer to
^9.0.0and analysis_server_plugin to^0.3.0for workspace compatibility - Pin
analyzer_testingto0.1.7for Flutter SDK compatibility - Add
analysis_options.yamlinheriting fromvery_good_analysis - Fix all lint issues: add doc comments, use cascades, use
finallocals, fix formatting
0.2.0 - 2026-02-15 #
Changed #
- BREAKING: Replaced
flutter_compositions_no_mutable_fieldsrule withflutter_compositions_shallow_reactivity- The new rule warns about shallow reactivity limitations instead of enforcing final fields
- Detects direct mutations that won't trigger reactive updates:
- Property assignments:
ref.value['key'] = xorref.value.property = x - Array element assignments:
ref.value[0] = x - Mutating method calls:
ref.value.add(),.remove(),.clear(), etc.
- Property assignments:
- Updated all documentation (English and Chinese) to reflect the new rule
- Updated example code and fixtures
- BREAKING: Migrate from
custom_linttoanalysis_server_plugin- New entry point:
lib/main.dartwithanalysis_server_pluginformat - Rules now extend
AnalysisRuleinstead ofDartLintRule - Tests migrated to
AnalysisRuleTestwith@reflectiveTest - Removed fixture files and old test utilities
- New entry point:
- Upgrade Dart SDK constraint to
^3.10.0
Removed #
flutter_compositions_no_mutable_fieldslint rule and all associated tests
Added #
flutter_compositions_shallow_reactivitylint rule with comprehensive test coverage- New test fixtures demonstrating shallow reactivity patterns
- Detailed documentation explaining common mutation patterns to avoid
flutter_compositions_no_logic_in_builderlint rule — prevents logic in builder functionsflutter_compositions_prefer_raw_controllerlint rule — suggests.rawover.valuefor controllers in builders
0.1.1 - 2025-11-06 #
- REFACTOR: remove type safety lint rule and related tests.
- FIX: configure dart test to exclude fixture files from test runs.
- FEAT: init project.
0.1.0 - 2025-10-27 #
Added #
- Initial release of Flutter Compositions Lints
- Custom lint rules for enforcing Flutter Compositions best practices:
flutter_compositions_ensure_reactive_props- Ensures props are accessed viawidget()for reactivityflutter_compositions_no_async_setup- Prevents async setup methodsflutter_compositions_controller_lifecycle- Ensures proper controller disposal withuse*helpersflutter_compositions_no_mutable_fields- Enforces immutable widget fieldsflutter_compositions_provide_inject_type_match- Warns against common type conflicts in DIflutter_compositions_no_conditional_composition- Prevents conditional composition API calls
- Comprehensive test coverage using
testAnalyzeAndRun() - Fixture files for each lint rule
- Integration tests
- Documentation for all rules
Documentation #
- Complete rules documentation in RULES.md
- Testing guide in test/README.md
- Example code for good and bad practices
Development #
- Automated testing with
custom_lint_builder - All tests passing (18/18)
- GitHub Actions CI integration