Skip to content

Commit 1cbc939

Browse files
committed
新增 英文 prettier.md
1 parent 56149d2 commit 1cbc939

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

en/Tutorial/extension/prettier.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
# Formator-Prettier
22

3-
## 简介
3+
## Introduction
44

5-
此插件用于格式化less、sassvuestylus、ts、yaml代码
5+
This plugin is used to format `less`, `sass`, `vue`, `stylus`, `ts`, `yaml` code.
66

7-
此插件需要到[插件市场](https://ext.dcloud.net.cn/plugin?id=2025)下载
7+
This plugin needs to be downloaded from [HBuilderX Plugin Market](https://ext.dcloud.net.cn/plugin?id=2025)
88

9-
## 配置文件
9+
## Config File
1010

11-
点击菜单【工具】 -> 【设置】 -> 【插件配置】 -> prettier -> prettier.config.js,即可打开配置文件。
11+
Click the menu [Tools] -> [Settings] -> [Plugin Configuration] -> prettier -> prettier.config.js to open the configuration file.
1212

1313

14-
## 如何配置格式化选项?
14+
## Format options
1515

16-
格式化选项配置文件是prettier.config.js,里面对应的选项说明如下:
16+
The formatting options configuration file is `prettier.config.js`, and the corresponding options are described as follows:
1717

18-
- printWidth: 控制单行最大长度
19-
- semi: 控制每条语句是否加上分号
20-
- tabWidth: 控制一个tab对应的空格数
21-
- useTabs: 控制缩进用tab还是space
22-
- singleQuote:控制字符串是用单引号还是双引号
23-
- trailingComma: 是否去掉末尾的逗号
24-
- bracketSpacing: 控制json对象括号前后是否加上空格
18+
- printWidth: Specify the line length that the printer will wrap on.
19+
- semi: Print semicolons at the ends of statements. options: true|false.
20+
- tabWidth: Specify the number of spaces per indentation-level.
21+
- useTabs: Indent lines with tabs instead of spaces.
22+
- singleQuote:Use single quotes instead of double quotes.
23+
- trailingComma: Print trailing commas wherever possible in multi-line comma-separated syntactic structures. (A single-line array, for example, never gets trailing commas.)
24+
- bracketSpacing: Print spaces between brackets in object literals. options: true|false.
2525

26-
详细的配置说明可以参考[options](https://prettier.io/docs/en/options.html)
26+
Detailed configuration instructions can refer to [prettier options](https://prettier.io/docs/en/options.html)
2727

28-
## 如何支持新的语言
29-
1. 修改package.json配置,添加要支持的新的语言的文件后缀
28+
## How to support new languages
29+
1. Modify the package.json configuration and add the file suffix of the new language to be supported
3030
~~~
3131
"contributes": {
3232
"formator": {
@@ -39,12 +39,12 @@
3939
"vue",
4040
"ux",
4141
"ts",
42-
"foo"//文件后缀名
42+
"foo"//File extension name
4343
]
4444
}
4545
}
4646
~~~
47-
2. 修改prettier.config.js,将新添加的语言配置到对应的格式化处理器上。
47+
2. Modify prettier.config.js to configure the newly added language to the corresponding formatting processor.
4848
~~~
4949
parsers: {
5050
".jsx": "flow",
@@ -58,6 +58,6 @@ parsers: {
5858
}
5959
~~~
6060

61-
## 示例Gif
61+
## Example
6262

6363
<img src="/static/snapshots/tutorial/prettier.gif" style="zoom:80%; border: 1px solid #eee;" />

en/_sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* [Git MacOSX](/Tutorial/SourceControl/Git/MacOSX.md)
2121
* [SVN Windows](/Tutorial/SourceControl/SVN/Windows.md)
2222
* [SVN MacOSX](/Tutorial/SourceControl/SVN/MacOSX.md)
23+
* Extension
24+
* [Formator Prettier](/Tutorial/extension/prettier.md)
2325
* Other
2426
* [Font Setting](/Tutorial/settings/font.md)
2527
* [Crash Reporter](/Tutorial/CrashReporter.md)

0 commit comments

Comments
 (0)