Contents

document_ignores

Contents

Document ignore comments.

This rule is available as of Dart 3.5.

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;

Usage

#

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