You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the first line is valid, the second line is invalid because a rest element can't be followed by a trailing comma, and the third line is considered as valid by TypeScript.
I think that for symmetry with array and object rest elements, also rest elements in tuples shouldn't be allowed to have a trailing comma.
This behavior was likely introduced in #28919, but since that PR doesn't mention rest types, probably it was an oversight.
babel/babel#10769 - If this is the expected behavior, we'll fix it in Babel. If instead, you think that this should be fixed in TypeScript, let me know because this should first be fixed in prettier to avoid a broken development workflow.
I think had we known at the time, this would have been disallowed, but I'm not thrilled about taking what is observably a breaking change with no apparent upside. It'd be better if Babel could just support it.
Activity
RyanCavanaugh commentedon Dec 3, 2019
I think had we known at the time, this would have been disallowed, but I'm not thrilled about taking what is observably a breaking change with no apparent upside. It'd be better if Babel could just support it.
nicolo-ribaudo commentedon Dec 3, 2019
Ok 👍
(Just in case you change your mind, I'll be happy to disallow it again in the next major version of Babel 😛)