diff options
author | Rich Trott <rtrott@gmail.com> | 2021-03-26 09:17:23 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2021-03-28 18:01:44 +0300 |
commit | adcd60eee6b4ca1001e640638349e7ebc6c06e4b (patch) | |
tree | 5ba574de895b90c2edc3d8702cd1d4f711d10c3d /.eslintrc.js | |
parent | f34e88a18db506bf425ace5dfcc3aa32d449fe6f (diff) |
tools: improve valid-typeof lint rule
Require that `typeof` comparisons be to string literals.
PR-URL: https://github.com/nodejs/node/pull/37924
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 28a31d050a6..3f47ddf45d0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -307,7 +307,7 @@ module.exports = { 'template-curly-spacing': 'error', 'unicode-bom': 'error', 'use-isnan': 'error', - 'valid-typeof': 'error', + 'valid-typeof': ['error', { requireStringLiterals: true }], // Custom rules from eslint-plugin-node-core 'node-core/no-unescaped-regexp-dot': 'error', |