diff options
Diffstat (limited to 'tools/eslint/lib/rules/no-useless-rename.js')
-rw-r--r-- | tools/eslint/lib/rules/no-useless-rename.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tools/eslint/lib/rules/no-useless-rename.js b/tools/eslint/lib/rules/no-useless-rename.js index 80539e5772..91cdcc49ff 100644 --- a/tools/eslint/lib/rules/no-useless-rename.js +++ b/tools/eslint/lib/rules/no-useless-rename.js @@ -31,7 +31,7 @@ module.exports = { }, create: function(context) { - let options = context.options[0] || {}, + const options = context.options[0] || {}, ignoreDestructuring = options.ignoreDestructuring === true, ignoreImport = options.ignoreImport === true, ignoreExport = options.ignoreExport === true; @@ -49,7 +49,7 @@ module.exports = { * @returns {void} */ function reportError(node, initial, result, type) { - let name = initial.type === "Identifier" ? initial.name : initial.value; + const name = initial.type === "Identifier" ? initial.name : initial.value; return context.report({ node: node, @@ -73,16 +73,13 @@ module.exports = { * @returns {void} */ function checkDestructured(node) { - let properties, - i; - if (ignoreDestructuring) { return; } - properties = node.properties; + const properties = node.properties; - for (i = 0; i < properties.length; i++) { + for (let i = 0; i < properties.length; i++) { if (properties[i].shorthand) { continue; } |