'How to ignore all lint rules for a file or a project?
I'm seeing too many lint warnings in my file, for example:
Avoid
Prefer const with constant constructors
Use key in widget constructors
I know how to disable a rule for a specific line or for the entire file, but I want to know is there any way I can disable all these lint warnings with something like
// ignore_for_file: all
Solution 1:[1]
in your analysis_options.yaml file:
linter:
rules:
avoid_print: false
# add more here ...
# Available lints see: [https://dart-lang.github.io/linter/lints/index.html][1]
Solution 2:[2]
Unfortunately, there is no such comment like that. These lint rules are coming from flutter_lints package which is included in your analysis_options.yaml file, So, open the file and comment this line out:
// include: package:flutter_lints/flutter.yaml
After this, save the file using command + s
Solution 3:[3]
Just remove flutter_lints package from pubspec.yaml file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sowat Kheang |
| Solution 2 | iDecode |
| Solution 3 | Emin Abdulalimov |
