From 969c39eb3a21f3586b1c1e94fc07455179207b47 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Fri, 5 Jan 2018 11:42:39 -0500 Subject: [PATCH] lib: enable dot-notation eslint rule PR-URL: https://github.com/nodejs/node/pull/18007 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Eugene Ostroukhov Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Roman Reiss Reviewed-By: Jon Moss --- lib/.eslintrc.yaml | 2 ++ lib/_debugger.js | 6 +++--- lib/internal/child_process.js | 2 +- lib/module.js | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index aaebadca125814..437aa575645ad6 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -1,4 +1,6 @@ rules: + dot-notation: error + # Custom rules in tools/eslint-rules require-buffer: error buffer-constructor: error diff --git a/lib/_debugger.js b/lib/_debugger.js index 64a8b70c5e2e58..dd679c52c9e421 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -742,9 +742,9 @@ function Interface(stdin, stdout, args) { useGlobal: false, ignoreUndefined: true }; - if (parseInt(process.env['NODE_NO_READLINE'], 10)) { + if (parseInt(process.env.NODE_NO_READLINE, 10)) { opts.terminal = false; - } else if (parseInt(process.env['NODE_FORCE_READLINE'], 10)) { + } else if (parseInt(process.env.NODE_FORCE_READLINE, 10)) { opts.terminal = true; // Emulate Ctrl+C if we're emulating terminal @@ -754,7 +754,7 @@ function Interface(stdin, stdout, args) { }); } } - if (parseInt(process.env['NODE_DISABLE_COLORS'], 10)) { + if (parseInt(process.env.NODE_DISABLE_COLORS, 10)) { opts.useColors = false; } diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 764cdd3cf26997..e01e19147bb6d1 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -383,7 +383,7 @@ ChildProcess.prototype.kill = function(sig) { if (sig === 0) { signal = 0; } else if (!sig) { - signal = constants['SIGTERM']; + signal = constants.SIGTERM; } else { signal = constants[sig]; } diff --git a/lib/module.js b/lib/module.js index 3b258f051bd4ca..6ff174ead61629 100644 --- a/lib/module.js +++ b/lib/module.js @@ -639,7 +639,7 @@ Module._initPaths = function() { paths.unshift(path.resolve(homeDir, '.node_modules')); } - var nodePath = process.env['NODE_PATH']; + var nodePath = process.env.NODE_PATH; if (nodePath) { paths = nodePath.split(path.delimiter).filter(function(path) { return !!path;