A base TSConfig for working with Node 14.
npx @tessl/cli install tessl/npm-tsconfig--node14@14.1.0A base TypeScript configuration optimized for Node.js 14 runtime environment. This package provides sensible compiler defaults for projects targeting Node.js 14, including ES2020 language features, node16 module resolution, and strict type checking enabled.
npm install --save-dev @tsconfig/node14 or yarn add --dev @tsconfig/node14This package is not imported as a module but rather extended through TypeScript's configuration system:
{
"extends": "@tsconfig/node14/tsconfig.json"
}Create or update your project's tsconfig.json file to extend this base configuration:
{
"extends": "@tsconfig/node14/tsconfig.json",
"compilerOptions": {
// Your custom overrides here
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}The base configuration will provide all the Node.js 14 optimized compiler options, which you can then customize with additional options or overrides as needed.
Provides a complete TypeScript compiler configuration optimized for Node.js 14 runtime with modern JavaScript features and strict type checking.
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 14",
"_version": "14.1.0",
"compilerOptions": {
"lib": ["es2020"],
"module": "node16",
"target": "es2020",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16"
}
}Configuration Properties:
"https://json.schemastore.org/tsconfig" - JSON schema for IDE validation and autocomplete"Node 14" - Human-readable name for this configuration"14.1.0" - Internal version tracking for the configuration["es2020"] - Available ECMAScript library features (ES2020 APIs)"node16" - Module system (Node.js 16+ style module resolution with package.json "type" support)"es2020" - JavaScript output target (ES2020 syntax and features)true - Enables all strict type-checking options for better code qualitytrue - Enables seamless interoperability between CommonJS and ES modulestrue - Skips type checking of declaration files for faster compilation"node16" - Uses Node.js 16+ module resolution algorithmThe configuration is designed to be extended by consumer projects through TypeScript's built-in configuration inheritance system.
{
"extends": "@tsconfig/node14/tsconfig.json"
}Extension Behavior:
compilerOptionscompilerOptions (like lib) are replaced entirely, not mergedOverride Examples:
{
"extends": "@tsconfig/node14/tsconfig.json",
"compilerOptions": {
// Override target to older version if needed
"target": "es2018",
// Add additional libraries
"lib": ["es2020", "dom"],
// Add output directory
"outDir": "./build",
// Enable source maps for debugging
"sourceMap": true
}
}Can be combined with other @tsconfig packages using TypeScript 5.0+ multiple extends feature:
{
"extends": [
"@tsconfig/node14/tsconfig.json",
"@tsconfig/strictest/tsconfig.json"
]
}Combination Rules:
compilerOptions are merged in orderThe package provides a JSON configuration file that conforms to the TypeScript configuration schema:
interface TSConfig {
/** JSON schema reference for validation */
$schema?: string;
/** Human-readable display name */
display?: string;
/** Internal version tracking */
_version?: string;
/** TypeScript compiler options */
compilerOptions?: CompilerOptions;
/** Base configurations to extend from */
extends?: string | string[];
/** Files to include in compilation */
include?: string[];
/** Files to exclude from compilation */
exclude?: string[];
/** Specific files to compile */
files?: string[];
}
interface CompilerOptions {
/** ECMAScript library features to include */
lib?: string[];
/** Module system to use */
module?: string;
/** JavaScript output target */
target?: string;
/** Enable all strict type-checking options */
strict?: boolean;
/** Enable ES module interoperability */
esModuleInterop?: boolean;
/** Skip type checking of declaration files */
skipLibCheck?: boolean;
/** Module resolution strategy */
moduleResolution?: string;
/** Output directory for compiled files */
outDir?: string;
/** Root directory of source files */
rootDir?: string;
/** Generate source maps */
sourceMap?: boolean;
/** Generate declaration files */
declaration?: boolean;
/** Other compiler options... */
[key: string]: any;
}This configuration is specifically optimized for Node.js 14.x runtime environment:
Language Features:
Module Support:
Performance Optimizations:
Install as a development dependency:
# npm
npm install --save-dev @tsconfig/node14
# yarn
yarn add --dev @tsconfig/node14
# pnpm
pnpm add --save-dev @tsconfig/node14tsconfig.json in your project root:{
"extends": "@tsconfig/node14/tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}package.json:{
"engines": {
"node": ">=14.0.0"
}
}Module Resolution Errors:
Compilation Errors:
Type Checking Issues:
TypeScript will validate the configuration and report errors for: