Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The directive // ignore_for_file: type=lint is not working properly for custom_lint. #234

Open
arthurbcd opened this issue Mar 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@arthurbcd
Copy link

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

  1. Add // ignore_for_file: type=lint to any existing file with custom_lint activated.
  2. Remove it.

Expected behavior
Lints to be instantly disabled.

@arthurbcd arthurbcd added the bug Something isn't working label Mar 3, 2024
@rrousselGit
Copy link
Collaborator

It is working fine for me. Please share a complete example.

@rrousselGit rrousselGit added the question Further information is requested label Mar 3, 2024
@arthurbcd
Copy link
Author

arthurbcd commented Apr 14, 2024

Example here:

  1. Clone it
    https://github.com/arthurbcd/type_lint_issue

  2. After pub get add the line on the top of main.dart:

// ignore_for_file: type=lint

The lints stay even after it adding it.
image

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].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants