This fixes a few rules by making sure the input is actually ready
to be checked. Otherwise those can throw TypeErrors or result in
faulty error messages.
PR-URL: https://github.com/nodejs/node/pull/18853
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Currently the call can lead to a TypeError with the message:
`Cannot read property 'value' of undefined`.
This fixes it by first checking that the first argument is truthy.
PR-URL: https://github.com/nodejs/node/pull/18729
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Currently, when configuring --without-ssl any tests that use
process.binding('crypto') will not report a lint warning. This is
because the eslint check only generates a warning when using require.
This commit adds a check for using binding in addition to require.
PR-URL: https://github.com/nodejs/node/pull/17867
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The motivation for this commit is to pick up early on missing checks for
crypto support (when Node is built --without-ssl).
There are currently usages of common.hasCrypto which are not just for
detecting if crypto support is available and then skip the test in
question. For these case we still want to have a lint error generated
which can then be disabled using an ESLint comment.
PR-URL: https://github.com/nodejs/node/pull/13813
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>