void_signals_lint 1.0.0
void_signals_lint: ^1.0.0 copied to clipboard
Production-grade custom lint rules for void_signals - comprehensive static analysis to enforce best practices, catch common mistakes, and provide quick fixes for reactive state management patterns.
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.
1.0.0 - 2024-11-28 #
Added #
- Initial stable release of void_signals_lint
- 33+ comprehensive lint rules for void_signals ecosystem
Core Rules (Errors & Warnings)
avoid_signal_in_build- Prevents signal creation in build methodsavoid_nested_effect_scope- Warns against nested effect scopesmissing_effect_cleanup- Ensures effects are stored for cleanupavoid_signal_value_in_effect_condition- Prevents conditional dependency issuesavoid_signal_access_in_async- Warns about signal access after awaitavoid_mutating_signal_collection- Prevents direct mutation of collectionsavoid_signal_creation_in_builder- Prevents signals in builder callbacksmissing_scope_dispose- Ensures effect scopes are disposedavoid_set_state_with_signals- Warns setState usage with signalscaution_signal_in_init_state- Cautions signal creation in initStatewatch_without_signal_access- Warns Watch without signal accessavoid_circular_computed- Detects circular computed dependenciesavoid_async_in_computed- Warns async operations in computed
Best Practice Rules (Suggestions)
prefer_watch_over_effect_in_widget- Suggests Watch over raw effectsprefer_batch_for_multiple_updates- Suggests batching multiple updatesprefer_computed_over_derived_signal- Suggests computed over manual derivationprefer_final_signal- Suggests final for top-level signalsprefer_signal_over_value_notifier- Migration from ValueNotifierprefer_peek_in_non_reactive- Suggests peek() outside reactive contextavoid_effect_for_ui- Suggests Watch over effect for UIprefer_signal_scope_for_di- Suggests SignalScope for DIprefer_signal_with_label- Suggests adding debug labelsunnecessary_untrack- Removes unnecessary untrack calls
Hooks Rules (void_signals_hooks)
hooks_outside_hook_widget- Ensures hooks are in HookWidget.build()conditional_hook_call- Prevents hooks in conditionals/loopshook_in_callback- Prevents hooks inside callbacksuse_signal_without_watch- Warns when useSignal is not watcheduse_select_pure_selector- Ensures useSelect selector is pureuse_debounced_zero_duration- Warns against zero duration debounceuse_effect_without_dependency- Warns when effect has no signal depsprefer_use_computed_over_effect- Suggests useComputed for derived valuesprefer_use_signal_with_label- Suggests debug labels for hooksunnecessary_use_batch- Flags unnecessary useBatchunnecessary_use_untrack- Flags unnecessary useUntrack
Features #
- Quick fixes for most rules (12+ automated fixes)
- Real-time analysis as you code
- Configurable rules per project
- Detailed error messages with suggestions
- CI/CD support with
dart run custom_lint