SwiftLint
SwiftLint copied to clipboard
Swift type checking using is
New rule request
type ching using is
Bad
if a as? Dog != nil {
doSomeThing()
}
Good
if a is Dog {
doSomeThing()
}
if let dog = dog as? Dog {
dog.run()
}
type checking using "is" is more easy to understand then type casting and check nil
I will take this one
I will take this one
There has been some work in https://github.com/realm/SwiftLint/pull/5561 already.