dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Parsing error when casting type without parenthesis

Open cedric-spinergie opened this issue 2 years ago • 1 comments

Describe the bug A parsing error occurs for valid TypeScript code.

dprint-plugin-typescript version: 0.88.3

Input Code

availableZoom as any <= zoom

Expected Output

(availableZoom as any) <= zoom

Actual Output

Expression expected at file.ts:1:23

  availableZoom as any <= zoom
                        ~

Playground link Playground link

cedric-spinergie avatar Nov 07 '23 15:11 cedric-spinergie

I opened https://github.com/swc-project/swc/issues/8244

For parsing errors, I'd recommend trying things out in https://swc.rs/playground

dsherret avatar Nov 07 '23 16:11 dsherret