Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@tsconfig/node18
Advanced tools
@tsconfig/node18 is a TypeScript configuration preset for Node.js 18. It provides a base tsconfig.json configuration that is optimized for projects running on Node.js version 18, ensuring compatibility and leveraging the latest features of both TypeScript and Node.js.
Base Configuration
This feature allows you to extend the base configuration provided by @tsconfig/node18. By extending this configuration, you inherit a set of TypeScript compiler options that are optimized for Node.js 18.
{"extends":"@tsconfig/node18/tsconfig.json"}
ES Module Support
The configuration supports ES modules, which are natively supported in Node.js 18. This allows you to use modern JavaScript module syntax in your TypeScript projects.
{"compilerOptions":{"module":"ESNext","target":"ES2021"}}
Strict Type-Checking
The configuration enables strict type-checking options, which helps catch common errors and improve code quality by enforcing stricter type rules.
{"compilerOptions":{"strict":true}}
@tsconfig/node16 is a TypeScript configuration preset for Node.js 16. It provides a similar base configuration but is optimized for Node.js version 16. It is useful for projects that need to maintain compatibility with Node.js 16.
@tsconfig/node14 is a TypeScript configuration preset for Node.js 14. Like @tsconfig/node18, it offers a base configuration but is tailored for Node.js version 14, ensuring compatibility with that version.
@tsconfig/recommended provides a general-purpose TypeScript configuration that is not tied to a specific Node.js version. It offers a set of recommended TypeScript compiler options that are suitable for a wide range of projects.
Add the package to your "devDependencies"
:
npm install --save-dev @tsconfig/node18
yarn add --dev @tsconfig/node18
Add to your tsconfig.json
:
"extends": "@tsconfig/node18/tsconfig.json"
The tsconfig.json
:
{
"$schema": "https://json.schemastore.org/tsconfig",
"_version": "18.2.0",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16"
}
}
You can find the code here.
FAQs
A base TSConfig for working with Node 18.
The npm package @tsconfig/node18 receives a total of 550,085 weekly downloads. As such, @tsconfig/node18 popularity was classified as popular.
We found that @tsconfig/node18 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.