@@ -16,23 +16,23 @@ repo: https://github.com/webpack-contrib/stylelint-webpack-plugin
16
16
17
17
18
18
19
- > A Stylelint plugin for webpack
19
+ > 一个为 webpack 提供的 Stylelint 插件
20
20
21
- ## Install {#install}
21
+ ## 安装 {#install}
22
22
23
23
``` bash
24
24
npm install stylelint-webpack-plugin --save-dev
25
25
```
26
26
27
- ** Note ** : You also need to install ` stylelint ` from npm, if you haven't already:
27
+ ** 注意 ** :如果你还没有安装 ` stylelint ` ,请先用 npm 进行安装:
28
28
29
29
``` bash
30
30
npm install stylelint --save-dev
31
31
```
32
32
33
- ## Usage {#usage}
33
+ ## 用法 {#usage}
34
34
35
- In your webpack configuration:
35
+ 在你的 webpack 配置中:
36
36
37
37
``` js
38
38
const StylelintPlugin = require (' stylelint-webpack-plugin' );
@@ -44,100 +44,100 @@ module.exports = {
44
44
};
45
45
```
46
46
47
- ## Options {#options}
47
+ ## 选项 {#options}
48
48
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 ` 。
50
50
51
51
### ` configFile ` {#configfile}
52
52
53
- - Type: ` String `
54
- - Default: ` undefined `
53
+ - 类型: ` String `
54
+ - 默认值: ` undefined `
55
55
56
- Specify the config file location to be used by ` stylelint ` .
56
+ 指定 ` stylelint ` 配置文件的位置。
57
57
58
- ** Note: ** By default this is [ handled by ` stylelint ` ] ( http://stylelint.io/user-guide/configuration/ ) .
58
+ ** 注意: ** 默认情况下由 [ ` stylelint ` 处理 ] ( http://stylelint.io/user-guide/configuration/ ) 。
59
59
60
60
### ` context ` {#context}
61
61
62
- - Type: ` String `
63
- - Default: ` compiler.context `
62
+ - 类型: ` String `
63
+ - 默认值: ` compiler.context `
64
64
65
- A string indicating the root of your files.
65
+ 指定文件根目录的字符串。
66
66
67
67
### ` files ` {#files}
68
68
69
- - Type: ` String|Array[String] `
70
- - Default: ` '**/*.(s(c|a)ss|css)' `
69
+ - 类型: ` String|Array[String] `
70
+ - 默认值: ` '**/*.(s(c|a)ss|css)' `
71
71
72
- Specify the glob pattern for finding files. Must be relative to ` options.context ` .
72
+ 指定查找文件的全局模式。必须相对于 ` options.context ` 。
73
73
74
74
### ` fix ` {#fix}
75
75
76
- - Type: ` Boolean `
77
- - Default: ` false `
76
+ - 类型: ` Boolean `
77
+ - 默认值: ` false `
78
78
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 ) 文档。
80
80
81
81
### ` formatter ` {#formatter}
82
82
83
- - Type: ` String|Function `
84
- - Default: ` 'string' `
83
+ - 类型: ` String|Function `
84
+ - 默认值: ` 'string' `
85
85
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 ) 。
87
87
88
88
### ` lintDirtyModulesOnly ` {#lintdirtymodulesonly}
89
89
90
- - Type: ` Boolean `
91
- - Default: ` false `
90
+ - 类型: ` Boolean `
91
+ - 默认值: ` false `
92
92
93
- Lint only changed files, skip lint on start.
93
+ 仅检查有变化的文件,启动时跳过检查。
94
94
95
95
### ` stylelintPath ` {#stylelintpath}
96
96
97
- - Type: ` String `
98
- - Default: ` stylelint `
97
+ - 类型: ` String `
98
+ - 默认值: ` stylelint `
99
99
100
- Path to ` stylelint ` instance that will be used for linting.
100
+ 将要用来做检查的 ` stylelint ` 实例的路径。
101
101
102
- ### Errors and Warning {#errors-and-warning}
102
+ ### Errors 和 Warning {#errors-and-warning}
103
103
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 ` 选项来强制改变这种默认行为。
106
106
107
107
#### ` emitError ` {#emiterror}
108
108
109
- - Type: ` Boolean `
110
- - Default: ` false `
109
+ - 类型: ` Boolean `
110
+ - 默认值: ` false `
111
111
112
- Will always return errors, if set to ` true ` .
112
+ 如果设置为 ` true ` ,将总是返回 errors。
113
113
114
114
#### ` emitWarning ` {#emitwarning}
115
115
116
- - Type: ` Boolean `
117
- - Default: ` false `
116
+ - 类型: ` Boolean `
117
+ - 默认值: ` false `
118
118
119
- Will always return warnings, if set to ` true ` .
119
+ 如果设置为 ` true ` ,将总是返回 warnings。
120
120
121
121
#### ` failOnError ` {#failonerror}
122
122
123
- - Type: ` Boolean `
124
- - Default: ` false `
123
+ - 类型: ` Boolean `
124
+ - 默认值: ` false `
125
125
126
- Will cause the module build to fail if there are any errors, if set to ` true ` .
126
+ 如果设置为 ` true ` ,出现任何 errors 都将会导致模块构建失败。
127
127
128
128
#### ` failOnWarning ` {#failonwarning}
129
129
130
- - Type: ` Boolean `
131
- - Default: ` false `
130
+ - 类型: ` Boolean `
131
+ - 默认值: ` false `
132
132
133
- Will cause the module build to fail if there are any warnings, if set to ` true ` .
133
+ 如果设置为 ` true ` ,出现任何 warnings 都将会导致模块构建失败。
134
134
135
135
#### ` quiet ` {#quiet}
136
136
137
- - Type: ` Boolean `
138
- - Default: ` false `
137
+ - 类型: ` Boolean `
138
+ - 默认值: ` false `
139
139
140
- Will process and report errors only and ignore warnings, if set to ` true ` .
140
+ 如果设置为 ` true ` ,则仅处理和报告 errors,并忽略 warnings。
141
141
142
142
## Changelog {#changelog}
143
143
0 commit comments