Skip to content

Commit

Permalink
test: add no-extra-parens tests with rest properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Aug 26, 2022
1 parent deaf69f commit 445f648
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/lib/rules/no-extra-parens.js
Expand Up @@ -2334,13 +2334,8 @@ ruleTester.run("no-extra-parens", rule, {
invalid("[...(a.b)] = []", "[...a.b] = []", "MemberExpression"),
invalid("({ a: (b) } = {})", "({ a: b } = {})", "Identifier"),
invalid("({ a: (b.c) } = {})", "({ a: b.c } = {})", "MemberExpression"),

/*
* TODO: Add these tests for RestElement's parenthesized arguments in object patterns when that becomes supported by Espree.
*
* invalid("({ ...(a) } = {})", "({ ...a } = {})", "Identifier"),
* invalid("({ ...(a.b) } = {})", "({ ...a.b } = {})", "MemberExpression")
*/
invalid("({ ...(a) } = {})", "({ ...a } = {})", "Identifier"),
invalid("({ ...(a.b) } = {})", "({ ...a.b } = {})", "MemberExpression"),

// https://github.com/eslint/eslint/issues/11706 (also in valid[])
{
Expand Down

0 comments on commit 445f648

Please sign in to comment.