dprint / dprint-plugin-typescript

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

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

Open ad-si opened 3 months ago

ad-si commented 3 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 3 months ago

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