diff options
Diffstat (limited to 'tools/eslint/lib/rules/id-length.js')
-rw-r--r-- | tools/eslint/lib/rules/id-length.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/eslint/lib/rules/id-length.js b/tools/eslint/lib/rules/id-length.js index d3a942cd04..1747552707 100644 --- a/tools/eslint/lib/rules/id-length.js +++ b/tools/eslint/lib/rules/id-length.js @@ -61,7 +61,9 @@ module.exports = { return !parent.computed && ( // regular property assignment - (parent.parent.left === parent || // or the last identifier in an ObjectPattern destructuring + (parent.parent.left === parent && parent.parent.type === "AssignmentExpression" || + + // or the last identifier in an ObjectPattern destructuring parent.parent.type === "Property" && parent.parent.value === parent && parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent) ); |