Skip to main content

prefer-riverpod-notifier-suffix

effort: 2m
configurable
pro+

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> {}