• Error
  • Reported by the lexer and parser

TS1489

Decimals with leading zeros are not allowed.

A number starts with `0` followed by more digits and a decimal part, like `01.5`. Remove the leading zero.

What it means

Numbers with leading zeros are legacy octal syntax. Decimal numbers with a leading zero, such as 08.5 or 01.5, are not allowed.

Example

index.ts
export const price = 09.5;
ts-r-check -p tsconfig.json --pretty false ts-r output
index.ts(1,22): error TS1489: Decimals with leading zeros are not allowed.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • Remove the leading zero: 9.5.