no-extra-parens does not allow conditional object spread
See original GitHub issueWhat rule do you want to change?
no-extra-parens
Does this change cause the rule to produce more or fewer warnings? Fewer
How will the change be implemented? (New option, new default behavior, etc.)? The best approach for this might be a new option, because the actual code without the parentheses still works, but can quickly become a real mess.
Please provide some example code that this change will affect:
const obj = {
...(true ? { foo: 'bar' } : { bar: 'foo' }),
};
What does the rule currently do for this code? Shows an error when wrapping a conditional object spread with parentheses.
What will the rule do after it’s changed? Allow extra parentheses around conditional object spread.
Are you willing to submit a pull request to implement this change? I’m not familiar with the eslint parser at all, so if someone is better at this please be my guest, otherwise I’ll try to learn new things ✨
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top GitHub Comments
@anikethsaha Go for it!
I can work on this if no one is taking this.