Skip to content

[TypeScript 5.7] Parsing error: Invalid value for lib provided: es2024.promise  #772

Open
@yoursunny

Description

When XO is installed alongside TypeScript 5.7 and tsconfig.json .compilerOptions.lib includes "ESNext.Promise", the XO CLI reports a parsing error.

package.json

{
  "private": true,
  "type": "module",
  "packageManager": "[email protected]+sha512.c8180b3fbe4e4bca02c94234717896b5529740a6cbadf19fa78254270403ea2f27d4e1d46a08a0f56c89b63dc8ebfd3ee53326da720273794e6200fcf0d184ab",
  "dependencies": {
    "typescript": "~5.7.2",
    "xo": "^0.59.3"
  }
}

tsconfig.json

{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "lib": [
      "DOM",
      "ES2023",
      "ESNext.Promise"
    ],
    "module": "ES2022",
    "moduleResolution": "Bundler",
    "noEmitOnError": true,
    "noImplicitOverride": true,
    "noImplicitReturns": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "strict": true,
    "target": "ES2023"
  },
  "include": [
    "main.ts"
  ],
  "exclude": [
    "**/node_modules"
  ]
}

main.ts

console.log(typeof Promise.withResolvers);

Command Line

./node_modules/.bin/xo --fix

Error Message


  main.ts
  ✖  Parsing error: Invalid value for lib provided: es2024.promise  

  1 error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions