Add support for ignoring unused imports diagnostics using #noqa #5080
luabud
started this conversation in
Enhancement
Replies: 1 comment 1 reply
-
AI to the rescue. A google search recommended using an _ in the import and that made pylint happy as well as prevented it from being removed by pylance as well.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is related to the problem mentioned at #4902, regarding implicit imports being removed when running the "Remove unused imports" code action. This would allow lines marked with #noqa to be skipped from removal.
A lot of linters such as Pylint and Flake8 already support #noqa to ignore diagnostics for specific lines. It might make sense for Pylance to support it too, at least for unused import scenarios
Beta Was this translation helpful? Give feedback.
All reactions