Skip to content

Commit a6d7776

Browse files
committed
Translate tsconfig files section into Japanese
1 parent 3c4fe9a commit a6d7776

File tree

7 files changed

+199
-0
lines changed

7 files changed

+199
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
display: "ファイルインクルージョン"
3+
---
4+
5+
これらの設定はTypeScriptが適切なファイルを確実に選択できるようにします。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
display: "Exclude"
3+
oneline: "Files or patterns to be skipped from the include option"
4+
---
5+
6+
`include`の解決時にスキップさせるファイル名やパターンのリストを指定します。
7+
8+
**重要**: `exclude``include`の結果として、どのファイルが含まれるべきか_のみ_に影響を与えます。
9+
`exclude`に指定されたファイルは、コードでの`import``types`でのインクルード、`/// <reference` ディレクティブ、`files`リストの指定によって、コードベースの一部となり得ます。
10+
11+
`exclude`はコードベースに含まれているファイルの読み込みを**防ぐ**ための仕組みではありません。`include`設定の結果を変更するだけです。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
display: "Extends"
3+
oneline: "Inherit options for a TSConfig"
4+
---
5+
6+
`extends`の値は、別の継承対象の設定ファイルへのパスを含む文字列です。
7+
Node.jsにおけるモジュール解決の流儀が用いられます。
8+
9+
ベースとなるファイルからの設定が最初に読み込まれ、続いて継承ファイルの設定によってオーバーライドされます。設定ファイル内のすべての相対パスは、元の設定ファイルを起点として解決されます。
10+
11+
継承した設定ファイルの`files`, `include`および`exclude`はベースとなる設定ファイルの内容を_上書き_します。
12+
また、継承における循環参照は許容されません。
13+
14+
#####
15+
16+
`configs/base.json`:
17+
18+
```json
19+
{
20+
"compilerOptions": {
21+
"noImplicitAny": true,
22+
"strictNullChecks": true
23+
}
24+
}
25+
```
26+
27+
`tsconfig.json`:
28+
29+
```json
30+
{
31+
"extends": "./configs/base",
32+
"files": ["main.ts", "supplemental.ts"]
33+
}
34+
```
35+
36+
`tsconfig.nostrictnull.json`:
37+
38+
```json
39+
{
40+
"extends": "./tsconfig",
41+
"compilerOptions": {
42+
"strictNullChecks": false
43+
}
44+
}
45+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
display: "Files"
3+
oneline: "Include a set list of files, does not support globs"
4+
---
5+
6+
プログラムに含めるファイルの許可リストを指定します。ファイルが見つからない場合、エラーが発生します。
7+
8+
```json
9+
{
10+
"compilerOptions": {},
11+
"files": [
12+
"core.ts",
13+
"sys.ts",
14+
"types.ts",
15+
"scanner.ts",
16+
"parser.ts",
17+
"utilities.ts",
18+
"binder.ts",
19+
"checker.ts",
20+
"tsc.ts"
21+
]
22+
}
23+
```
24+
25+
このオプションは、プロジェクトが少数のファイルから構成されていて、グロブパターンを必要としない場合で有用です。
26+
グロブパターンが必要な場合、[`include`](#include)を利用してください。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
display: "Include"
3+
oneline: "Files or patterns to include in this project"
4+
---
5+
6+
プログラムに含めるファイル名またはパターンのリストを指定します。
7+
ファイル名は`tsconfig.json`ファイルを含んでいるディレクトリからの相対パスとして解決されます。
8+
9+
```json
10+
{
11+
"include": ["src/**", "tests/**"]
12+
}
13+
```
14+
15+
この設定は以下のようにマッチします。
16+
17+
<!-- TODO: #135
18+
```diff
19+
.
20+
- ├── scripts
21+
- │ ├── lint.ts
22+
- │ ├── update_deps.ts
23+
- │ └── utils.ts
24+
+ ├── src
25+
+ │ ├── client
26+
+ │ │ ├── index.ts
27+
+ │ │ └── utils.ts
28+
+ │ ├── server
29+
+ │ │ └── index.ts
30+
+ ├── tests
31+
+ │ ├── app.test.ts
32+
+ │ ├── utils.ts
33+
+ │ └── tests.d.ts
34+
- ├── package.json
35+
- ├── tsconfig.json
36+
- └── yarn.lock
37+
``` -->
38+
39+
```
40+
.
41+
├── scripts ⨯
42+
│ ├── lint.ts ⨯
43+
│ ├── update_deps.ts ⨯
44+
│ └── utils.ts ⨯
45+
├── src ✓
46+
│ ├── client ✓
47+
│ │ ├── index.ts ✓
48+
│ │ └── utils.ts ✓
49+
│ ├── server ✓
50+
│ │ └── index.ts ✓
51+
├── tests ✓
52+
│ ├── app.test.ts ✓
53+
│ ├── utils.ts ✓
54+
│ └── tests.d.ts ✓
55+
├── package.json
56+
├── tsconfig.json
57+
└── yarn.lock
58+
```
59+
60+
`include``exclude`はグロブパターンのためのワイルドカードをサポートしています:
61+
62+
- `*` ゼロ個以上の文字列にマッチ(ディレクトリセパレータは除く)
63+
- `?` 任意の1文字にマッチ(ディレクトリセパレータは除く)
64+
- `**/` 任意階層の任意ディレクトリにマッチ
65+
66+
グロブパターンがファイルの拡張子を含まない場合、サポートされる拡張子のみが含まれるようになります(例:`.ts`, `.tsx``.d.ts`はデフォルトでインクルードされ、`.js``.jsx``allowJs`が設定された場合のみインクルードされます)。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
display: "References"
3+
oneline: "Provide a structure for composite projects"
4+
---
5+
6+
プロジェクト参照はTypeScriptのプログラムを小さい断片に分けて構造化するための手法です。
7+
プロジェクト参照を用いると、ビルド時間やエディターとのインタラクションに必要な時間が大幅に改善され、コンポーネント間の論理分割が強制により、より洗練された方法でコードを整理できます。
8+
9+
プロジェクト参照がどのように動作するかについては、このハンドブックの[Project References](/docs/handbook/project-references.html)を読んでください。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
display: "Type Acquisition"
3+
oneline: "Sets of options for Automatic Type Acquisition in JavaScript"
4+
---
5+
6+
エディターにJavaScriptプロジェクトが存在する場合、TypeScriptは`@types`で定義されるDefinitelyTypedから提供されるファイルを用いて、`node_modules`のための型ファイルを自動で提供します。
7+
これは自動型取得と呼ばれており、また設定の`typeAcquisition`を使ってカスタマイズできます。
8+
9+
この機能を無効化したりカスタマイズする場合、プロジェクトのルートに`jsconfig.json`ファイルを作成してください:
10+
11+
```json
12+
{
13+
"typeAcquisition": {
14+
"enable": false
15+
}
16+
}
17+
```
18+
19+
プロジェクトに含めるべき特定のモジュールがある場合(それが`node_modules`には存在しない場合):
20+
21+
```json
22+
{
23+
"typeAcquisition": {
24+
"include": ["jest"]
25+
}
26+
}
27+
```
28+
29+
モジュールが自動で取得されるべきでない場合。例えば、そのライブラリが`node_modules`に含まれてはいるが、チームでこのライブラリを利用しないことを合意している場合:
30+
31+
```json
32+
{
33+
"typeAcquisition": {
34+
"exclude": ["jquery"]
35+
}
36+
}
37+
```

0 commit comments

Comments
 (0)