How can I disable all lints in a file?

974 Views Asked by At

I have a file in my project that breaks many lint rules, and I cannot make major changes to it. How can I disable all lints within this file?

1

There are 1 best solutions below

0
hacker1024 On BEST ANSWER

As of Dart 2.15, an inline ignore directive can be used to disable all lints in a file.

// ignore_for_file: type=lint

Case sensitivity and whitespace is ignored; the following styles also work, for example:

  • TYPE=LINT
  • type = lint

To learn more, the discussion leading up to this addition to the analyser can be found in the related GitHub issue and code review thread.