SwiftLint
SwiftLint copied to clipboard
Rule Request: redundant_optional_initialization as default may cause extra work with Swift 6
New Issue Checklist
- [x] Updated SwiftLint to the latest version
- [x] I searched for existing GitHub issues
New rule request
In anticipation of possible requirements to initialise all optionals explicitly, I declared a private var dataSource: UICollectionViewDataSource? = nil
and ran into the redundant_optional_initialization
rule. As #2785 requests, there should be an »inverted« version of that rule for those who want to minimise for possible Swift 6 migration issues.
But by having the rule enabled by default, many more users may be facing more busywork if and when Swift 6 arrives with changed rules regarding Optional initialisation, at which point the rule will have to be removed in any case for Swift 6 mode. It therefore makes sense to disable the redundant_optional_initialization
by default until it can be expected that the rule will not run afoul of the language's own rules in the near future.
In anticipation of possible requirements to initialise all optionals explicitly ...
Would you like to share a pointer to the Evolution Proposal or other sources potentially leading to this requirement?