diff options
author | cjihrig <cjihrig@gmail.com> | 2019-01-18 16:09:54 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-01-20 20:31:03 -0500 |
commit | af102c6d277165a641a4082b0641388807985875 (patch) | |
tree | af55616aa0751e0896699899a2d3fc2f9c7f1802 /tools/node_modules/eslint/lib/rules/vars-on-top.js | |
parent | d1dee495db1451e74f5364c8687148a53ff0b50d (diff) | |
download | android-node-v8-af102c6d277165a641a4082b0641388807985875.tar.gz android-node-v8-af102c6d277165a641a4082b0641388807985875.tar.bz2 android-node-v8-af102c6d277165a641a4082b0641388807985875.zip |
tools: update ESLint to 5.12.1
Update ESLint to 5.12.1
PR-URL: https://github.com/nodejs/node/pull/25573
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/lib/rules/vars-on-top.js')
-rw-r--r-- | tools/node_modules/eslint/lib/rules/vars-on-top.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/node_modules/eslint/lib/rules/vars-on-top.js b/tools/node_modules/eslint/lib/rules/vars-on-top.js index d69c223388..92d483b6ec 100644 --- a/tools/node_modules/eslint/lib/rules/vars-on-top.js +++ b/tools/node_modules/eslint/lib/rules/vars-on-top.js @@ -20,11 +20,13 @@ module.exports = { url: "https://eslint.org/docs/rules/vars-on-top" }, - schema: [] + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } }, create(context) { - const errorMessage = "All 'var' declarations must be at the top of the function scope."; //-------------------------------------------------------------------------- // Helpers @@ -103,7 +105,7 @@ module.exports = { */ function globalVarCheck(node, parent) { if (!isVarOnTop(node, parent.body)) { - context.report({ node, message: errorMessage }); + context.report({ node, messageId: "top" }); } } @@ -118,7 +120,7 @@ module.exports = { if (!(/Function/.test(grandParent.type) && parent.type === "BlockStatement" && isVarOnTop(node, parent.body))) { - context.report({ node, message: errorMessage }); + context.report({ node, messageId: "top" }); } } |