Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Rule Request: Duplicate Imports #1881
New Issue Checklist
Duplicate imports are unnecessary.
// Should Trigger import Foundation import Dispatch import Foundation // Should Trigger import Foundation import Foundation.NSString // Should Not Trigger Import Foundation.NSString Import Foundation.NSRange
Shouldn't be configurable. Either there are duplicates or not.
Enabled by default.
@marcelofabri removing this duplicate import motivated me to write this rule request: https://github.com/realm/SwiftLint/pull/1872/files#diff-71e28580a5fd3b8b3f701a7c8ca9f6a9
There are gotchas around conditional imports, so I suggest we just not count imports in a conditional compilation expression.