Skip to content

Commit 383c6e9

Browse files
committed
新增 英文 validate-stylelint.md
1 parent 29ee062 commit 383c6e9

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed
Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1-
### 简介
1+
# validate-stylelint
22

3-
validate-stylelint, 用于校验css、less、scss的exex语法。
3+
## Introduction
44

5-
此插件,需要到[插件市场](https://ext.dcloud.net.cn/plugin?name=validate-stylelint)安装。
5+
validate-stylelint, used to verify the syntax of `css`, `less`, `scss`.
66

7-
### 配置文件
7+
This plugin needs to be installed at [HBuilderX Plugin Market](https://ext.dcloud.net.cn/plugin?name=validate-stylelint).
88

9-
菜单【设置】-> 【插件配置】-> 【stylelint】,点击`.stylelintrc.js`, 即可打开配置文件。
9+
## Configuration file
10+
11+
Menu [Settings] -> [Plugin Configuration] -> [stylelint], click on `.stylelintrc.js` to open the configuration file.
1012

1113
<img src="/static/snapshots/tutorial/stylelint.png" />
1214

13-
## 规则配置格式
15+
## Rule configuration
16+
17+
There are hundreds of rules in stylelint, which can be divided into three categories:
18+
19+
- `Rules for proofreading style` (mainly for spaces (such as spaces near colons), line breaks, indentation, etc.)
20+
- `Rules for judging the maintainability of the cod`e (judging whether a certain ID is used in the CSS selector, or whether the !important keyword is applied in a statement)
21+
- `Rules for judging code errors` (check whether the wrong HEX color writing or whether a certain abbreviated attribute will cover other declaration statements)
1422

15-
stylelint有上百条规则,可以分为三类:
16-
- 用于校对风格的规则 (主要针对空格(比如说冒号附近的空格)、换行、缩进等等)
17-
- 用于判别代码可维护性的规则 (判断在CSS选择器中是否有使用某个ID,或者在某条声明当中是否应用了!important关键词)
18-
- 用于判断代码错误的规则 (检测错误的HEX颜色写法或者某条简写属性是否会覆盖其他的声明语句)
23+
The rule attribute is an object, the key is the name of the rule, and the value is the rule configuration. Each rule configuration conforms to one of the following formats:
1924

20-
规则属性是一个对象,键是规则的名称,值是规则配置。每个规则配置符合下列格式之一:
21-
- 单个值(primary option)
22-
- 一个有两个值的数组([primary option,secondary option]
23-
- null (关闭规则)
25+
- `Single value` (primary option)
26+
- `An array with two values` ([primary option,secondary option])
27+
- `null` (close rule)
2428

25-
## 增加规则
29+
## Add rules
2630

27-
修改.stylelintrc.js文件,添加选项,比如:
31+
Modify the `.stylelintrc.js` file and add options:
2832

2933
```javascript
3034

3135
module.exports = {
3236
"extends": "stylelint-config-recommended",
3337
"rules":{
3438
"unit-no-unknown": false,
35-
"indentation": "tab", //缩进
36-
"unit-no-unknown": true, //禁止未知单位
39+
"indentation": "tab",
40+
"unit-no-unknown": true,
3741
"color-hex-case": [
3842
"lower", {
3943
"message": "Lowercase letters are easier to distinguish from numbers"
@@ -47,8 +51,6 @@ stylelint有上百条规则,可以分为三类:
4751

4852
```
4953

50-
## 更多配置规则
54+
## More configuration rules
5155

52-
详细的配置说明可以参考
53-
- [stylelint官网](https://stylelint.io/user-guide/rules/)
54-
- [GitHub styleline](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/rules.md)
56+
Detailed configuration instructions: [https://stylelint.io](https://stylelint.io/user-guide/rules/)

en/_sidebar.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
* [SVN Windows](/Tutorial/SourceControl/SVN/Windows.md)
2222
* [SVN MacOSX](/Tutorial/SourceControl/SVN/MacOSX.md)
2323
* Extension
24-
* [Formator Prettier](/Tutorial/extension/prettier.md)
2524
* [validate-html](/Tutorial/extension/validate-html.md)
25+
* [validate-stylelint](/Tutorial/extension/validate-stylelint.md)
26+
* [Formator Prettier](/Tutorial/extension/prettier.md)
2627
* Other
2728
* [Font Setting](/Tutorial/settings/font.md)
2829
* [Crash Reporter](/Tutorial/CrashReporter.md)

zh-cn/Tutorial/extension/validate-stylelint.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ validate-stylelint, 用于校验css、less、scss的exex语法。
1313
## 规则配置格式
1414

1515
stylelint有上百条规则,可以分为三类:
16-
- 用于校对风格的规则 (主要针对空格(比如说冒号附近的空格)、换行、缩进等等)
17-
- 用于判别代码可维护性的规则 (判断在CSS选择器中是否有使用某个ID,或者在某条声明当中是否应用了!important关键词)
18-
- 用于判断代码错误的规则 (检测错误的HEX颜色写法或者某条简写属性是否会覆盖其他的声明语句)
16+
- `用于校对风格的规则` (主要针对空格(比如说冒号附近的空格)、换行、缩进等等)
17+
- `用于判别代码可维护性的规则` (判断在CSS选择器中是否有使用某个ID,或者在某条声明当中是否应用了!important关键词)
18+
- `用于判断代码错误的规则` (检测错误的HEX颜色写法或者某条简写属性是否会覆盖其他的声明语句)
1919

2020
规则属性是一个对象,键是规则的名称,值是规则配置。每个规则配置符合下列格式之一:
2121
- 单个值(primary option)
@@ -24,7 +24,7 @@ stylelint有上百条规则,可以分为三类:
2424

2525
## 增加规则
2626

27-
修改.stylelintrc.js文件,添加选项,比如:
27+
修改`.stylelintrc.js`文件,添加选项,比如:
2828

2929
```javascript
3030

0 commit comments

Comments
 (0)