Closed
Description
🔎 Search Terms
semicolon remove
🕗 Version & Regression Information
- This is the behavior in every version I tried (used
every-ts
back to where the formatting option was first introduced), and I reviewed the FAQ for entries about semicolons
⏯ Playground Link
No response
💻 Code
declare const opt: number | undefined;
const a = 1;
const b = 2;
;[1, 2, 3]
const c = opt ? 1 : 2;
const d = opt ? 1 : 2;
;[1, 2, 3]
const e = opt ?? 1;
const f = opt ?? 1;
;[1, 2, 3]
type a = 1;
type b = 2;
;[1, 2, 3]
type c = typeof opt extends 1 ? 1 : 2;
type d = typeof opt extends 1 ? 1 : 2;
;[1, 2, 3]
🙁 Actual behavior
declare const opt: number | undefined
const a = 1
const b = 2;
;[1, 2, 3]
const c = opt ? 1 : 2
const d = opt ? 1 : 2;
;[1, 2, 3]
const e = opt ?? 1
const f = opt ?? 1;
;[1, 2, 3]
type a = 1
type b = 2;
;[1, 2, 3]
type c = typeof opt extends 1 ? 1 : 2
type d = typeof opt extends 1 ? 1 : 2;
;[1, 2, 3]
🙂 Expected behavior
declare const opt: number | undefined
const a = 1
const b = 2
;[1, 2, 3]
const c = opt ? 1 : 2
const d = opt ? 1 : 2
;[1, 2, 3]
const e = opt ?? 1
const f = opt ?? 1
;[1, 2, 3]
type a = 1
type b = 2
;[1, 2, 3]
type c = typeof opt extends 1 ? 1 : 2
type d = typeof opt extends 1 ? 1 : 2
;[1, 2, 3]