prefer-riverpod-notifier-suffix
Suggests ending Notifier class names with the Notifier suffix.
⚙️ Config
Set banned-suffixes (default is [ProviderNotifier]) to configure a list of banned suffixes.
analysis_options.yaml
dcm:
rules:
- prefer-riverpod-notifier-suffix:
banned-suffixes:
- NotifierProvider
Example
❌ Bad:
// LINT: The name of this notifier class should end with Notifier.
// Try renaming this class.
class Counter extends Notifier<int> {}
// LINT: The name of this notifier class ends with one of the banned suffixes.
// Try renaming this class.
class CounterProviderNotifier extends Notifier<int> {}
✅ Good:
class CounterNotifier extends Notifier<int> {}
class AnotherNotifier extends Notifier<int> {}