Skip to content
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

Question: Why are es2015 and commonjs recommended #256

Closed
zanminkian opened this issue Feb 28, 2024 · 3 comments · Fixed by #259
Closed

Question: Why are es2015 and commonjs recommended #256

zanminkian opened this issue Feb 28, 2024 · 3 comments · Fixed by #259
Labels
enhancement New feature or request you can do this

Comments

@zanminkian
Copy link
Contributor

{
  "compilerOptions": {
    "target": "es2015",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}

I have a question about @tsconfig/recommended. Why are es2015 and commonjs recommended?

  • 2015 is almost ten years ago.
  • ESM is better than commonjs.

Furthermore, I don't know the use cases for @tsconfig/recommended. Is there any possible to deprecate it?

@orta
Copy link
Member

orta commented Feb 29, 2024

Because those are the recommendations we made in tsc --init and @tsconfig/recommended is based on that, if TypeScript updates the initial template - then so can this base!

@zanminkian
Copy link
Contributor Author

After running npx tsc --init, the target is es2016 now (ts 5.0+).

@orta orta added enhancement New feature or request you can do this labels Feb 29, 2024
@orta
Copy link
Member

orta commented Feb 29, 2024

Happy to have it upgraded then 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request you can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants