You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
People are easily falling victims to equality check against rawValue, when it is much clearer/cleaner to check against the enum type.
Provide several examples of what would and wouldn't trigger violations.
// trigger
switch string {caseMyEnum.caseA.rawValue:
break
default:
break
}
if value ==MyEnum.caseA.rawValue {...}// non-triggerletpossibleValue=MyEnum(rawValue: value)
if possibleValue ==.caseA {..}
switch possibleValue {case.some(.caseA):
break
}
Should the rule be configurable?
Probably not?
Should the rule be opt-in or enabled by default?
Opt-in, for sure, since it is extremely disruptive to existing codebases.
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Rule Request
Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
People are easily falling victims to equality check against
rawValue
, when it is much clearer/cleaner to check against the enum type.Provide several examples of what would and wouldn't trigger violations.
Should the rule be configurable?
Probably not?
Should the rule be opt-in or enabled by default?
Opt-in, for sure, since it is extremely disruptive to existing codebases.
The text was updated successfully, but these errors were encountered: