diff options
Diffstat (limited to 'tools/eslint/lib/rules/dot-notation.js')
-rw-r--r-- | tools/eslint/lib/rules/dot-notation.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/eslint/lib/rules/dot-notation.js b/tools/eslint/lib/rules/dot-notation.js index 55225b8cc4..142f0f24a0 100644 --- a/tools/eslint/lib/rules/dot-notation.js +++ b/tools/eslint/lib/rules/dot-notation.js @@ -116,6 +116,15 @@ module.exports = { return null; } + if (node.object.type === "Identifier" && node.object.name === "let") { + + /* + * A statement that starts with `let[` is parsed as a destructuring variable declaration, not + * a MemberExpression. + */ + return null; + } + return fixer.replaceTextRange( [dot.range[0], node.property.range[1]], `[${textAfterDot}"${node.property.name}"]` |