docs: improve lintOnSave docs [ci skip]

This commit is contained in:
Evan You
2018-08-10 09:31:20 -04:00
parent 492e567602
commit d3a2a96bf3
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -133,9 +133,13 @@ module.exports = {
- Type: `boolean` | `'error'`
- Default: `true`
::: tip
如果你想要让 lint 错误在开发时直接显示在浏览器中,将这个选项设置为 `'error'`。
:::
是否在开发环境下通过 [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) 被安装之后生效。
设置为 `true` 时,eslint-loader 在 webpack 的编译过程中会触发警告,以避免中断开发流程。如果你希望换做触发错误 (例如在为生成环境构建时),可以这样设置:`lintOnSave: 'error'`
设置为 `true` 时,eslint-loader 在 webpack 的编译过程中会触发输出到控制台的警告,以避免中断开发流程。如果设置为 `'error'`,则 lint 错误会在开发时直接显示在浏览器中。另外构建时如果存在 lint 错误会导致构建失败
### runtimeCompiler