Skip to content
Discussion options

You must be logged in to vote

Yeah unfortunately thats how TypeScript works - the lib array doesnt merge, it completely overrides.

Your approach is correct but theres a cleaner way. Instead of manually listing all libs, you can check what the base config includes and just add what you need:

{
  "extends": "@vue/tsconfig/tsconfig.dom.json",
  "compilerOptions": {
    "lib": ["ES2020", "DOM", "DOM.Iterable", "ESNext.Object"]
  }
}

For Object.groupBy specifically, you need ESNext or ES2024 in your lib:

{
  "compilerOptions": {
    "lib": ["ES2020", "DOM", "DOM.Iterable", "ESNext"]
  }
}

Or if you only want Object.groupBy without all ESNext stuff:

{
  "compilerOptions": {
    "lib": ["ES2020", "DOM", "DOM.Iterable", "ES2024"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Der-Alex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants