Bug Report
Hi. According to specification Intl.NumberFormat contains numberingSystem option, but typescript throws the error Object literal may only specify known properties, and 'numberingSystem' does not exist in type 'NumberFormatOptions'
🔎 Search Terms
Intl, NumberFormatOptions
🕗 Version & Regression Information
"typescript": "^4.9.4"
💻 Code
I have a monorepo with this structure
root
- base.tsconfig.json
- package.json
- app1
- index.ts
- tsconfig.json
- package.json
base.tsconfig.json
{
"compilerOptions": {
"module": "ESNext",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"target": "ESNext",
"noImplicitAny": true,
"strictNullChecks": true,
"moduleResolution": "node",
"sourceMap": true,
"allowJs": true,
"checkJs": false,
"lib": [
"esnext",
"dom"
],
"resolveJsonModule": true,
"skipLibCheck": true,
"emitDecoratorMetadata": true,
"baseUrl": "."
}
}
app1/tsconfig.json
{
"extends": "../base.tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"target": "ESNext",
"noImplicitAny": true,
"strictNullChecks": true,
"moduleResolution": "node",
"sourceMap": true,
"allowJs": true,
"checkJs": false,
"lib": [
"esnext",
"dom"
],
"resolveJsonModule": true,
"skipLibCheck": true,
"emitDecoratorMetadata": true,
"baseUrl": "."
}
}
app1/index.ts
const amount = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
numberingSystem: 'latn'
}).format(1000);
console.log(amount);
🙁 Actual behavior
After type checking typescript throws error
index.ts:4:3 - error TS2345: Argument of type '{ style: string; currency: string; numberingSystem: string; }' is not assignable to parameter of type 'NumberFormatOptions'.
Object literal may only specify known properties, and 'numberingSystem' does not exist in type 'NumberFormatOptions'.
4 numberingSystem: 'latn'
~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in index.ts:4
🙂 Expected behavior
The typescript correctly checks the types that are specified in the specification
Bug Report
Hi. According to specification
Intl.NumberFormatcontainsnumberingSystemoption, but typescript throws the errorObject literal may only specify known properties, and 'numberingSystem' does not exist in type 'NumberFormatOptions'🔎 Search Terms
Intl, NumberFormatOptions
🕗 Version & Regression Information
"typescript": "^4.9.4"💻 Code
I have a monorepo with this structure
root
base.tsconfig.json
app1/tsconfig.json
app1/index.ts
🙁 Actual behavior
After type checking typescript throws error
🙂 Expected behavior
The typescript correctly checks the types that are specified in the specification