dprint / dprint-plugin-typescript

TypeScript and JavaScript code formatting plugin for dprint.
https://dprint.dev/plugins/typescript
MIT License
256 stars 57 forks source link

`x as <type>` should be allowed in boolean expressions #656

Open ad-si opened 2 months ago

ad-si commented 2 months ago

Describe the bug

dprint-plugin-typescript version: 0.91.6.wasm

Input Code

const a = testNum as number >= 0
const b = testStr as string >= 0

Expected Output

const a = testNum as number >= 0
const b = testStr as string >= 0

Actual Output

Expression expected at file:///file.ts:1:30

  const a = testNum as number >= 0
                               ~
dsherret commented 2 months ago

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