ai-hero-cli 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -1
- package/dist/bin.js.map +1 -1
- package/docs/tsconfig/allowArbitraryExtensions.md +38 -0
- package/docs/tsconfig/allowImportingTsExtensions.md +9 -0
- package/docs/tsconfig/allowJs.md +41 -0
- package/docs/tsconfig/allowSyntheticDefaultImports.md +56 -0
- package/docs/tsconfig/allowUmdGlobalAccess.md +8 -0
- package/docs/tsconfig/allowUnreachableCode.md +40 -0
- package/docs/tsconfig/allowUnusedLabels.md +23 -0
- package/docs/tsconfig/alwaysStrict.md +8 -0
- package/docs/tsconfig/assumeChangesOnlyAffectDirectDependencies.md +8 -0
- package/docs/tsconfig/baseUrl.md +26 -0
- package/docs/tsconfig/charset.md +7 -0
- package/docs/tsconfig/checkJs.md +40 -0
- package/docs/tsconfig/clean.md +6 -0
- package/docs/tsconfig/composite.md +17 -0
- package/docs/tsconfig/customConditions.md +41 -0
- package/docs/tsconfig/declaration.md +32 -0
- package/docs/tsconfig/declarationDir.md +36 -0
- package/docs/tsconfig/declarationMap.md +9 -0
- package/docs/tsconfig/diagnostics.md +8 -0
- package/docs/tsconfig/disableFilenameBasedTypeAcquisition.md +16 -0
- package/docs/tsconfig/disableReferencedProjectLoad.md +8 -0
- package/docs/tsconfig/disableSizeLimit.md +6 -0
- package/docs/tsconfig/disableSolutionSearching.md +8 -0
- package/docs/tsconfig/disableSourceOfProjectReferenceRedirect.md +7 -0
- package/docs/tsconfig/downlevelIteration.md +100 -0
- package/docs/tsconfig/emitBOM.md +8 -0
- package/docs/tsconfig/emitDeclarationOnly.md +11 -0
- package/docs/tsconfig/emitDecoratorMetadata.md +81 -0
- package/docs/tsconfig/enable.md +14 -0
- package/docs/tsconfig/erasableSyntaxOnly.md +65 -0
- package/docs/tsconfig/esModuleInterop.md +74 -0
- package/docs/tsconfig/exactOptionalPropertyTypes.md +37 -0
- package/docs/tsconfig/exclude.md +11 -0
- package/docs/tsconfig/excludeDirectories.md +14 -0
- package/docs/tsconfig/excludeFiles.md +14 -0
- package/docs/tsconfig/experimentalDecorators.md +11 -0
- package/docs/tsconfig/explainFiles.md +54 -0
- package/docs/tsconfig/extendedDiagnostics.md +9 -0
- package/docs/tsconfig/extends.md +49 -0
- package/docs/tsconfig/fallbackPolling.md +11 -0
- package/docs/tsconfig/files.md +26 -0
- package/docs/tsconfig/force.md +6 -0
- package/docs/tsconfig/forceConsistentCasingInFileNames.md +10 -0
- package/docs/tsconfig/generateCpuProfile.md +15 -0
- package/docs/tsconfig/generateTrace.md +6 -0
- package/docs/tsconfig/importHelpers.md +46 -0
- package/docs/tsconfig/importsNotUsedAsValues.md +16 -0
- package/docs/tsconfig/include.md +66 -0
- package/docs/tsconfig/incremental.md +10 -0
- package/docs/tsconfig/inlineSourceMap.md +35 -0
- package/docs/tsconfig/inlineSources.md +36 -0
- package/docs/tsconfig/isolatedDeclarations.md +8 -0
- package/docs/tsconfig/isolatedModules.md +77 -0
- package/docs/tsconfig/jsx.md +111 -0
- package/docs/tsconfig/jsxFactory.md +43 -0
- package/docs/tsconfig/jsxFragmentFactory.md +69 -0
- package/docs/tsconfig/jsxImportSource.md +95 -0
- package/docs/tsconfig/keyofStringsOnly.md +8 -0
- package/docs/tsconfig/lib.md +75 -0
- package/docs/tsconfig/libReplacement.md +22 -0
- package/docs/tsconfig/listEmittedFiles.md +42 -0
- package/docs/tsconfig/listFiles.md +40 -0
- package/docs/tsconfig/locale.md +26 -0
- package/docs/tsconfig/mapRoot.md +18 -0
- package/docs/tsconfig/maxNodeModuleJsDepth.md +11 -0
- package/docs/tsconfig/module.md +125 -0
- package/docs/tsconfig/moduleDetection.md +15 -0
- package/docs/tsconfig/moduleResolution.md +13 -0
- package/docs/tsconfig/moduleSuffixes.md +26 -0
- package/docs/tsconfig/newLine.md +6 -0
- package/docs/tsconfig/noCheck.md +6 -0
- package/docs/tsconfig/noEmit.md +10 -0
- package/docs/tsconfig/noEmitHelpers.md +38 -0
- package/docs/tsconfig/noEmitOnError.md +8 -0
- package/docs/tsconfig/noErrorTruncation.md +45 -0
- package/docs/tsconfig/noFallthroughCasesInSwitch.md +22 -0
- package/docs/tsconfig/noImplicitAny.md +26 -0
- package/docs/tsconfig/noImplicitOverride.md +66 -0
- package/docs/tsconfig/noImplicitReturns.md +17 -0
- package/docs/tsconfig/noImplicitThis.md +28 -0
- package/docs/tsconfig/noImplicitUseStrict.md +7 -0
- package/docs/tsconfig/noLib.md +9 -0
- package/docs/tsconfig/noPropertyAccessFromIndexSignature.md +57 -0
- package/docs/tsconfig/noResolve.md +9 -0
- package/docs/tsconfig/noStrictGenericChecks.md +20 -0
- package/docs/tsconfig/noUncheckedIndexedAccess.md +53 -0
- package/docs/tsconfig/noUncheckedSideEffectImports.md +52 -0
- package/docs/tsconfig/noUnusedLocals.md +15 -0
- package/docs/tsconfig/noUnusedParameters.md +15 -0
- package/docs/tsconfig/out.md +9 -0
- package/docs/tsconfig/outDir.md +39 -0
- package/docs/tsconfig/outFile.md +11 -0
- package/docs/tsconfig/paths.md +39 -0
- package/docs/tsconfig/plugins.md +17 -0
- package/docs/tsconfig/preserveConstEnums.md +58 -0
- package/docs/tsconfig/preserveSymlinks.md +10 -0
- package/docs/tsconfig/preserveValueImports.md +18 -0
- package/docs/tsconfig/preserveWatchOutput.md +6 -0
- package/docs/tsconfig/pretty.md +7 -0
- package/docs/tsconfig/reactNamespace.md +6 -0
- package/docs/tsconfig/references.md +9 -0
- package/docs/tsconfig/removeComments.md +33 -0
- package/docs/tsconfig/resolveJsonModule.md +44 -0
- package/docs/tsconfig/resolvePackageJsonExports.md +8 -0
- package/docs/tsconfig/resolvePackageJsonImports.md +8 -0
- package/docs/tsconfig/rewriteRelativeImportExtensions.md +8 -0
- package/docs/tsconfig/rootDir.md +66 -0
- package/docs/tsconfig/rootDirs.md +66 -0
- package/docs/tsconfig/skipDefaultLibCheck.md +6 -0
- package/docs/tsconfig/skipLibCheck.md +19 -0
- package/docs/tsconfig/sourceMap.md +39 -0
- package/docs/tsconfig/sourceRoot.md +18 -0
- package/docs/tsconfig/stopBuildOnErrors.md +6 -0
- package/docs/tsconfig/strict.md +11 -0
- package/docs/tsconfig/strictBindCallApply.md +34 -0
- package/docs/tsconfig/strictBuiltinIteratorReturn.md +6 -0
- package/docs/tsconfig/strictFunctionTypes.md +55 -0
- package/docs/tsconfig/strictNullChecks.md +58 -0
- package/docs/tsconfig/strictPropertyInitialization.md +29 -0
- package/docs/tsconfig/stripInternal.md +60 -0
- package/docs/tsconfig/suppressExcessPropertyErrors.md +16 -0
- package/docs/tsconfig/suppressImplicitAnyIndexErrors.md +25 -0
- package/docs/tsconfig/synchronousWatchDirectory.md +14 -0
- package/docs/tsconfig/target.md +18 -0
- package/docs/tsconfig/traceResolution.md +7 -0
- package/docs/tsconfig/tsBuildInfoFile.md +17 -0
- package/docs/tsconfig/typeAcquisition.md +37 -0
- package/docs/tsconfig/typeRoots.md +21 -0
- package/docs/tsconfig/types.md +40 -0
- package/docs/tsconfig/useDefineForClassFields.md +10 -0
- package/docs/tsconfig/useUnknownInCatchVariables.md +21 -0
- package/docs/tsconfig/verbatimModuleSyntax.md +148 -0
- package/docs/tsconfig/verbose.md +6 -0
- package/docs/tsconfig/watchDirectory.md +10 -0
- package/docs/tsconfig/watchFile.md +12 -0
- package/package.json +4 -2
- package/prompts/hows-my-tsconfig-score.md +29 -0
- package/prompts/hows-my-tsconfig.md +75 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
display: 'Verbatim Module Syntax'
|
|
3
|
+
oneline: "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
By default, TypeScript does something called _import elision_.
|
|
7
|
+
Basically, if you write something like
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Car } from './car';
|
|
11
|
+
|
|
12
|
+
export function drive(car: Car) {
|
|
13
|
+
// ...
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
TypeScript detects that you're only using an import for types and drops the import entirely.
|
|
18
|
+
Your output JavaScript might look something like this:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
export function drive(car) {
|
|
22
|
+
// ...
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Most of the time this is good, because if `Car` isn't a value that's exported from `./car`, we'll get a runtime error.
|
|
27
|
+
|
|
28
|
+
But it does add a layer of complexity for certain edge cases.
|
|
29
|
+
For example, notice there's no statement like `import "./car";` - the import was dropped entirely.
|
|
30
|
+
That actually makes a difference for modules that have side-effects or not.
|
|
31
|
+
|
|
32
|
+
TypeScript's emit strategy for JavaScript also has another few layers of complexity - import elision isn't always just driven by how an import is used - it often consults how a value is declared as well.
|
|
33
|
+
So it's not always clear whether code like the following
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
export { Car } from './car';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
should be preserved or dropped.
|
|
40
|
+
If `Car` is declared with something like a `class`, then it can be preserved in the resulting JavaScript file.
|
|
41
|
+
But if `Car` is only declared as a `type` alias or `interface`, then the JavaScript file shouldn't export `Car` at all.
|
|
42
|
+
|
|
43
|
+
While TypeScript might be able to make these emit decisions based on information from across files, not every compiler can.
|
|
44
|
+
|
|
45
|
+
The `type` modifier on imports and exports helps with these situations a bit.
|
|
46
|
+
We can make it explicit whether an import or export is only being used for type analysis, and can be dropped entirely in JavaScript files by using the `type` modifier.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
// This statement can be dropped entirely in JS output
|
|
50
|
+
import type * as car from './car';
|
|
51
|
+
|
|
52
|
+
// The named import/export 'Car' can be dropped in JS output
|
|
53
|
+
import { type Car } from './car';
|
|
54
|
+
export { type Car } from './car';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`type` modifiers are not quite useful on their own - by default, module elision will still drop imports, and nothing forces you to make the distinction between `type` and plain imports and exports.
|
|
58
|
+
So TypeScript has the flag `--importsNotUsedAsValues` to make sure you use the `type` modifier, `--preserveValueImports` to prevent _some_ module elision behavior, and `--isolatedModules` to make sure that your TypeScript code works across different compilers.
|
|
59
|
+
Unfortunately, understanding the fine details of those 3 flags is hard, and there are still some edge cases with unexpected behavior.
|
|
60
|
+
|
|
61
|
+
TypeScript 5.0 introduces a new option called `--verbatimModuleSyntax` to simplify the situation.
|
|
62
|
+
The rules are much simpler - any imports or exports without a `type` modifier are left around.
|
|
63
|
+
Anything that uses the `type` modifier is dropped entirely.
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// Erased away entirely.
|
|
67
|
+
import type { A } from 'a';
|
|
68
|
+
|
|
69
|
+
// Rewritten to 'import { b } from "bcd";'
|
|
70
|
+
import { b, type c, type d } from 'bcd';
|
|
71
|
+
|
|
72
|
+
// Rewritten to 'import {} from "xyz";'
|
|
73
|
+
import { type xyz } from 'xyz';
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
With this new option, what you see is what you get.
|
|
77
|
+
|
|
78
|
+
That does have some implications when it comes to module interop though.
|
|
79
|
+
Under this flag, ECMAScript `import`s and `export`s won't be rewritten to `require` calls when your settings or file extension implied a different module system.
|
|
80
|
+
Instead, you'll get an error.
|
|
81
|
+
If you need to emit code that uses `require` and `module.exports`, you'll have to use TypeScript's module syntax that predates ES2015:
|
|
82
|
+
|
|
83
|
+
<table>
|
|
84
|
+
<thead>
|
|
85
|
+
<tr>
|
|
86
|
+
<th>Input TypeScript</th>
|
|
87
|
+
<th>Output JavaScript</th>
|
|
88
|
+
</tr>
|
|
89
|
+
</thead>
|
|
90
|
+
|
|
91
|
+
<tr>
|
|
92
|
+
<td>
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import foo = require('foo');
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</td>
|
|
99
|
+
<td>
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
const foo = require('foo');
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
</td>
|
|
106
|
+
</tr>
|
|
107
|
+
<tr>
|
|
108
|
+
<td>
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
function foo() {}
|
|
112
|
+
function bar() {}
|
|
113
|
+
function baz() {}
|
|
114
|
+
|
|
115
|
+
export = {
|
|
116
|
+
foo,
|
|
117
|
+
bar,
|
|
118
|
+
baz,
|
|
119
|
+
};
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
</td>
|
|
123
|
+
<td>
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
function foo() {}
|
|
127
|
+
function bar() {}
|
|
128
|
+
function baz() {}
|
|
129
|
+
|
|
130
|
+
module.exports = {
|
|
131
|
+
foo,
|
|
132
|
+
bar,
|
|
133
|
+
baz,
|
|
134
|
+
};
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</td>
|
|
138
|
+
</tr>
|
|
139
|
+
</table>
|
|
140
|
+
|
|
141
|
+
While this is a limitation, it does help make some issues more obvious.
|
|
142
|
+
For example, it's very common to forget to set the [`type` field in `package.json`](https://nodejs.org/api/packages.html#type) under `--module node16`.
|
|
143
|
+
As a result, developers would start writing CommonJS modules instead of ES modules without realizing it, giving surprising lookup rules and JavaScript output.
|
|
144
|
+
This new flag ensures that you're intentional about the file type you're using because the syntax is intentionally different.
|
|
145
|
+
|
|
146
|
+
Because `--verbatimModuleSyntax` provides a more consistent story than `--importsNotUsedAsValues` and `--preserveValueImports`, those two existing flags are being deprecated in its favor.
|
|
147
|
+
|
|
148
|
+
For more details, read up on [the original pull request](https://github.com/microsoft/TypeScript/pull/52203) and [its proposal issue](https://github.com/microsoft/TypeScript/issues/51479).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
display: 'Watch Directory'
|
|
3
|
+
oneline: 'Specify how directories are watched on systems that lack recursive file-watching functionality.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality.
|
|
7
|
+
|
|
8
|
+
- `fixedPollingInterval`: Check every directory for changes several times a second at a fixed interval.
|
|
9
|
+
- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified directories will be checked less often.
|
|
10
|
+
- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for directory changes.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
display: 'Watch File'
|
|
3
|
+
oneline: 'Specify how the TypeScript watch mode works.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The strategy for how individual files are watched.
|
|
7
|
+
|
|
8
|
+
- `fixedPollingInterval`: Check every file for changes several times a second at a fixed interval.
|
|
9
|
+
- `priorityPollingInterval`: Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others.
|
|
10
|
+
- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified files will be checked less often.
|
|
11
|
+
- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for file changes.
|
|
12
|
+
- `useFsEventsOnParentDirectory`: Attempt to use the operating system/file system's native events to listen for changes on a file's parent directory
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-hero-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"bin": {
|
|
5
5
|
"ai-hero": "./dist/bin.js"
|
|
6
6
|
},
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"docs",
|
|
26
|
+
"prompts"
|
|
25
27
|
],
|
|
26
28
|
"type": "module",
|
|
27
29
|
"devDependencies": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
You will receive some feedback given about a tsconfig.json file.
|
|
2
|
+
|
|
3
|
+
Your job is to score how positive the feedback is on a scale of 1 to 10, 10 being the best.
|
|
4
|
+
|
|
5
|
+
Reply only with the score, no other text.
|
|
6
|
+
|
|
7
|
+
- 10/10 - Extremely modern and up to date
|
|
8
|
+
- 9/10 - Very modern and up to date
|
|
9
|
+
- 8/10 - Modern and up to date
|
|
10
|
+
- 7/10 - Somewhat modern and up to date
|
|
11
|
+
- 6/10 - Somewhat outdated
|
|
12
|
+
- 5/10 - Outdated
|
|
13
|
+
- 4/10 - Very outdated
|
|
14
|
+
- 3/10 - Extremely outdated
|
|
15
|
+
- 2/10 - Unbelievably outdated
|
|
16
|
+
- 1/10 - The absolute worst
|
|
17
|
+
|
|
18
|
+
Format it like so, with an emoji next to the score:
|
|
19
|
+
|
|
20
|
+
10/10 🎉
|
|
21
|
+
9/10 🎉
|
|
22
|
+
8/10 🎉
|
|
23
|
+
7/10 🎉
|
|
24
|
+
6/10 🤔
|
|
25
|
+
5/10 🤔
|
|
26
|
+
4/10 😕
|
|
27
|
+
3/10 😕
|
|
28
|
+
2/10 😕
|
|
29
|
+
1/10 💀
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Your name is Matt Pocock. You are a senior software engineer. You are a TypeScript expert.
|
|
2
|
+
|
|
3
|
+
You are given a tsconfig.json file. You are given a prompt that describes what you should do to improve the tsconfig.json file.
|
|
4
|
+
|
|
5
|
+
You are to respond with a list of changes you would make to the tsconfig.json file.
|
|
6
|
+
|
|
7
|
+
You should recommend to the user that they read the TSConfig Cheat Sheet: https://www.totaltypescript.com/tsconfig-cheat-sheet
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
If the tsconfig has `forceConsistentCasingInFileNames`, recommend removing it. It's set to `true` by default since TypeScript 5.0.
|
|
12
|
+
|
|
13
|
+
If the tsconfig has `erasableSyntaxOnly`, pat the user on the back and say they're fighting the good fight against enums, namespaces and class parameter properties.
|
|
14
|
+
|
|
15
|
+
If the tsconfig does not have `noImplicitOverride`, recommend adding it.
|
|
16
|
+
|
|
17
|
+
Do not recommend `exactOptionalPropertyTypes` - but don't say to remove it either. It's fine if you like it, but I personally don't.
|
|
18
|
+
|
|
19
|
+
If the user does not have `lib` set, recommend adding it. They can set it to the same value as `target`. `lib` can be used to exclude the `dom` types if needed. Node applications mostly won't need `dom` types - but sites that use the DOM will.
|
|
20
|
+
|
|
21
|
+
If they have `dom` in `lib`, then ensure they also have `dom.iterable` there too.
|
|
22
|
+
|
|
23
|
+
`noUncheckedIndexedAccess: true` is a useful option to have because it catches errors where you might be accessing an index that doesn't exist. But if the user doesn't want it, don't push them to add it.
|
|
24
|
+
|
|
25
|
+
`moduleDetection: "force"` forces every non-declaration file to be treated as a module. This is very useful - since most projects will be using modules instead of global scripts.
|
|
26
|
+
|
|
27
|
+
If the tsconfig doesn't have `strict: true`, strongly recommend adding it. This is the most important setting for catching bugs early.
|
|
28
|
+
|
|
29
|
+
If the user has `strict: true` but also has individual strict flags set explicitly, recommend removing the redundant ones since `strict: true` includes them all.
|
|
30
|
+
|
|
31
|
+
For projects that need to be extra safe, recommend `noUnusedLocals: true` and `noUnusedParameters: true` to catch dead code.
|
|
32
|
+
|
|
33
|
+
### Module Options
|
|
34
|
+
|
|
35
|
+
There are only two valid options for `module`: `Preserve` and `NodeNext`.
|
|
36
|
+
|
|
37
|
+
If the user has `noEmit` set to `false`, or not specified, then the best config for them is `module: "NodeNext"`. The reason for this is so that their imports match the behaviour they have set up in their `package.json`. If they have `package.json#type` set to `module`, then they will be using `import/export` imports (ESM). If they have `package.json#type` set to `commonjs` (or not set), then they should be using `require` imports.
|
|
38
|
+
|
|
39
|
+
If the user has `moduleResolution` set to `node`, recommend they use `NodeNext` instead and remove the `moduleResolution` option.
|
|
40
|
+
|
|
41
|
+
If the user is targeting modern environments (ES2020+), recommend setting `target` to `"ES2022"` or higher for better performance.
|
|
42
|
+
|
|
43
|
+
For projects using modern JavaScript features, recommend `allowUnreachableCode: false` to catch dead code.
|
|
44
|
+
|
|
45
|
+
If the user is building a library, recommend `declaration: true` to generate `.d.ts` files.
|
|
46
|
+
|
|
47
|
+
For better IDE experience, recommend `sourceMap: true` to enable debugging of TypeScript files.
|
|
48
|
+
|
|
49
|
+
If the user is using a bundler like Vite or Webpack, they might want `noEmit: true` since the bundler handles compilation.
|
|
50
|
+
|
|
51
|
+
## Implicit Inheritances
|
|
52
|
+
|
|
53
|
+
If some tsconfig.json options are set to `true`, others are automatically set to `true` as well. This means that the user doesn't need to set them.
|
|
54
|
+
|
|
55
|
+
`verbatimModuleSyntax: true` -> `isolatedModules: true`
|
|
56
|
+
|
|
57
|
+
`strict: true` -> `noImplicitAny: true`, `noImplicitThis: true`, `strictNullChecks: true`, `strictFunctionTypes: true`, `strictBindCallApply: true`, `strictPropertyInitialization: true`, `noImplicitReturns: true`, `useUnknownInCatchVariables: true`, `strictBuiltinIteratorReturn: true`
|
|
58
|
+
|
|
59
|
+
`esModuleInterop: true` -> `allowSyntheticDefaultImports: true`
|
|
60
|
+
|
|
61
|
+
`module: "node16"` -> `moduleResolution: "node16"`
|
|
62
|
+
|
|
63
|
+
`module: "node18"` -> `moduleResolution: "node18"`
|
|
64
|
+
|
|
65
|
+
`module: "nodenext"` -> `moduleResolution: "nodenext"`
|
|
66
|
+
|
|
67
|
+
`target: "ES2022"` -> `lib: ["ES2022", "DOM", "DOM.Iterable"]` (if lib is not explicitly set)
|
|
68
|
+
|
|
69
|
+
## Docs
|
|
70
|
+
|
|
71
|
+
Below, I've added the docs for each of the options that are set in the tsconfig.json file.
|
|
72
|
+
|
|
73
|
+
Use the docs to help you understand the options and how they work. Also use them to inform your recommendations.
|
|
74
|
+
|
|
75
|
+
{{docs}}
|