Skip to content

i18n: tsconfig-reference top-level options to zh #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TomVista
Copy link

No description provided.

@ghost
Copy link

ghost commented Aug 25, 2022

CLA assistant check
All CLA requirements met.

@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @Kingwl - if they write a comment saying "LGTM" then it will be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2022

Translation of include.md

display: "Include"

oneline: "The path to the file to be compiled or the list of matchers."

Indicates the file name or file matcher that the program contains.
They are relative tsconfig.json The directory where it resolves.

{
  "include": ["src/**/*", "tests/**/*"]
}

Included files:

.
├── 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 and exclude Matchers supported by the matcher:

  • * Matches zero or more characters (no directory splitter included)
  • ? Matches any one character (does not contain a directory splitter)
  • **/ Matches directories of any depth

If the matcher does not contain file extensions only, files with specific extensions are supported. Supported by default .ts.tsxand .d.ts, if on allowJs, additional support .js and .jsx

Translation of files.md

display: "Files"

oneline: "An array, each of which is the path to the included files required for the project. and include The difference is that files does not support path matching. "

Clearly indicate the files that the project needs to include. If no files that can be included can be found, an error is reported.

{
  "compilerOptions": {},
  "files": [
    "core.ts",
    "sys.ts",
    "types.ts",
    "scanner.ts",
    "parser.ts",
    "utilities.ts",
    "binder.ts",
    "checker.ts",
    "tsc.ts"
  ]
}

This configuration is useful when the number of files is small and there is no need to reference some global files.
It can also be used include Enable more configuration capabilities.

Translation of extends.md

display: "Extends"

oneline: "Specify a path or node module reference to configure inheritance"

extends The value of the configuration file is the path to which you want to inherit.
The path can be either POSIX style (Linux MacOS) or Windows style (in the path \ needs to be escaped).

Configurations in TSConfig override inherited configurations. Relative path calculations are based on the profile in which they reside and are not affected by inheritance.

Note: filesinclude and exclude Inherited configurations are overwritten, and configuration files do not allow circular inheritance.

references is the only top-level configuration item that is not inherited.

Example

configs/base.json:

{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true
  }
}

tsconfig.json:

{
  "extends": "./configs/base",
  "files": ["main.ts", "supplemental.ts"]
}

tsconfig.nostrictnull.json:

{
  "extends": "./tsconfig",
  "compilerOptions": {
    "strictNullChecks": false
  }
}

A configuration item that can be configured with a relative path, and the relative path calculation is based on the configuration file in which the configuration item is located, and is not affected by inheritance.

Translation of exclude.md

display: "Exclude"

oneline: "Filter include Options. "

In parsing include option, you need to skip the file name or file matcher list.

Important: exclude just change include The options include the file.
exclude The specified file may still be part of your code due to being import Introduced into your code, or been types Contained, or used /// <reference Introduced, or included files Middle.

It is not one deter The mechanism by which files are included in the codebase - it just changes include What the configuration item looks for.

Translation of intro.md

Header: Introduction to TSConfig

FirstLine: The TSConfig file symbolizes that the directory in which it is located is the root directory of a TypeScript project or JavaScript project...

The TSConfig file symbolizes that the directory in which it resides is the root of a TypeScript project or JavaScript project.
TSConfig files can be tsconfig.json or jsconfig.json, they are configured the same.

This page covers all the different options available in the TSConfig file. At the same time, it is not built according to the linear narrative, but is divided into 5 main parts:

If you are starting TSConfig from scratch, consider using it tsc --init or TSConfig base to configure.

Generated by 🚫 dangerJS against c3aa684

TSConfig 文件象征着,它所在的目录是一个 TypeScript 项目或者 JavaScript 项目的根目录。
TSConfig 文件可以是 `tsconfig.json` 或 `jsconfig.json`,它们的配置相同。

此页涵盖了 TSConfig 文件中可用的所有不同选项。同时没有按照线性叙述来构建,而是分为了5个主要部分:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
此页涵盖了 TSConfig 文件中可用的所有不同选项。同时没有按照线性叙述来构建,而是分为了5个主要部分:
此页涵盖了 TSConfig 文件中可用的所有不同选项。同时没有按照线性叙述来构建,而是分为了 5 个主要部分:


此页涵盖了 TSConfig 文件中可用的所有不同选项。本页从每个选项的概述开始,到 JSON 文件的根属性,然后是`compilerOptions`(大部分选项),最后是 `watchOptions`。
TSConfig 文件象征着,它所在的目录是一个 TypeScript 项目或者 JavaScript 项目的根目录。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TSConfig 文件象征着,它所在的目录是一个 TypeScript 项目或者 JavaScript 项目的根目录。
TSConfig 文件所在的目录是一个 TypeScript 项目或者 JavaScript 项目的根目录。

在解析 [`include`](#include) 选项时,需要跳过的文件名称或文件匹配器的列表。

**Important**: `exclude` _仅仅_ 改变 [`include`](#include) 选项包含的文件。
`exclude` 指定的文件可能仍然是你代码的一部分,由于 被 `import` 引入到你的代码中,或者被 `types` 包含,或者使用 `/// <reference` 引入,或者包含在 [`files`](#files) 中。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`exclude` 指定的文件可能仍然是你代码的一部分,由于 被 `import` 引入到你的代码中,或者被 `types` 包含,或者使用 `/// <reference` 引入,或者包含在 [`files`](#files) 中。
`exclude` 指定的文件可能仍然是你代码的一部分,由于被 `import` 引入到你的代码中,或者被 `types` 包含,或者使用 `/// <reference` 引入,或者包含在 [`files`](#files) 中。

**Important**: `exclude` _仅仅_ 改变 [`include`](#include) 选项包含的文件。
`exclude` 指定的文件可能仍然是你代码的一部分,由于 被 `import` 引入到你的代码中,或者被 `types` 包含,或者使用 `/// <reference` 引入,或者包含在 [`files`](#files) 中。

它不是一种 **阻止** 文件被包含在代码库中的机制-它只是改变 [`include`](#include) 配置项查找的内容。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
它不是一种 **阻止** 文件被包含在代码库中的机制-它只是改变 [`include`](#include) 配置项查找的内容。
它不是一种 **阻止** 文件被包含在代码库中的机制——它只是改变 [`include`](#include) 配置项查找的内容。

---

`extends` 的值是要继承的配置文件的路径。
路径可以使用 POSIX 风格(Linux MacOS) 或者 Windows 风格(路径中的 `\` 需要转义)。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
路径可以使用 POSIX 风格(Linux MacOS) 或者 Windows 风格(路径中的 `\` 需要转义)
路径可以使用 POSIX 风格Linux MacOS或者 Windows 风格路径中的 `\` 需要转义

`extends` 的值是要继承的配置文件的路径。
路径可以使用 POSIX 风格(Linux MacOS) 或者 Windows 风格(路径中的 `\` 需要转义)。

TSConfig 中的配置会覆盖继承的配置。 相对路径计算是以其所在配置文件为基准,不受继承影响。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TSConfig 中的配置会覆盖继承的配置。 相对路径计算是以其所在配置文件为基准,不受继承影响。
TSConfig 中的配置会覆盖继承的配置。相对路径计算是以其所在配置文件为基准,不受继承影响。


TSConfig 中的配置会覆盖继承的配置。 相对路径计算是以其所在配置文件为基准,不受继承影响。

注意: [`files`](#files),[`include`](#include) 和 `exclude` 会覆盖继承的配置,配置文件不允许循环继承。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
注意: [`files`](#files)[`include`](#include)`exclude` 会覆盖继承的配置,配置文件不允许循环继承。
注意: [`files`](#files)[`include`](#include)`exclude` 会覆盖继承的配置,配置文件不允许循环继承。


[`references`](#references) 是唯一不被继承的顶级配置项。

##### Example

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
##### Example
##### 示例

@@ -0,0 +1,26 @@
---
display: "Files"
oneline: "一个数组,每一项是项目所需包含文件的路径。和 [`include`](#include) 不同的是, files 不支持路径匹配。"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
oneline: "一个数组,每一项是项目所需包含文件的路径。和 [`include`](#include) 不同的是, files 不支持路径匹配。"
oneline: "一个数组,每一项是项目所需包含文件的路径。和 [`include`](#include) 不同的是,files 不支持路径匹配。"

- `?` 匹配任何一个字符 (不包含目录分割符)
- `**/` 匹配任何深度的目录

如果匹配器不包含文件拓展名只,支持特定拓展名的文件。默认支持 `.ts`, `.tsx`和 `.d.ts`,如果开启了 [`allowJs`](#allowJs),额外支持 `.js` 和 `.jsx`。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果匹配器不包含文件拓展名只,支持特定拓展名的文件。默认支持 `.ts``.tsx``.d.ts`,如果开启了 [`allowJs`](#allowJs),额外支持 `.js``.jsx`
如果匹配器不包含文件拓展名只,支持特定拓展名的文件。默认支持 `.ts``.tsx` `.d.ts`,如果开启了 [`allowJs`](#allowJs),额外支持 `.js``.jsx`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants