Open hudson-newey opened 1 year ago
We should also consider enabling @typescript-eslint/no-empty-function
, @typescript-eslint/no-explicit-any
, @typescript-eslint/no-inferrable-types
, @typescript-eslint/prefer-as-const
, and typescript strict: true
mode so we can make our code base compatible Angular recommended es-lint settings
Turn on each check separately, but I'm not opposed but ensure limited time. 1 hour per check.
Describe the bug A common bug that keeps reoccurring is values being unexpectedly set to
null
orundefined
. This can be fixed through TypeScript by enablingstrictNullChecks
.Expected behavior We should catch potential
null
andundefined
errors at compilation rather than during runtimeAdditional context We cannot push this change with another branch as it throws an enormous amount of errors with our existing code base (more than my terminal buffer size, so > 100 is my estimate)
Additional Note: We may want to enable
"consistent-return": ["warn", { "treatUndefinedAsUnspecified": true }]
in eslint. This will make it so each function requires a return type. This is not currently a requirement in our codebase.Additionally, setting
noImplicitAny: true
would catch errors where we are currently able to bypass TypeScript error checking by usingas any
(which is currently prevalent in the codebase)