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
As of v1.6 of Prettier we are using the TypeScript 2.5 RC and we have had a bug report for some code which worked fine pre-1.6 but is now broken.
Using tsc directly, I can confirm that when the following code is parsed with TypeScript 2.4.2 it produces an AST just fine, but when parsed with TypeScript 2.5.1 it produces "'=' expected."
This is a result of parsing JSDoc types in normal typescript. JSDoc's function(number): number syntax has no parameter names, so now the start of a parameter can be the start of a type. But this results in nested lookahead when parsing arrow functions that fails in a way that I haven't fully understood.
There are two possible fixes: (1) fork the code paths (2) fix the lookahead in isStartOfType. Fix 1 is fast and simple but doesn't address the underlying issue: the lookahead in isStartOfType might not be necessary (or at least may be simplified).
Right now I'm planning to fix this bug in 2.5.3 and pursue option (2).
As of v1.6 of Prettier we are using the TypeScript 2.5 RC and we have had a bug report for some code which worked fine pre-1.6 but is now broken.
Using
tsc
directly, I can confirm that when the following code is parsed with TypeScript 2.4.2 it produces an AST just fine, but when parsed with TypeScript 2.5.1 it produces"'=' expected."
Code
Original issue: prettier/prettier#2702
The text was updated successfully, but these errors were encountered: