You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/nokome/stencila/source/encoda/src/util/xml.ts
24:6 error Unexpected non-boolean in conditional @typescript-eslint/strict-boolean-expressions
We've had a discussion in stencila/dev-config#4 regarding whether check is too strict or not. We've also come across a bug which would have been avoided if this check was enabled: #197
Many (most?) of these Unexpected non-boolean in conditional errors are in places like this when decoding:
Just to note that Typescript 3.7, due out in early November, will have null coalescing and optional chaining which will allow us to refactor away many of the existing non-strict boolean expressions e.g.
In
.eslintrc
we turn offstrict-boolean-expressions
:If you renable it, you get 447 errors like:
We've had a discussion in stencila/dev-config#4 regarding whether check is too strict or not. We've also come across a bug which would have been avoided if this check was enabled: #197
Many (most?) of these
Unexpected non-boolean in conditional
errors are in places like this when decoding:encoda/src/codecs/ipynb/index.ts
Lines 119 to 121 in b85d598
which could be refactored to
or
encoda/src/codecs/jats/index.ts
Lines 265 to 275 in 6966088
which with compacting factory functions could now be refactored to:
So, I propose to:
strict-boolean-expressions
at the package level/* eslint-disable @typescript-eslint/strict-boolean-expressions */
to every file that currently needs itThe text was updated successfully, but these errors were encountered: