AboutBit's TypeScript config presets
Install the package, assuming that you have TypeScript already installed:
npm i -D @aboutbits/ts-configtsconfig.json
{
"extends": "@aboutbits/ts-config"
}tsconfig.json
{
"extends": "@aboutbits/ts-config/react"
}The presets target ESM-only projects on Node.js 26 that are built with a bundler (tsdown, Vite, Next.js, …) and need TypeScript 6 or newer:
module: esnextwithmoduleResolution: bundlertarget: es2025, and the React preset adds the DOM to thelibverbatimModuleSyntax, so type-only imports must useimport typeuseDefineForClassFieldsis on by default with this target: a class field without an initializer is set toundefinedaftersuper()and overwrites a value the base class constructor set. Mark such fields withdeclare.
TypeScript 6 no longer includes @types/* packages automatically. In a Node.js project, install @types/node and add it to the types field:
npm i -D @types/node@^26{
"extends": "@aboutbits/ts-config",
"compilerOptions": {
"types": ["node"]
}
}To build and publish the package, visit the GitHub Actions page of the repository.
You can choose between two workflows:
Release Packageto publish a new version of the package.Pre-Release Packageto publish a new pre-release version of the package.
Note: Pre-releases need to be supplied with a pre-id.
Note: To increment a pre-release, you have to run the normal release workflow and select "prerelease". For this action you need to already be on a pre-release version.
AboutBits is a company based in South Tyrol, Italy. You can find more information about us on our website.
For support, please contact info@aboutbits.it.
The MIT License (MIT). Please see the license file for more information.