Skip to main content

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?

  1. Pairs module and moduleResolution as NodeNext so imports resolve the same way TypeScript and Node do at runtime.
  2. Emits declaration files and declaration maps so consumers get types and can jump to your source.
  3. Targets ESNext with the ESNext lib so you can use the latest language features without manual lib wiring.
  4. Forces every file into module mode and verbatim module syntax so emit stays predictable across bundlers and runtimes.
  5. Acts as the first extends entry 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
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.

SettingValueDescription
allowJsfalseCompiles TypeScript only, keeping plain JavaScript out of the program.
allowSyntheticDefaultImportstrueAllows default imports from modules with no default export.
declarationtrueEmits a .d.ts declaration file for each compiled module.
declarationMaptrueEmits a source map for each declaration so editors map types back to source.
esModuleInteroptrueAdds interop helpers so CommonJS modules import cleanly as ESM.
libESNextLoads the latest built-in JavaScript type definitions.
moduleNodeNextEmits modules using Node's current ESM and CommonJS detection.
moduleDetectionforceTreats every file as a module, even without an import or export.
moduleResolutionNodeNextResolves imports the way Node does, matched to the module setting.
noErrorTruncationtruePrints full type text in errors instead of cutting it short.
preserveWatchOutputtrueKeeps prior watch output on screen instead of clearing the console.
removeCommentstrueStrips comments from emitted JavaScript.
resolveJsonModuletrueLets you import a .json file and read its typed contents.
skipLibChecktrueSkips type checking of declaration files for faster baseline builds.
sourceMaptrueEmits a source map for each compiled file.
targetESNextEmits the latest JavaScript syntax without downleveling.
verbatimModuleSyntaxtrueEmits 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.