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

[Feature Request]: Add a rule against unused imports #58

Closed
1 task done
strangerkir opened this issue Nov 18, 2022 · 2 comments
Closed
1 task done

[Feature Request]: Add a rule against unused imports #58

strangerkir opened this issue Nov 18, 2022 · 2 comments

Comments

@strangerkir
Copy link

Is your feature request related to a problem?

After code refactoring or merging, we often have redundant namespace imports with the use keyword. This is a dead code that does nothing but pollution. It's easy to overlook these lines.

Describe the desired solution

Add a sniff raising warning or error on redundant namespace imports.

Describe the alternatives that you have considered

Require the code standard with this rule and just use it.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@gmazzap
Copy link
Contributor

gmazzap commented Aug 30, 2023

We have added Slevomat standard as a dependency.

Thar standard has a lot of Sniffs, so we could use much more sniff besides the "unused use" proposed here.
But we need to gather consensus on the sniffs to require.

@gmazzap
Copy link
Contributor

gmazzap commented Aug 30, 2023

Closing in favor of #71

@gmazzap gmazzap closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants