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
Was this page's content helpful?
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Report an issue.