Skip to content

Commit

Permalink
Add legacy preset
Browse files Browse the repository at this point in the history
  • Loading branch information
voxpelli committed Nov 18, 2022
1 parent 2261f4d commit 7f3f0a7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -29,6 +29,7 @@ Then in your `tsconfig.json`, it [`extends`](https://www.typescriptlang.org/tsco
### Generic ones

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

### Node specific ones
Expand Down
40 changes: 40 additions & 0 deletions legacy.json
@@ -0,0 +1,40 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Legacy",

"compilerOptions": {
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": false,
"removeComments": true,

/* My own additions */

/* Make it a JS-targeted config */
"allowJs": true,
"checkJs": true,
"noEmit": true,
"resolveJsonModule": true,

/* New checks being tried out */
"exactOptionalPropertyTypes": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,

/* Additional checks */
"forceConsistentCasingInFileNames": true,
// Skipped as implicit "return undefined" at end of function is okay + explicit clashes with ESLint "no-useless-return"
// "noImplicitReturns": false,
"noUnusedLocals": true,
"noUnusedParameters": true

/* To make strict checking somewhat less strict during a transition stage, add one or more of: */
/*
"noImplicitThis": false,
"noImplicitAny": false,
"strictNullChecks": false,
*/
}
}

0 comments on commit 7f3f0a7

Please sign in to comment.