-
Notifications
You must be signed in to change notification settings - Fork 885
trailing-comma rule should not suggest comma after an object rest param in destructuring #4172
Comments
Adding Should that be enabled by default? |
Yes, I think so. That's how I work around it in my code but default settings shouldn't require invalid syntax. TBH, barring the breaking changes issue, I think this option shouldn't even exist as it's no longer possible to be non-ES compliant anymore here. IIRC this option was added as some people wanted to write code in a syntax compatible with upstream ECMAScript. The TypeScript language tries to remain close to ES syntax, though, so eventually, this hole was closed. Being able to set |
|
|
💀 It's time! 💀TSLint is deprecated and no longer accepting pull requests other than security fixes. See #4534. ☠️ 👋 It was a pleasure open sourcing with you! |
🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
Bug Report
TypeScript code being linted
with
tslint.json
configuration:See it on Playground.
Actual behavior
An error occurs, indicating a trailing comma is expected.
Expected behavior
Latest TypeScript disallows a trailing comma after an object rest param in destructuring to align with ECMAScript. This TSLint behavior requires to apply changes to the code that will make it not compile.
This was raised before in #3147 & #3795. However, then it was only a question of aligning with JavaScript and a style preference. Now it's an actual bug.
The text was updated successfully, but these errors were encountered: