document_ignores
Document ignore comments.
Details
#DO document all ignored diagnostic reports.
BAD:
dart
// ignore: unused_element
int _x = 1;
GOOD:
dart
// This private field will be used later.
// ignore: unused_element
int _x = 1;
Enable
#To enable the document_ignores
rule, add document_ignores
under linter > rules in your analysis_options.yaml
file:
analysis_options.yaml
yaml
linter:
rules:
- document_ignores
If you're instead using the YAML map syntax to configure linter rules, add document_ignores: true
under linter > rules:
analysis_options.yaml
yaml
linter:
rules:
document_ignores: true
Unless stated otherwise, the documentation on this site reflects Dart 3.6.2. Page last updated on 2025-01-27. View source or report an issue.