duplicate_ rule
The rule '{0}' is already enabled and doesn't need to be enabled again.
Description
#The analyzer produces this diagnostic when the same lint rule is listed more than once in the linter/rules section.
Example
#
The following code produces this diagnostic because the lint rule
avoid_print appears twice in the list of enabled rules:
// %uri="analysis_options.yaml"
linter:
rules:
- avoid_print
- avoid_print
Common fixes
#Remove the duplicates:
// %uri="analysis_options.yaml"
linter:
rules:
- avoid_print
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Page last updated on 2025-12-5. View source or report an issue.