From 6376d430f442486f98bf145dc62a4e7424f10257 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 11 Apr 2018 03:47:27 +0200 Subject: [PATCH] tools: stricter no-undef eslint rule By default eslint does not validate variables that are placed in a typeof check. PR-URL: https://github.com/nodejs/node/pull/19926 Reviewed-By: Gus Caplan Reviewed-By: Weijia Wang Reviewed-By: Trivikram Kamat Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5c493310144..2eb3eae6a88 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -185,7 +185,7 @@ module.exports = { 'no-this-before-super': 'error', 'no-throw-literal': 'error', 'no-trailing-spaces': 'error', - 'no-undef': 'error', + 'no-undef': ['error', { typeof: true }], 'no-undef-init': 'error', 'no-unexpected-multiline': 'error', 'no-unreachable': 'error',