-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translate tsconfig
files
section into Japanese
- Loading branch information
Showing
7 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/tsconfig-reference/copy/ja/categories/Project_Files_0.md
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
display: "ファイルインクルージョン" | ||
--- | ||
|
||
これらの設定はTypeScriptが適切なファイルを確実に選択できるようにします。 |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
display: "Exclude" | ||
oneline: "Files or patterns to be skipped from the include option" | ||
--- | ||
|
||
`include`の解決時にスキップさせるファイル名やパターンのリストを指定します。 | ||
|
||
**重要**: `exclude`は`include`の結果として、どのファイルが含まれるべきか_のみ_に影響を与えます。 | ||
`exclude`に指定されたファイルは、コードでの`import`や`types`でのインクルード、`/// <reference` ディレクティブ、`files`リストの指定によって、コードベースの一部となり得ます。 | ||
|
||
`exclude`はコードベースに含まれているファイルの読み込みを**防ぐ**ための仕組みではありません。`include`設定の結果を変更するだけです。 |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
display: "Extends" | ||
oneline: "Inherit options for a TSConfig" | ||
--- | ||
|
||
`extends`の値は、別の継承対象の設定ファイルへのパスを含む文字列です。 | ||
Node.jsにおけるモジュール解決の流儀が用いられます。 | ||
|
||
ベースとなるファイルからの設定が最初に読み込まれ、続いて継承ファイルの設定によってオーバーライドされます。設定ファイル内のすべての相対パスは、元の設定ファイルを起点として解決されます。 | ||
|
||
継承した設定ファイルの`files`, `include`および`exclude`はベースとなる設定ファイルの内容を_上書き_します。 | ||
また、継承における循環参照は許容されません。 | ||
|
||
##### 例 | ||
|
||
`configs/base.json`: | ||
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
"noImplicitAny": true, | ||
"strictNullChecks": true | ||
} | ||
} | ||
``` | ||
|
||
`tsconfig.json`: | ||
|
||
```json | ||
{ | ||
"extends": "./configs/base", | ||
"files": ["main.ts", "supplemental.ts"] | ||
} | ||
``` | ||
|
||
`tsconfig.nostrictnull.json`: | ||
|
||
```json | ||
{ | ||
"extends": "./tsconfig", | ||
"compilerOptions": { | ||
"strictNullChecks": false | ||
} | ||
} | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
display: "Files" | ||
oneline: "Include a set list of files, does not support globs" | ||
--- | ||
|
||
プログラムに含めるファイルの許可リストを指定します。ファイルが見つからない場合、エラーが発生します。 | ||
|
||
```json | ||
{ | ||
"compilerOptions": {}, | ||
"files": [ | ||
"core.ts", | ||
"sys.ts", | ||
"types.ts", | ||
"scanner.ts", | ||
"parser.ts", | ||
"utilities.ts", | ||
"binder.ts", | ||
"checker.ts", | ||
"tsc.ts" | ||
] | ||
} | ||
``` | ||
|
||
このオプションは、プロジェクトが少数のファイルから構成されていて、グロブパターンを必要としない場合で有用です。 | ||
グロブパターンが必要な場合、[`include`](#include)を利用してください。 |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
display: "Include" | ||
oneline: "Files or patterns to include in this project" | ||
--- | ||
|
||
プログラムに含めるファイル名またはパターンのリストを指定します。 | ||
ファイル名は`tsconfig.json`ファイルを含んでいるディレクトリからの相対パスとして解決されます。 | ||
|
||
```json | ||
{ | ||
"include": ["src/**", "tests/**"] | ||
} | ||
``` | ||
|
||
この設定は以下のようにマッチします。 | ||
|
||
<!-- TODO: #135 | ||
```diff | ||
. | ||
- ├── scripts | ||
- │ ├── lint.ts | ||
- │ ├── update_deps.ts | ||
- │ └── utils.ts | ||
+ ├── src | ||
+ │ ├── client | ||
+ │ │ ├── index.ts | ||
+ │ │ └── utils.ts | ||
+ │ ├── server | ||
+ │ │ └── index.ts | ||
+ ├── tests | ||
+ │ ├── app.test.ts | ||
+ │ ├── utils.ts | ||
+ │ └── tests.d.ts | ||
- ├── package.json | ||
- ├── tsconfig.json | ||
- └── yarn.lock | ||
``` --> | ||
|
||
``` | ||
. | ||
├── scripts ⨯ | ||
│ ├── lint.ts ⨯ | ||
│ ├── update_deps.ts ⨯ | ||
│ └── utils.ts ⨯ | ||
├── src ✓ | ||
│ ├── client ✓ | ||
│ │ ├── index.ts ✓ | ||
│ │ └── utils.ts ✓ | ||
│ ├── server ✓ | ||
│ │ └── index.ts ✓ | ||
├── tests ✓ | ||
│ ├── app.test.ts ✓ | ||
│ ├── utils.ts ✓ | ||
│ └── tests.d.ts ✓ | ||
├── package.json | ||
├── tsconfig.json | ||
└── yarn.lock | ||
``` | ||
|
||
`include`と`exclude`はグロブパターンのためのワイルドカードをサポートしています: | ||
|
||
- `*` ゼロ個以上の文字列にマッチ(ディレクトリセパレータは除く) | ||
- `?` 任意の1文字にマッチ(ディレクトリセパレータは除く) | ||
- `**/` 任意階層の任意ディレクトリにマッチ | ||
|
||
グロブパターンがファイルの拡張子を含まない場合、サポートされる拡張子のみが含まれるようになります(例:`.ts`, `.tsx`と`.d.ts`はデフォルトでインクルードされ、`.js`と`.jsx`は`allowJs`が設定された場合のみインクルードされます)。 |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
display: "References" | ||
oneline: "Provide a structure for composite projects" | ||
--- | ||
|
||
プロジェクト参照はTypeScriptのプログラムを小さい断片に分けて構造化するための手法です。 | ||
プロジェクト参照を用いると、ビルド時間やエディターとのインタラクションに必要な時間が大幅に改善され、コンポーネント間の論理分割が強制により、より洗練された方法でコードを整理できます。 | ||
|
||
プロジェクト参照がどのように動作するかについては、このハンドブックの[Project References](/docs/handbook/project-references.html)を読んでください。 |
37 changes: 37 additions & 0 deletions
37
packages/tsconfig-reference/copy/ja/options/typeAcquisition.md
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
display: "Type Acquisition" | ||
oneline: "Sets of options for Automatic Type Acquisition in JavaScript" | ||
--- | ||
|
||
エディターにJavaScriptプロジェクトが存在する場合、TypeScriptは`@types`で定義されるDefinitelyTypedから提供されるファイルを用いて、`node_modules`のための型ファイルを自動で提供します。 | ||
これは自動型取得と呼ばれており、また設定の`typeAcquisition`を使ってカスタマイズできます。 | ||
|
||
この機能を無効化したりカスタマイズする場合、プロジェクトのルートに`jsconfig.json`ファイルを作成してください: | ||
|
||
```json | ||
{ | ||
"typeAcquisition": { | ||
"enable": false | ||
} | ||
} | ||
``` | ||
|
||
プロジェクトに含めるべき特定のモジュールがある場合(それが`node_modules`には存在しない場合): | ||
|
||
```json | ||
{ | ||
"typeAcquisition": { | ||
"include": ["jest"] | ||
} | ||
} | ||
``` | ||
|
||
モジュールが自動で取得されるべきでない場合。例えば、そのライブラリが`node_modules`に含まれてはいるが、チームでこのライブラリを利用しないことを合意している場合: | ||
|
||
```json | ||
{ | ||
"typeAcquisition": { | ||
"exclude": ["jquery"] | ||
} | ||
} | ||
``` |