Skip to content

Commit f4c7de0

Browse files
authored
docs(cn): translate src/content/plugins/stylelint-webpack-plugin.md #969
docs(cn): translate src/content/plugins/stylelint-webpack-plugin.md
2 parents 1536973 + 397b724 commit f4c7de0

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

src/content/plugins/stylelint-webpack-plugin.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ repo: https://github.com/webpack-contrib/stylelint-webpack-plugin
1616

1717

1818

19-
> A Stylelint plugin for webpack
19+
> 一个为 webpack 提供的 Stylelint 插件
2020
21-
## Install {#install}
21+
## 安装 {#install}
2222

2323
```bash
2424
npm install stylelint-webpack-plugin --save-dev
2525
```
2626

27-
**Note**: You also need to install `stylelint` from npm, if you haven't already:
27+
**注意**:如果你还没有安装 `stylelint`,请先用 npm 进行安装:
2828

2929
```bash
3030
npm install stylelint --save-dev
3131
```
3232

33-
## Usage {#usage}
33+
## 用法 {#usage}
3434

35-
In your webpack configuration:
35+
在你的 webpack 配置中:
3636

3737
```js
3838
const StylelintPlugin = require('stylelint-webpack-plugin');
@@ -44,100 +44,100 @@ module.exports = {
4444
};
4545
```
4646

47-
## Options {#options}
47+
## 选项 {#options}
4848

49-
See [stylelint's options](http://stylelint.io/user-guide/node-api/#options) for the complete list of options available. These options are passed through to the `stylelint` directly.
49+
有关可用选项的完整列表请参阅 [styleint 的选项](http://stylelint.io/user-guide/node-api/#options),这些选项直接传递给 `stylelint`
5050

5151
### `configFile` {#configfile}
5252

53-
- Type: `String`
54-
- Default: `undefined`
53+
- 类型:`String`
54+
- 默认值:`undefined`
5555

56-
Specify the config file location to be used by `stylelint`.
56+
指定 `stylelint` 配置文件的位置。
5757

58-
**Note:** By default this is [handled by `stylelint`](http://stylelint.io/user-guide/configuration/).
58+
**注意:** 默认情况下由 [`stylelint` 处理](http://stylelint.io/user-guide/configuration/)
5959

6060
### `context` {#context}
6161

62-
- Type: `String`
63-
- Default: `compiler.context`
62+
- 类型:`String`
63+
- 默认值:`compiler.context`
6464

65-
A string indicating the root of your files.
65+
指定文件根目录的字符串。
6666

6767
### `files` {#files}
6868

69-
- Type: `String|Array[String]`
70-
- Default: `'**/*.(s(c|a)ss|css)'`
69+
- 类型:`String|Array[String]`
70+
- 默认值:`'**/*.(s(c|a)ss|css)'`
7171

72-
Specify the glob pattern for finding files. Must be relative to `options.context`.
72+
指定查找文件的全局模式。必须相对于 `options.context`
7373

7474
### `fix` {#fix}
7575

76-
- Type: `Boolean`
77-
- Default: `false`
76+
- 类型:`Boolean`
77+
- 默认值:`false`
7878

79-
If `true`, `stylelint` will fix as many errors as possible. The fixes are made to the actual source files. All unfixed errors will be reported. See [Autofixing errors](https://stylelint.io/user-guide/cli#autofixing-errors) docs.
79+
如果值为 `true``stylelint` 将修复尽可能多的 error。修复真实的源文件。报告所有未修复的 errors。请参阅 [自动修复错误](https://stylelint.io/user-guide/cli#autofixing-errors) 文档。
8080

8181
### `formatter` {#formatter}
8282

83-
- Type: `String|Function`
84-
- Default: `'string'`
83+
- 类型:`String|Function`
84+
- 默认值:`'string'`
8585

86-
Specify the formatter that you would like to use to format your results. See [formatter option](https://stylelint.io/user-guide/node-api#formatter).
86+
指定要用于格式化结果的 formatter。请参阅 [formatter 选项](https://stylelint.io/user-guide/node-api#formatter)
8787

8888
### `lintDirtyModulesOnly` {#lintdirtymodulesonly}
8989

90-
- Type: `Boolean`
91-
- Default: `false`
90+
- 类型:`Boolean`
91+
- 默认值:`false`
9292

93-
Lint only changed files, skip lint on start.
93+
仅检查有变化的文件,启动时跳过检查。
9494

9595
### `stylelintPath` {#stylelintpath}
9696

97-
- Type: `String`
98-
- Default: `stylelint`
97+
- 类型:`String`
98+
- 默认值:`stylelint`
9999

100-
Path to `stylelint` instance that will be used for linting.
100+
将要用来做检查的 `stylelint` 实例的路径。
101101

102-
### Errors and Warning {#errors-and-warning}
102+
### Errors Warning {#errors-and-warning}
103103

104-
**By default the plugin will auto adjust error reporting depending on stylelint errors/warnings counts.**
105-
You can still force this behavior by using `emitError` **or** `emitWarning` options:
104+
**默认情况下,插件将根据 stylelint 错误/警告数量自动调整错误报告。**
105+
你仍然可以使用 `emitError` **** `emitWarning` 选项来强制改变这种默认行为。
106106

107107
#### `emitError` {#emiterror}
108108

109-
- Type: `Boolean`
110-
- Default: `false`
109+
- 类型:`Boolean`
110+
- 默认值:`false`
111111

112-
Will always return errors, if set to `true`.
112+
如果设置为 `true`,将总是返回 errors。
113113

114114
#### `emitWarning` {#emitwarning}
115115

116-
- Type: `Boolean`
117-
- Default: `false`
116+
- 类型:`Boolean`
117+
- 默认值:`false`
118118

119-
Will always return warnings, if set to `true`.
119+
如果设置为 `true`,将总是返回 warnings。
120120

121121
#### `failOnError` {#failonerror}
122122

123-
- Type: `Boolean`
124-
- Default: `false`
123+
- 类型:`Boolean`
124+
- 默认值:`false`
125125

126-
Will cause the module build to fail if there are any errors, if set to `true`.
126+
如果设置为 `true`,出现任何 errors 都将会导致模块构建失败。
127127

128128
#### `failOnWarning` {#failonwarning}
129129

130-
- Type: `Boolean`
131-
- Default: `false`
130+
- 类型:`Boolean`
131+
- 默认值:`false`
132132

133-
Will cause the module build to fail if there are any warnings, if set to `true`.
133+
如果设置为 `true`,出现任何 warnings 都将会导致模块构建失败。
134134

135135
#### `quiet` {#quiet}
136136

137-
- Type: `Boolean`
138-
- Default: `false`
137+
- 类型:`Boolean`
138+
- 默认值:`false`
139139

140-
Will process and report errors only and ignore warnings, if set to `true`.
140+
如果设置为 `true`,则仅处理和报告 errors,并忽略 warnings
141141

142142
## Changelog {#changelog}
143143

0 commit comments

Comments
 (0)