Skip to content

Commit 7f3f0a7

Browse files
committed
Add legacy preset
1 parent 2261f4d commit 7f3f0a7

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Then in your `tsconfig.json`, it [`extends`](https://www.typescriptlang.org/tsco
2929
### Generic ones
3030

3131
* `base` – where most of the configuration is set
32+
* `legacy` – like `base` but for older TypeScript versions – version 4.5 and onward
3233
* `recommended` – like `base` but adds a [`target`](https://www.typescriptlang.org/tsconfig#target) set to `ES2015`
3334

3435
### Node specific ones

legacy.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"display": "Legacy",
4+
5+
"compilerOptions": {
6+
"module": "commonjs",
7+
"strict": true,
8+
"esModuleInterop": true,
9+
"skipLibCheck": false,
10+
"removeComments": true,
11+
12+
/* My own additions */
13+
14+
/* Make it a JS-targeted config */
15+
"allowJs": true,
16+
"checkJs": true,
17+
"noEmit": true,
18+
"resolveJsonModule": true,
19+
20+
/* New checks being tried out */
21+
"exactOptionalPropertyTypes": true,
22+
"noImplicitOverride": true,
23+
"noPropertyAccessFromIndexSignature": true,
24+
"noUncheckedIndexedAccess": true,
25+
26+
/* Additional checks */
27+
"forceConsistentCasingInFileNames": true,
28+
// Skipped as implicit "return undefined" at end of function is okay + explicit clashes with ESLint "no-useless-return"
29+
// "noImplicitReturns": false,
30+
"noUnusedLocals": true,
31+
"noUnusedParameters": true
32+
33+
/* To make strict checking somewhat less strict during a transition stage, add one or more of: */
34+
/*
35+
"noImplicitThis": false,
36+
"noImplicitAny": false,
37+
"strictNullChecks": false,
38+
*/
39+
}
40+
}

0 commit comments

Comments
 (0)