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

Rule Request: Redundant import #2248

Closed
2 tasks done
abdulowork opened this issue Jun 18, 2018 · 5 comments
Closed
2 tasks done

Rule Request: Redundant import #2248

abdulowork opened this issue Jun 18, 2018 · 5 comments
Labels
rule-request Requests for a new rules.

Comments

@abdulowork
Copy link
Contributor

New Issue Checklist

Rule Request

Redundant imports often lead to the confusion about the responsibilities of declarations within a file. I don't know any reasons for why anyone would want to have import declarations of the module they don't use.

  1. Why should this rule be added? Share links to existing discussion about what
    the community thinks about this.

I didn't find any

  1. Provide several examples of what would and wouldn't trigger violations.

Would trigger:

import UIKit
class Foo { }

Wouldn't trigger:

import UIKit
class Foo { let bar = UIView() }
  1. Should the rule be configurable, if so what parameters should be configurable?

No

  1. Should the rule be opt-in or enabled by default? Why?
    See README.md for guidelines on when to mark a
    rule as opt-in.

Such rule should be enabled by default

@marcelofabri marcelofabri added rule-request Requests for a new rules. and removed O:User labels Jun 24, 2018
@jpsim
Copy link
Collaborator

jpsim commented Jun 24, 2018

This would require SwiftLint to run in a "compiled mode" as I've discussed before.

@abdulowork
Copy link
Contributor Author

@jpsim is it something you don’t consider for implementation?

@marcelofabri
Copy link
Collaborator

@jpsim can we close this as #2381 was merged?

jpsim added a commit that referenced this issue Sep 10, 2018
@jpsim
Copy link
Collaborator

jpsim commented Sep 10, 2018

Nice find, yes! 8fd15b0

@jpsim jpsim closed this as completed Sep 10, 2018
@realm-probot

This comment has been minimized.

sjavora pushed a commit to sjavora/SwiftLint that referenced this issue Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule-request Requests for a new rules.
Projects
None yet
Development

No branches or pull requests

3 participants