Centralized TypeScript configuration presets for various runtime environments and frameworks, providing community-maintained TSConfigs for consistent project setup
pkg:github/tsconfig/bases@main
npx @tessl/cli install tessl/github-tsconfig--bases@1.0.00
# TSConfig Bases
1
2
Centralized TypeScript configuration presets for various runtime environments and frameworks. This repository provides community-maintained TSConfigs that developers can extend in their projects, offering optimized compiler options for specific environments like Node.js, React, Next.js, and many others.
3
4
## Package Information
5
6
- **Repository Name**: tsconfig/bases
7
- **Repository Type**: GitHub
8
- **Language**: TypeScript Configuration (JSON)
9
- **Purpose**: Provides base TSConfig files that generate individual npm packages
10
11
## Core Usage
12
13
Each TSConfig base in this repository becomes a separate npm package under the `@tsconfig/` namespace. Install and extend the configuration that matches your target environment:
14
15
```json
16
{
17
"extends": "@tsconfig/node20/tsconfig.json"
18
}
19
```
20
21
Multiple configurations can be extended (TypeScript 5.0+):
22
23
```json
24
{
25
"extends": ["@tsconfig/node20/tsconfig.json", "@tsconfig/strictest/tsconfig.json"]
26
}
27
```
28
29
## Basic Usage
30
31
1. Choose the appropriate TSConfig base for your environment
32
2. Install the corresponding npm package as a development dependency
33
3. Extend the configuration in your project's `tsconfig.json`
34
35
Example for Node.js 20:
36
37
```bash
38
npm install --save-dev @tsconfig/node20
39
```
40
41
```json
42
{
43
"extends": "@tsconfig/node20/tsconfig.json",
44
"compilerOptions": {
45
"outDir": "./dist",
46
"rootDir": "./src"
47
},
48
"include": ["src/**/*"],
49
"exclude": ["node_modules", "dist"]
50
}
51
```
52
53
## Architecture
54
55
The repository is structured around several key components:
56
57
- **Base Configurations**: JSON files in the `bases/` directory, each targeting a specific environment
58
- **Package Generation**: Automated scripts that create individual npm packages from base configurations
59
- **Template System**: Shared package.json and README templates for generated packages
60
- **Deployment Pipeline**: GitHub Actions that publish updated configurations
61
62
Each base configuration includes:
63
- **Target Environment**: Specific runtime (Node.js version, framework, etc.)
64
- **Compiler Options**: Optimized TypeScript settings for that environment
65
- **Library Support**: Appropriate lib declarations and module systems
66
- **Metadata**: Version tracking and display information
67
68
## Capabilities
69
70
### Node.js Configurations
71
72
Comprehensive TypeScript configurations for different Node.js versions and deployment strategies.
73
74
```typescript { .api }
75
// Available Node.js configurations
76
interface NodeConfigurations {
77
/** Long Term Support - currently Node.js 22 */
78
"node-lts": TSConfigBase;
79
80
/** TypeScript-specific Node.js settings (TS 5.8+) */
81
"node-ts": TSConfigBase;
82
83
/** Specific Node.js versions */
84
"node10": TSConfigBase;
85
"node12": TSConfigBase;
86
"node14": TSConfigBase;
87
"node16": TSConfigBase;
88
"node17": TSConfigBase;
89
"node18": TSConfigBase;
90
"node19": TSConfigBase;
91
"node20": TSConfigBase;
92
"node21": TSConfigBase;
93
"node22": TSConfigBase;
94
"node23": TSConfigBase;
95
"node24": TSConfigBase;
96
}
97
```
98
99
[Node.js Configurations](./node-configurations.md)
100
101
### Framework Configurations
102
103
TypeScript configurations optimized for popular JavaScript frameworks and build tools.
104
105
```typescript { .api }
106
// Available framework configurations
107
interface FrameworkConfigurations {
108
/** Next.js applications */
109
"next": TSConfigBase;
110
111
/** Create React App projects */
112
"create-react-app": TSConfigBase;
113
114
/** React Native applications */
115
"react-native": TSConfigBase;
116
117
/** Remix applications */
118
"remix": TSConfigBase;
119
120
/** Vite + React projects */
121
"vite-react": TSConfigBase;
122
123
/** Svelte applications */
124
"svelte": TSConfigBase;
125
126
/** Nuxt.js applications */
127
"nuxt": TSConfigBase;
128
129
/** Taro mini-program framework */
130
"taro": TSConfigBase;
131
132
/** Ember.js applications */
133
"ember": TSConfigBase;
134
135
/** Docusaurus v2 documentation sites */
136
"docusaurus": TSConfigBase;
137
}
138
```
139
140
[Framework Configurations](./framework-configurations.md)
141
142
### Runtime Configurations
143
144
Configurations for alternative JavaScript runtimes and testing frameworks.
145
146
```typescript { .api }
147
// Available runtime configurations
148
interface RuntimeConfigurations {
149
/** Bun runtime */
150
"bun": TSConfigBase;
151
152
/** Deno runtime */
153
"deno": TSConfigBase;
154
155
/** QJSEngine runtime */
156
"qjsengine": TSConfigBase;
157
158
/** Cypress testing framework */
159
"cypress": TSConfigBase;
160
}
161
```
162
163
[Runtime Configurations](./runtime-configurations.md)
164
165
### General Purpose Configurations
166
167
Standard configurations for common development patterns and strictness levels.
168
169
```typescript { .api }
170
// General purpose configurations
171
interface GeneralConfigurations {
172
/** Community recommended settings */
173
"recommended": TSConfigBase;
174
175
/** Maximum strictness settings */
176
"strictest": TSConfigBase;
177
}
178
```
179
180
[General Configurations](./general-configurations.md)
181
182
## Configuration Schema
183
184
All TSConfig bases follow a consistent schema structure:
185
186
```typescript { .api }
187
interface TSConfigBase {
188
/** JSON Schema validation */
189
$schema: "https://json.schemastore.org/tsconfig";
190
191
/** Human-readable display name */
192
display: string;
193
194
/** Configuration version identifier */
195
_version: string;
196
197
/** TypeScript compiler options */
198
compilerOptions: CompilerOptions;
199
200
/** File inclusion patterns (optional) */
201
include?: string[];
202
203
/** File exclusion patterns (optional) */
204
exclude?: string[];
205
206
/** TypeScript plugins (optional) */
207
plugins?: Plugin[];
208
}
209
210
interface CompilerOptions {
211
/** Compilation target */
212
target?: "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "esnext";
213
214
/** Module system */
215
module?: "commonjs" | "esnext" | "nodenext" | "umd" | "amd" | "system";
216
217
/** Module resolution strategy */
218
moduleResolution?: "node" | "node16" | "bundler";
219
220
/** Library declarations to include */
221
lib?: string[];
222
223
/** Enable strict type checking */
224
strict?: boolean;
225
226
/** Enable ES module interoperability */
227
esModuleInterop?: boolean;
228
229
/** Skip type checking of declaration files */
230
skipLibCheck?: boolean;
231
232
/** JSX compilation mode */
233
jsx?: "preserve" | "react" | "react-jsx" | "react-jsxdev" | "react-native";
234
235
/** Additional compiler options */
236
[key: string]: any;
237
}
238
```
239
240
## Package Generation System
241
242
The repository includes automated tooling for generating npm packages:
243
244
```typescript { .api }
245
interface PackageGenerationSystem {
246
/** Converts base configurations to npm packages */
247
"scripts/create-npm-packages.ts": GenerationScript;
248
249
/** Deploys changed packages to npm */
250
"scripts/deploy-changed-npm-packages.ts": DeploymentScript;
251
252
/** Updates README with configuration table */
253
"scripts/update-markdown-readme.ts": DocumentationScript;
254
255
/** Generates recommended TSConfig */
256
"scripts/generate-recommend.ts": RecommendationScript;
257
258
/** Generates LTS configuration */
259
"scripts/generate-lts.ts": LTSScript;
260
}
261
262
interface GenerationScript {
263
/** Creates individual npm packages from base configurations */
264
execute(): Promise<void>;
265
266
/** Package creation process */
267
process: {
268
/** Read base configuration files */
269
readBases(): TSConfigBase[];
270
271
/** Generate package.json for each base */
272
createPackageJson(base: TSConfigBase): PackageJson;
273
274
/** Copy template files */
275
copyTemplates(packagePath: string): void;
276
277
/** Apply string replacements */
278
applyReplacements(files: string[], base: TSConfigBase): void;
279
};
280
}
281
```