DX - Essentials
Set the baseline TypeScript compiler options that every Nova preset chain starts from, tuned for Node ESM with declaration output and source maps.
Why Use This Preset?
- Pairs
moduleandmoduleResolutionasNodeNextso imports resolve the same way TypeScript and Node do at runtime. - Emits declaration files and declaration maps so consumers get types and can jump to your source.
- Targets
ESNextwith theESNextlib so you can use the latest language features without manual lib wiring. - Forces every file into module mode and verbatim module syntax so emit stays predictable across bundlers and runtimes.
- Acts as the first
extendsentry so later layers only override what they need.
Usage
Add the preset as the first entry in the extends array of your tsconfig.json, then layer strict and environment presets on top.
tsconfig.json
{
"extends": [
"@cbnventures/nova/presets/tsconfig/dx-essentials.json",
"@cbnventures/nova/presets/tsconfig/dx-strict.json",
"@cbnventures/nova/presets/tsconfig/runtime-node.json"
]
}
What This Preset Configures
The preset sets the following compilerOptions. Path, layout, and include and exclude settings stay in your app's tsconfig.json.
| Setting | Value | Description |
|---|---|---|
allowJs | false | Compiles TypeScript only, keeping plain JavaScript out of the program. |
allowSyntheticDefaultImports | true | Allows default imports from modules with no default export. |
declaration | true | Emits a .d.ts declaration file for each compiled module. |
declarationMap | true | Emits a source map for each declaration so editors map types back to source. |
esModuleInterop | true | Adds interop helpers so CommonJS modules import cleanly as ESM. |
lib | ESNext | Loads the latest built-in JavaScript type definitions. |
module | NodeNext | Emits modules using Node's current ESM and CommonJS detection. |
moduleDetection | force | Treats every file as a module, even without an import or export. |
moduleResolution | NodeNext | Resolves imports the way Node does, matched to the module setting. |
noErrorTruncation | true | Prints full type text in errors instead of cutting it short. |
preserveWatchOutput | true | Keeps prior watch output on screen instead of clearing the console. |
removeComments | true | Strips comments from emitted JavaScript. |
resolveJsonModule | true | Lets you import a .json file and read its typed contents. |
skipLibCheck | true | Skips type checking of declaration files for faster baseline builds. |
sourceMap | true | Emits a source map for each compiled file. |
target | ESNext | Emits the latest JavaScript syntax without downleveling. |
verbatimModuleSyntax | true | Emits import and export statements exactly as written. |
info
skipLibCheck is true here for a fast baseline. The DX - Strict layer flips it to false when you chain it on top.
Related
- Review the layering order in TSConfig Best Practices.
- See how presets compose end to end in the Presets Overview.