-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add comments for nearly all tsconfig options in use
- since we can use comments in tsconfig.json, add them to give simple, one-liner explanations as to what each setting does - also add a link to the TSConfig Reference for further details - and specify which options are recommended as true by TS but not on by default for backwards compat or other reasons - a few leftover that I still need to think about
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
{ | ||
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs | ||
"include": ["src", "types"], | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"lib": ["dom", "esnext"], | ||
"importHelpers": true, | ||
// output .d.ts declaration files for consumers | ||
"declaration": true, | ||
// output .js.map sourcemap files for consumers | ||
"sourceMap": true, | ||
// match output dir to input dir. e.g. dist/index instead of dist/src/index | ||
"rootDir": "./src", | ||
// stricter type-checking for stronger correctness. Recommended by TS | ||
"strict": true, | ||
// linter checks for common issues | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
// use Node's module resolution algorithm, instead of the legacy TS one | ||
"moduleResolution": "node", | ||
// transpile JSX to React.createElement | ||
"jsx": "react", | ||
// interop between ESM and CJS modules. Recommended by TS | ||
"esModuleInterop": true, | ||
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS | ||
"skipLibCheck": true, | ||
// error out if import and file system have a casing mismatch. Recommended by TS | ||
"forceConsistentCasingInFileNames": true, | ||
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc` | ||
"noEmit": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
{ | ||
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs | ||
"include": ["src", "types"], | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"lib": ["dom", "esnext"], | ||
"importHelpers": true, | ||
// output .d.ts declaration files for consumers | ||
"declaration": true, | ||
// output .js.map sourcemap files for consumers | ||
"sourceMap": true, | ||
// match output dir to input dir. e.g. dist/index instead of dist/src/index | ||
"rootDir": "./src", | ||
// stricter type-checking for stronger correctness. Recommended by TS | ||
"strict": true, | ||
// linter checks for common issues | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
// use Node's module resolution algorithm, instead of the legacy TS one | ||
"moduleResolution": "node", | ||
// transpile JSX to React.createElement | ||
"jsx": "react", | ||
// interop between ESM and CJS modules. Recommended by TS | ||
"esModuleInterop": true, | ||
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS | ||
"skipLibCheck": true, | ||
// error out if import and file system have a casing mismatch. Recommended by TS | ||
"forceConsistentCasingInFileNames": true, | ||
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc` | ||
"noEmit": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,34 @@ | ||
{ | ||
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs | ||
"include": ["src", "types"], | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"lib": ["dom", "esnext"], | ||
"importHelpers": true, | ||
// output .d.ts declaration files for consumers | ||
"declaration": true, | ||
// output .js.map sourcemap files for consumers | ||
"sourceMap": true, | ||
// match output dir to input dir. e.g. dist/index instead of dist/src/index | ||
"rootDir": "./src", | ||
// stricter type-checking for stronger correctness. Recommended by TS | ||
"strict": true, | ||
// linter checks for common issues | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
// use Node's module resolution algorithm, instead of the legacy TS one | ||
"moduleResolution": "node", | ||
// transpile JSX to React.createElement | ||
"jsx": "react", | ||
// interop between ESM and CJS modules. Recommended by TS | ||
"esModuleInterop": true, | ||
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS | ||
"skipLibCheck": true, | ||
// error out if import and file system have a casing mismatch. Recommended by TS | ||
"forceConsistentCasingInFileNames": true, | ||
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc` | ||
"noEmit": true, | ||
} | ||
} |