Skip to content

Commit

Permalink
docs: update default value of lintOnSave option (#5563) [ci skip]
Browse files Browse the repository at this point in the history
closes #5100
  • Loading branch information
codeDebugTest authored Jun 10, 2020
1 parent dcfb0bd commit 893611d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Deprecated since Vue CLI 3.3, please use [`publicPath`](#publicPath) instead.
### lintOnSave

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

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.

Expand Down
2 changes: 1 addition & 1 deletion docs/ru/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = {
### lintOnSave

- Тип: `boolean | 'warning' | 'default' | 'error'`
- По умолчанию: `true`
- По умолчанию: 'default'

Выполнять ли линтинг кода при сохранении во время разработки с помощью [eslint-loader](https://github.com/webpack-contrib/eslint-loader). Эта опция действует только когда установлен плагин [`@vue/cli-plugin-eslint`](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint).

Expand Down
6 changes: 4 additions & 2 deletions docs/zh/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ module.exports = {
### lintOnSave

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

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

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

设置为 `error` 将会使得 `eslint-loader` 把 lint 警告也输出为编译错误,这意味着 lint 警告将会导致编译失败。

或者,你也可以通过设置让浏览器 overlay 同时显示警告和错误:

Expand Down

0 comments on commit 893611d

Please sign in to comment.