提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
749 B

  1. ### A base TSConfig for working with Node 22.
  2. Add the package to your `"devDependencies"`:
  3. ```sh
  4. npm install --save-dev @tsconfig/node22
  5. yarn add --dev @tsconfig/node22
  6. ```
  7. Add to your `tsconfig.json`:
  8. ```json
  9. "extends": "@tsconfig/node22/tsconfig.json"
  10. ```
  11. ---
  12. The `tsconfig.json`:
  13. ```jsonc
  14. {
  15. "$schema": "https://json.schemastore.org/tsconfig",
  16. "_version": "22.0.0",
  17. "compilerOptions": {
  18. "lib": ["es2024", "ESNext.Array", "ESNext.Collection", "ESNext.Iterator"],
  19. "module": "nodenext",
  20. "target": "es2022",
  21. "strict": true,
  22. "esModuleInterop": true,
  23. "skipLibCheck": true,
  24. "moduleResolution": "node16"
  25. }
  26. }
  27. ```
  28. You can find the [code here](https://github.com/tsconfig/bases/blob/master/bases/node22.json).