Centralized recommendations for TSConfig bases - pre-configured TypeScript configurations for various runtime environments
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
TSConfig Bases provides centralized recommendations for TypeScript compiler configurations, hosting pre-configured TSConfig files for various runtime environments. It's the "Definitely Typed for TSConfigs" - a community-owned collection of base configurations that you can extend in your TypeScript projects.
npm install --save-dev @tsconfig/node18TSConfig bases are extended in your tsconfig.json rather than imported:
{
"extends": "@tsconfig/recommended/tsconfig.json"
}Multiple configurations can be extended since TypeScript 5.0:
{
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}{
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}TSConfig Bases uses a template-based generation system:
/bases directory defining compiler optionsThe ecosystem provides 25+ pre-configured TypeScript configurations for different runtime environments.
interface BaseConfiguration {
$schema: string;
display: string;
_version?: string;
compilerOptions: CompilerOptions;
}
interface CompilerOptions {
target?: string;
module?: string;
lib?: string[];
strict?: boolean;
esModuleInterop?: boolean;
skipLibCheck?: boolean;
moduleResolution?: string;
[key: string]: any;
}Popular Base Configurations:
@tsconfig/recommended - General TypeScript recommendations@tsconfig/node18 - Node.js 18 environment@tsconfig/react-native - React Native development@tsconfig/next - Next.js applications@tsconfig/strictest - Maximum type safety@tsconfig/create-react-app - Create React App projectsSpecialized configurations for different Node.js versions with appropriate targets and module systems.
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 18",
"_version": "18.2.0",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"moduleResolution": "node16"
}
}Available Node Configurations:
@tsconfig/node-lts - Latest LTS version@tsconfig/node10 through @tsconfig/node21 - Specific versionsPre-configured setups for popular frameworks and tools.
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Create React App",
"_version": "2.0.0",
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "bundler",
"target": "es2015",
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-jsx",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
}
}Framework Configurations:
@tsconfig/create-react-app - Create React App setup@tsconfig/next - Next.js applications@tsconfig/nuxt - Nuxt.js applications@tsconfig/react-native - React Native development@tsconfig/svelte - Svelte applications@tsconfig/remix - Remix applicationsConfigurations optimized for specific JavaScript runtimes and environments.
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Deno",
"compilerOptions": {
"jsx": "react",
"lib": [],
"resolveJsonModule": true,
"strict": true
}
}Runtime Configurations:
@tsconfig/deno - Deno runtime@tsconfig/bun - Bun runtime@tsconfig/cypress - Cypress testing@tsconfig/docusaurus - Docusaurus documentationAll base configurations support TypeScript's extends mechanism for customization.
interface ExtendedConfiguration {
extends: string | string[];
compilerOptions?: Partial<CompilerOptions>;
include?: string[];
exclude?: string[];
files?: string[];
}Extension Examples:
{
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
"outDir": "./build",
"sourceMap": true,
"declaration": true
}
}Multiple Extension (TypeScript 5.0+):
{
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node18/tsconfig"]
}The repository uses automated scripts to generate individual npm packages from base configurations.
interface PackageGeneration {
createNpmPackages(): void;
deployChangedPackages(): void;
generateRecommended(): void;
updateMarkdownReadme(): void;
}
interface BaseFile {
name: string;
display: string;
_version?: string;
compilerOptions: CompilerOptions;
}Generation Process:
Each base configuration is published as a separate npm package following consistent patterns.
# Install specific base
npm install --save-dev @tsconfig/node18
yarn add --dev @tsconfig/node18
# Install multiple bases
npm install --save-dev @tsconfig/strictest @tsconfig/node18{
"extends": "@tsconfig/node18/tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}The ecosystem provides the following pre-configured bases:
| Base Name | Package | Target Environment |
|---|---|---|
| Recommended | @tsconfig/recommended | General TypeScript best practices |
| Strictest | @tsconfig/strictest | Maximum type safety |
| Bun | @tsconfig/bun | Bun runtime |
| Create React App | @tsconfig/create-react-app | Create React App projects |
| Cypress | @tsconfig/cypress | Cypress testing framework |
| Deno | @tsconfig/deno | Deno runtime |
| Docusaurus | @tsconfig/docusaurus | Docusaurus documentation |
| Ember | @tsconfig/ember | Ember.js applications |
| Next.js | @tsconfig/next | Next.js applications |
| Node LTS | @tsconfig/node-lts | Latest Node.js LTS |
| Node 10-21 | @tsconfig/node10 - @tsconfig/node21 | Specific Node.js versions |
| Nuxt | @tsconfig/nuxt | Nuxt.js applications |
| React Native | @tsconfig/react-native | React Native development |
| Remix | @tsconfig/remix | Remix applications |
| Svelte | @tsconfig/svelte | Svelte applications |
| Taro | @tsconfig/taro | Taro framework |
| Vite React | @tsconfig/vite-react | Vite + React setup |
interface TSConfigBase {
$schema: "https://json.schemastore.org/tsconfig";
display: string;
_version?: string;
compilerOptions: {
target?: "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext";
module?: "none" | "commonjs" | "amd" | "system" | "umd" | "es6" | "es2015" | "es2020" | "es2022" | "esnext" | "node16" | "nodenext";
lib?: string[];
moduleResolution?: "node" | "classic" | "node16" | "nodenext" | "bundler";
strict?: boolean;
esModuleInterop?: boolean;
skipLibCheck?: boolean;
forceConsistentCasingInFileNames?: boolean;
allowSyntheticDefaultImports?: boolean;
jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native";
[key: string]: any;
};
}
interface PackageTemplate {
name: string;
repository: {
type: "git";
url: string;
directory: string;
};
license: "MIT";
description?: string;
keywords?: string[];
version?: string;
}