Skip to content

Rule Request: Redundant import #2248

Closed
Closed
@abdulowork

Description

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

Metadata

Assignees

No one assigned

    Labels

    rule-requestRequests for a new rules.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions