@yuu1111/tsconfig 1.0.6 → 1.0.7
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/README.ja.md +59 -18
- package/README.md +58 -19
- package/package.json +2 -2
package/README.ja.md
CHANGED
|
@@ -12,9 +12,48 @@ bun add -D @yuu1111/tsconfig
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
`tsconfig.json` でpreset
|
|
15
|
+
`tsconfig.json` でpresetを1つextendsし、presetが持たないpathをProjectで足す
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"extends": "@yuu1111/tsconfig/base.json",
|
|
20
|
+
"include": ["src/**/*.ts"]
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Presets
|
|
25
|
+
|
|
26
|
+
| Preset | Extends | 用途 |
|
|
27
|
+
|--------|---------|------|
|
|
28
|
+
| `base` | — | 他のpresetが継承する厳格なbase |
|
|
29
|
+
| `bun` | `base` | Bunのglobal型を足す |
|
|
30
|
+
| `library` | `base` | declarationとsource mapを出してJavaScriptをemitする |
|
|
31
|
+
| `declaration-only` | `library` | declaration fileだけを出す |
|
|
32
|
+
| `react` | `base` | DOM型とJSX transformを足す |
|
|
33
|
+
|
|
34
|
+
### base
|
|
35
|
+
|
|
36
|
+
他のpresetはすべて `base` をextendsする
|
|
37
|
+
emitせずに型検査だけを行い、emitはpresetまたはbundlerへ任せる
|
|
38
|
+
|
|
39
|
+
| Option | 値 |
|
|
40
|
+
|--------|-----|
|
|
41
|
+
| `target` | `ESNext` |
|
|
42
|
+
| `lib` | `["ESNext"]` |
|
|
43
|
+
| `module` | `Preserve` |
|
|
44
|
+
| `moduleResolution` | `bundler` |
|
|
45
|
+
| `moduleDetection` | `force` |
|
|
46
|
+
| `strict` | `true` |
|
|
47
|
+
| `noEmit` | `true` |
|
|
48
|
+
| `isolatedModules` | `true` |
|
|
49
|
+
| `verbatimModuleSyntax` | `true` |
|
|
50
|
+
| `esModuleInterop` | `true` |
|
|
51
|
+
| `resolveJsonModule` | `true` |
|
|
52
|
+
| `skipLibCheck` | `true` |
|
|
53
|
+
| `forceConsistentCasingInFileNames` | `true` |
|
|
54
|
+
| `noUncheckedIndexedAccess` | `true` |
|
|
55
|
+
| `noFallthroughCasesInSwitch` | `true` |
|
|
56
|
+
| `exactOptionalPropertyTypes` | `true` |
|
|
18
57
|
|
|
19
58
|
```json
|
|
20
59
|
{
|
|
@@ -22,9 +61,10 @@ bun add -D @yuu1111/tsconfig
|
|
|
22
61
|
}
|
|
23
62
|
```
|
|
24
63
|
|
|
25
|
-
###
|
|
64
|
+
### bun
|
|
26
65
|
|
|
27
|
-
|
|
66
|
+
`types: ["bun"]` を足す
|
|
67
|
+
利用Projectで `@types/bun` をinstallする
|
|
28
68
|
|
|
29
69
|
```json
|
|
30
70
|
{
|
|
@@ -32,7 +72,16 @@ bun add -D @yuu1111/tsconfig
|
|
|
32
72
|
}
|
|
33
73
|
```
|
|
34
74
|
|
|
35
|
-
###
|
|
75
|
+
### library
|
|
76
|
+
|
|
77
|
+
emitを有効にし、declaration、declaration map、source mapを出す
|
|
78
|
+
|
|
79
|
+
| Option | 値 |
|
|
80
|
+
|--------|-----|
|
|
81
|
+
| `noEmit` | `false` |
|
|
82
|
+
| `declaration` | `true` |
|
|
83
|
+
| `declarationMap` | `true` |
|
|
84
|
+
| `sourceMap` | `true` |
|
|
36
85
|
|
|
37
86
|
```json
|
|
38
87
|
{
|
|
@@ -45,9 +94,9 @@ bun add -D @yuu1111/tsconfig
|
|
|
45
94
|
}
|
|
46
95
|
```
|
|
47
96
|
|
|
48
|
-
###
|
|
97
|
+
### declaration-only
|
|
49
98
|
|
|
50
|
-
bundlerがJavaScript
|
|
99
|
+
`library` をextendsし、bundlerがJavaScriptを出すbuild向けに `emitDeclarationOnly` を設定する
|
|
51
100
|
|
|
52
101
|
```json
|
|
53
102
|
{
|
|
@@ -60,7 +109,9 @@ bundlerがJavaScriptを出し、TypeScriptはdeclaration fileだけを出す場
|
|
|
60
109
|
}
|
|
61
110
|
```
|
|
62
111
|
|
|
63
|
-
###
|
|
112
|
+
### react
|
|
113
|
+
|
|
114
|
+
`lib` へ `DOM` と `DOM.Iterable` を足し、`jsx: "react-jsx"` を設定する
|
|
64
115
|
|
|
65
116
|
```json
|
|
66
117
|
{
|
|
@@ -70,13 +121,3 @@ bundlerがJavaScriptを出し、TypeScriptはdeclaration fileだけを出す場
|
|
|
70
121
|
}
|
|
71
122
|
}
|
|
72
123
|
```
|
|
73
|
-
|
|
74
|
-
## Presets
|
|
75
|
-
|
|
76
|
-
| Preset | Use case |
|
|
77
|
-
|--------|----------|
|
|
78
|
-
| `base.json` | 厳格な共有base |
|
|
79
|
-
| `bun.json` | Bun project |
|
|
80
|
-
| `declaration-only.json` | declarationだけを出すlibrary build |
|
|
81
|
-
| `library.json` | declarationとsource mapを出すlibrary build |
|
|
82
|
-
| `react.json` | React(JSX + DOM型) |
|
package/README.md
CHANGED
|
@@ -12,9 +12,48 @@ bun add -D @yuu1111/tsconfig
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
-
Extend one
|
|
15
|
+
Extend one preset in `tsconfig.json` and add the paths it leaves to the project.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"extends": "@yuu1111/tsconfig/base.json",
|
|
20
|
+
"include": ["src/**/*.ts"]
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Presets
|
|
25
|
+
|
|
26
|
+
| Preset | Extends | Use case |
|
|
27
|
+
|--------|---------|----------|
|
|
28
|
+
| `base` | — | Strict baseline shared by the other presets |
|
|
29
|
+
| `bun` | `base` | Adds the Bun global types |
|
|
30
|
+
| `library` | `base` | Emits JavaScript with declarations and source maps |
|
|
31
|
+
| `declaration-only` | `library` | Emits declaration files only |
|
|
32
|
+
| `react` | `base` | Adds the DOM types and the JSX transform |
|
|
33
|
+
|
|
34
|
+
### base
|
|
35
|
+
|
|
36
|
+
Every other preset extends `base`.
|
|
37
|
+
It checks types without emitting, and leaves the emit to the preset or the bundler.
|
|
38
|
+
|
|
39
|
+
| Option | Value |
|
|
40
|
+
|--------|-------|
|
|
41
|
+
| `target` | `ESNext` |
|
|
42
|
+
| `lib` | `["ESNext"]` |
|
|
43
|
+
| `module` | `Preserve` |
|
|
44
|
+
| `moduleResolution` | `bundler` |
|
|
45
|
+
| `moduleDetection` | `force` |
|
|
46
|
+
| `strict` | `true` |
|
|
47
|
+
| `noEmit` | `true` |
|
|
48
|
+
| `isolatedModules` | `true` |
|
|
49
|
+
| `verbatimModuleSyntax` | `true` |
|
|
50
|
+
| `esModuleInterop` | `true` |
|
|
51
|
+
| `resolveJsonModule` | `true` |
|
|
52
|
+
| `skipLibCheck` | `true` |
|
|
53
|
+
| `forceConsistentCasingInFileNames` | `true` |
|
|
54
|
+
| `noUncheckedIndexedAccess` | `true` |
|
|
55
|
+
| `noFallthroughCasesInSwitch` | `true` |
|
|
56
|
+
| `exactOptionalPropertyTypes` | `true` |
|
|
18
57
|
|
|
19
58
|
```json
|
|
20
59
|
{
|
|
@@ -22,9 +61,9 @@ Extend one of the presets in your `tsconfig.json`:
|
|
|
22
61
|
}
|
|
23
62
|
```
|
|
24
63
|
|
|
25
|
-
###
|
|
64
|
+
### bun
|
|
26
65
|
|
|
27
|
-
Install `@types/bun` in the
|
|
66
|
+
Adds `types: ["bun"]`. Install `@types/bun` in the project.
|
|
28
67
|
|
|
29
68
|
```json
|
|
30
69
|
{
|
|
@@ -32,7 +71,16 @@ Install `@types/bun` in the consuming project, then extend the Bun preset:
|
|
|
32
71
|
}
|
|
33
72
|
```
|
|
34
73
|
|
|
35
|
-
###
|
|
74
|
+
### library
|
|
75
|
+
|
|
76
|
+
Turns emit on and writes declarations, declaration maps, and source maps.
|
|
77
|
+
|
|
78
|
+
| Option | Value |
|
|
79
|
+
|--------|-------|
|
|
80
|
+
| `noEmit` | `false` |
|
|
81
|
+
| `declaration` | `true` |
|
|
82
|
+
| `declarationMap` | `true` |
|
|
83
|
+
| `sourceMap` | `true` |
|
|
36
84
|
|
|
37
85
|
```json
|
|
38
86
|
{
|
|
@@ -45,10 +93,9 @@ Install `@types/bun` in the consuming project, then extend the Bun preset:
|
|
|
45
93
|
}
|
|
46
94
|
```
|
|
47
95
|
|
|
48
|
-
###
|
|
96
|
+
### declaration-only
|
|
49
97
|
|
|
50
|
-
|
|
51
|
-
declaration files.
|
|
98
|
+
Extends `library` and sets `emitDeclarationOnly`, for a build where a bundler emits the JavaScript.
|
|
52
99
|
|
|
53
100
|
```json
|
|
54
101
|
{
|
|
@@ -61,7 +108,9 @@ declaration files.
|
|
|
61
108
|
}
|
|
62
109
|
```
|
|
63
110
|
|
|
64
|
-
###
|
|
111
|
+
### react
|
|
112
|
+
|
|
113
|
+
Adds `DOM` and `DOM.Iterable` to `lib` and sets `jsx: "react-jsx"`.
|
|
65
114
|
|
|
66
115
|
```json
|
|
67
116
|
{
|
|
@@ -71,13 +120,3 @@ declaration files.
|
|
|
71
120
|
}
|
|
72
121
|
}
|
|
73
122
|
```
|
|
74
|
-
|
|
75
|
-
## Presets
|
|
76
|
-
|
|
77
|
-
| Preset | Use case |
|
|
78
|
-
|--------|----------|
|
|
79
|
-
| `base.json` | Strict shared base |
|
|
80
|
-
| `bun.json` | Bun projects |
|
|
81
|
-
| `declaration-only.json` | Declaration-only library builds |
|
|
82
|
-
| `library.json` | Library builds with declarations and source maps |
|
|
83
|
-
| `react.json` | React (JSX + DOM types) |
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuu1111/tsconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Shared TypeScript configurations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/yuu1111/configs.git",
|
|
8
|
-
"directory": "packages/tsconfig"
|
|
8
|
+
"directory": "packages/config/tsconfig"
|
|
9
9
|
},
|
|
10
10
|
"tsconfig": "./base.json",
|
|
11
11
|
"files": [
|