dart_custom_lint
dart_custom_lint copied to clipboard
The directive `// ignore_for_file: type=lint` is not working properly for custom_lint.
Describe the bug
Flutter allows us to disable lints using: // ignore_for_file: type=lint
.
Reference: https://dart.dev/tools/analysis
This is working as expected, actually.
When I start my project with this directive, all lints will be correctly ignored (flutter's and custom_lint). The problem is when I add this directive to other files. The flutter lints will be immediately ignored, but custom_lint's will stay there.
In order to make it work for custom_lint, I have to restart the analysis server.
To Reproduce
- Add
// ignore_for_file: type=lint
to any existing file with custom_lint activated. - Remove it.
Expected behavior Lints to be instantly disabled.
It is working fine for me. Please share a complete example.
Example here:
-
Clone it https://github.com/arthurbcd/type_lint_issue
-
After
pub get
add the line on the top ofmain.dart
:
// ignore_for_file: type=lint
The lints stay even after it adding it.
Restarting analysis server solves. (slow way)
But if I ctrl+a
then ctrl-x
then ctrl+v
, the lints disappear immediately (fast way).
The same thing happens with other packages like pyramid_lints.
PS: This is a new project created with
Flutter: new project [empty template]
.