oisy-wallet
oisy-wallet copied to clipboard
feat(ci): created local rule to use isNullish and nonNullish
Motivation
We would like to enforce the usage of functions isNullish and nonNullish in the code whenever possible.
Changes
- Created custom local lint rule for
isNullishusage. - Created custom local lint rule for
nonNullishusage. - Fix issues created by new rules.
Tests
It raised issues, correctly, and we fixed it.
@peterpeterparker ah! I didn't think that some of the conditions were in place with a purpose...
so, either I put the @lint-exception in place there, or I can just discard this PR, what do you think? for example, if we want to keep the rule of this PR, but have specifics checks that ignore the rule, we would do:
// eslint-disable-next-line nullish-check -- it is ok to display undefined becasue.....
if (value === null) {
I didn't think that some of the conditions were in place with a purpose...
Yep. Checkout the definition of the store and how we handle errors in the services. On error we set null.
so, either I put the @lint-exception
Lint-exception sounds good to me, I think it's a cool stuffs to have your eslint rule. 👍 We should just pay attention at the changes and not do a bulk change.
Since the code changed too much since I last reviewed this PR, I will open a new one (https://github.com/dfinity/oisy-wallet/pull/2355) and close this one