📦 SETUP • ⚙️ CONFIGURATION
| This package provides modular TypeScript configurations for various project runtime requirements: |
bun i -D @stacklys/tsconfignpm i -D @stacklys/tsconfigpnpm i -D @stacklys/tsconfigyarn i -D @stacklys/tsconfigFor setting up a TypeScript project with the recommended configuration, simply install the package and extend the configuration in your tsconfig.json file.
{
"extends": "@stacklys/tsconfig/base"
}You have base, strict and dom configurations available. You can extend any of these configurations in your tsconfig.json file as needed.
For extending all configuration you can do:
{
"extends": ["@stacklys/tsconfig/strict", "@stacklys/tsconfig/dom"]
}This is the complete base configuration:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"allowJs": true,
"strict": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noEmit": true,
"removeComments": true,
"newLine": "lf",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true
}
}For strict configuration, extend the @stacklys/tsconfig/strict in your tsconfig.json file.
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./base.json",
"compilerOptions": {
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"exactOptionalPropertyTypes": false,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"useUnknownInCatchVariables": true,
"types": ["node"]
}
}For dom configuration, extend the @stacklys/tsconfig/dom in your tsconfig.json file.
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"jsx": "preserve"
}
}BACK TO TOP
Copyright © All rights reserved, developed by Luis Monsalve and