Skip to content

Commit

Permalink
docs: update zh-cn translation in config lintOnSave section (#5031) […
Browse files Browse the repository at this point in the history
…ci skip]

* 修正lintOnSave的默认type类型

* 修正lint编译错误时新增warning类型

* 修正md内字符串需要引号

* trim line ending space
  • Loading branch information
mactanxin authored and sodatea committed Jan 9, 2020
1 parent 3b7227d commit f14b2da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/zh/config/README.md
Expand Up @@ -138,12 +138,12 @@ module.exports = {

### lintOnSave

- Type: `boolean` | `'error'`
- Type: `boolean` | `'warning'` | `'default'` | `'error'`
- Default: `true`

是否在开发环境下通过 [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` 会将 lint 错误输出为编译警告。默认情况下,警告仅仅会被输出到命令行,且不会使得编译失败。
设置为 `true` `'warning'` 时,`eslint-loader` 会将 lint 错误输出为编译警告。默认情况下,警告仅仅会被输出到命令行,且不会使得编译失败。

如果你希望让 lint 错误在开发时直接显示在浏览器中,你可以使用 `lintOnSave: 'error'`。这会强制 `eslint-loader` 将 lint 错误输出为编译错误,同时也意味着 lint 错误将会导致编译失败。

Expand Down

0 comments on commit f14b2da

Please sign in to comment.