Skip to content

Commit d3a2a96

Browse files
committed
docs: improve lintOnSave docs [ci skip]
1 parent 492e567 commit d3a2a96

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/config/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,13 @@ module.exports = {
135135
- Type: `boolean | 'error'`
136136
- Default: `true`
137137

138+
::: tip
139+
If you want lint errors to show up in the browser overlay, set this to `'error'`.
140+
:::
141+
138142
Whether to perform lint-on-save during development using [eslint-loader](https://github.com/webpack-contrib/eslint-loader). This value is respected only when [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) is installed.
139143

140-
When set to `true`, eslint-loader will only emit warnings during webpack's compilation process in order not to break the flow during development. If you want it to emit errors instead (i.e. when building for production), set it like this: `lintOnSave: 'error'`.
144+
When set to `true`, eslint-loader will emit warnings (which only get logged to the terminal to avoid interrupting development). If you want it to emit errors instead, set it to `'error'`. This will make lint errors show up in the in-browser dev overlay and will make your build fail on lint errors.
141145

142146
### runtimeCompiler
143147

docs/zh/config/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,13 @@ module.exports = {
133133
- Type: `boolean` | `'error'`
134134
- Default: `true`
135135

136+
::: tip
137+
如果你想要让 lint 错误在开发时直接显示在浏览器中,将这个选项设置为 `'error'`
138+
:::
139+
136140
是否在开发环境下通过 [eslint-loader](https://github.com/webpack-contrib/eslint-loader) 在每次保存时 lint 代码。这个值会在 [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint) 被安装之后生效。
137141

138-
设置为 `true` 时,eslint-loader 在 webpack 的编译过程中只会触发警告,以避免中断开发流程。如果你希望换做触发错误 (例如在为生成环境构建时),可以这样设置:`lintOnSave: 'error'`
142+
设置为 `true` 时,eslint-loader 在 webpack 的编译过程中会触发输出到控制台的警告,以避免中断开发流程。如果设置为 `'error'`,则 lint 错误会在开发时直接显示在浏览器中。另外构建时如果存在 lint 错误会导致构建失败
139143

140144
### runtimeCompiler
141145

0 commit comments

Comments
 (0)