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
{{ message }}
Repository navigation
Valid TypeScript has "SyntaxError: '=' expected." #2702
I should have mentioned that I'm using [email protected] and [email protected]. The error does not appear when I run tsc directly (or through webpack's ts-loader).
Prettier bundles its required TypeScript version, so your installed version (of 2.2.2) isn't actually relevant to the issue. Everyone who installs a particular version of prettier gets the same underlying TypeScript parser version.
@JamesHenry it seems strange Prettier includes its own version of TypeScript, instead of using the version provided by the hosting project. What if there's a significant/breaking change between TS versions?
@alexburner so far all of the parsers we've made didn't introduce breaking changes. It's extremely onerous for them as they break compatibility with all the codebases written in that language, so they usually end up not doing it.
With prettier we're using versions close to master of the next release, so that when they ship a big new major version, we already have had support for all the new syntax additions for a while.
For prettier, we are hitting the internals of those parsers and none of the parsers are maintaining backward compatibility of the internals, so it would be a significant effort to try and be compatible with arbitrary versions of the parsers that happen to be in your project. It also would make our life harder with integrations as to how to find the right version.
For prettier, we are hitting the internals of those parsers and none of the parsers are maintaining backward compatibility of the internals, so it would be a significant effort to try and be compatible with arbitrary versions of the parsers that happen to be in your project.
That sounds like plenty of reason right there, I hadn't realized your work required customizing the internals of those parsers. That would make full version compatibility much more difficult.
@azz I'm on mobile while travelling, so hard to follow up, but the underlying TypeScript issue for this was fixed. Not sure if the TS version was bumped when releasing 1.7.0?
Activity
vjeux commentedon Aug 29, 2017
@JamesHenry do you know what's going on here?
JamesHenry commentedon Aug 29, 2017
Funky, seems to be an issue with the TypeScript 2.5 RC. This parses fine in stable TypeScript 2.4, but not in 2.5.1.
I'll report it to the TS team
abirmingham commentedon Aug 29, 2017
@JamesHenry many thanks!
I should have mentioned that I'm using [email protected] and [email protected]. The error does not appear when I run tsc directly (or through webpack's ts-loader).
JamesHenry commentedon Aug 29, 2017
Prettier bundles its required TypeScript version, so your installed version (of 2.2.2) isn't actually relevant to the issue. Everyone who installs a particular version of prettier gets the same underlying TypeScript parser version.
Here is the bug report: microsoft/TypeScript#18123
alexburner commentedon Aug 29, 2017
@JamesHenry it seems strange Prettier includes its own version of TypeScript, instead of using the version provided by the hosting project. What if there's a significant/breaking change between TS versions?
vjeux commentedon Aug 29, 2017
@alexburner so far all of the parsers we've made didn't introduce breaking changes. It's extremely onerous for them as they break compatibility with all the codebases written in that language, so they usually end up not doing it.
With prettier we're using versions close to master of the next release, so that when they ship a big new major version, we already have had support for all the new syntax additions for a while.
For prettier, we are hitting the internals of those parsers and none of the parsers are maintaining backward compatibility of the internals, so it would be a significant effort to try and be compatible with arbitrary versions of the parsers that happen to be in your project. It also would make our life harder with integrations as to how to find the right version.
alexburner commentedon Aug 29, 2017
Thanks for the quick response!
That sounds like plenty of reason right there, I hadn't realized your work required customizing the internals of those parsers. That would make full version compatibility much more difficult.
JamesHenry commentedon Sep 15, 2017
@azz I'm on mobile while travelling, so hard to follow up, but the underlying TypeScript issue for this was fixed. Not sure if the TS version was bumped when releasing 1.7.0?
azz commentedon Sep 16, 2017
This is not fixed in
lastest(2.5.2) but is fixed ininsiders(2.5.3-insiders.20170909)