Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build improvement: disallow non-null assertions via ESLint #377

Open
43081j opened this issue Jan 11, 2022 · 0 comments · May be fixed by #455
Open

build improvement: disallow non-null assertions via ESLint #377

43081j opened this issue Jan 11, 2022 · 0 comments · May be fixed by #455

Comments

@43081j
Copy link
Collaborator

43081j commented Jan 11, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants