Skip to content

Clarification on ES Target vs Lib in templates' tsconfig.node.json #20056

@junhaoliao

Description

@junhaoliao

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

In the React + TypeScript template provided by Vite (specifically the packages/create-vite/template-react-ts/tsconfig.node.json file), I noticed the following configuration:

{
  "compilerOptions": {
    "target": "ES2022",
    "lib": ["ES2023"],
    // ... other options ...
  }
}

I'm curious about the reasoning behind using "target": "ES2022" while the "lib" is set to ["ES2023"]. These appear to target different ECMAScript versions (ES2022 vs ES2023), and I’m wondering if this discrepancy is intentional.

Your Suggestion for Changes

If this configuration is intentional, consider adding a brief comment in the tsconfig.node.json file explaining why "target" is set to "ES2022" while "lib" is "ES2023". This would help clarify the reasoning for users reading the template and prevent confusion about potential mismatches in ECMAScript versions. If it's unintentional, aligning the versions might be worth considering.

Reproduction

No response

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions