parse5 icon indicating copy to clipboard operation
parse5 copied to clipboard

build improvement: disallow non-null assertions via ESLint

Open 43081j opened this issue 3 years ago • 0 comments

We should enable the rule to disallow non-null assertions:

foo!.bar!.baz;

from what i remember, we have quite a lot of these scattered around because of the whole "bootstrap" concept. many methods make assumptions around which methods ran before them, meaning we "know" the value shouldn't be null, but technically it could.

in all those cases, we should either add null checks (usually throwing if it is null) or rework the bootstrapping to happen in the constructor (feel like @fb55 mentioned something similar to that a while ago).

43081j avatar Jan 11 '22 13:01 43081j