-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Intl.supportedValuesOf
enumeration to lib.*.intl.d.ts
as support in Node.js18, and v8, and various browsers exists
#49231
Comments
Intl.supportedValuesOf
enumeration to lib.*.intl.d.ts
as support in Node.js18, and v8, and various browsers exists
As a temporary solution, I extended the existing type declaration
|
Tagging this help wanted but we'd like to wait until this is shipping in Chrome/Edge before getting a PR for it |
Can confirm it also works on Chrome 106.0.5249.91 and Firefox 105.0.1 in Windows 10. |
Also available in Node.js LTS (18.18.0):
|
Any update? |
https://caniuse.com/mdn-javascript_builtins_intl_supportedvaluesof The global support percentage is ~90%, and as Node also supports it I don't see what the blocker for this is. |
Hi, @sandersn. This is still throwing an error in a Next.js project v13.0.5 with TypeScript v5.0.4: Here's my tsconfig.json file: {
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Language and Environment */
"target": "es5" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": [
"dom",
"dom.iterable",
"esnext"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
"jsx": "preserve" /* Specify what JSX code is generated. */,
/* Modules */
"module": "commonjs" /* Specify what module code is generated. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"resolveJsonModule": true /* Enable importing .json files */,
/* JavaScript Support */
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
/* Emit */
"noEmit": true /* Disable emitting files from a compilation. */,
/* Interop Constraints */
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
"strictNullChecks": true /* When type checking, take into account `null` and `undefined`. */,
"strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
"strictBindCallApply": true /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */,
"strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
"noImplicitThis": true /* Enable error reporting when `this` is given the type `any`. */,
"alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
"noUnusedLocals": true /* Enable error reporting when a local variables aren't read. */,
"noUnusedParameters": true /* Raise an error when a function parameter isn't read */,
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"incremental": true,
"baseUrl": ".",
"paths": {
"$/*": ["./src/*"]
}
},
"include": [
"custom.d.ts",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"src/styles/fonts.css",
"@types/*.d.ts",
],
"exclude": ["node_modules", "jest.setup.js"]
} |
That's right, the change doesn't ship until Typescript 5.1 |
Upgrading |
On typescript version 5.2.2 and I am seeing this error ... any ideas what I need to do with my tsconfig to get things to work? |
Looks like you need lib to include "es2022". If you have more questions, try asking on the Typescript discord. It's perfect for questions like these. |
lib Update Request
Configuration Check
My compilation target is
ES2022
and my lib is"esnext.intl", "es2021.intl", "ESNext","ES2022", "ES2021", "es6"
.Missing / Incorrect Definition
The static method
Intl.supportedValuesOf
is supported by Node.js since v18 release from April. This is missing in the definition ofIntl
.Sample Code
Documentation Link
Ecmascript - it is listed as a stage3 proposal, but given that it is already implemented in v8 & mentioned in the MDN this seems reasonable.
The text was updated successfully, but these errors were encountered: