-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Not Needed
Use Case
As a node engineer
I want to catch cases where I'm using a condition that is unnecessary
So that I can find bugs related to if stmts that will always be entered, nullish coalescing that won't be used etc.
User Impact
- None, well only improvements if we detect bugs
Dependencies
- None
Unknowns
- How many bugs will this reveal? there are 188 errors when enabled but some might be caused by weak types rather than a real issue.
- How do we want to handle bugs? Depending on severity we want to ignore the lint rule and file a follow up, so that the bug is captured the changelog
Acceptance Criteria
Implementation Requirements
- Within the src/*/.ts override in our eslintrc.json file add the typescript-eslint/no-unnecessary-condition
- Work through the errors, try to avoid code changes unless a very simple fix that doesn't actually correct a bug but refactors to avoid the reported issue
- Consider adding the no-implicit-coercion rule as well, though this is a stylistic choice, so its change impact may be greater than the value it provides
Testing Requirements
- None
Documentation Requirements
- None
Follow Up Requirements
- File ticket for any real bugs uncovered by lint rule