From 41cf5e10592a5a5e9c97e30cc6a20d078be15892 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 19 Mar 2020 16:41:43 +0800 Subject: [PATCH] feat: ease the default `no-console` severity to `warn` (#5241) As ESLint 6 removes this rule from the recommended config https://eslint.org/docs/user-guide/migrating-to-6.0.0#eslint-recommended-has-been-updated --- packages/@vue/cli-plugin-eslint/eslintOptions.js | 4 ++-- packages/@vue/cli-service-global/lib/globalConfigPlugin.js | 4 ++-- packages/@vue/cli-ui-addon-widgets/.eslintrc.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/@vue/cli-plugin-eslint/eslintOptions.js b/packages/@vue/cli-plugin-eslint/eslintOptions.js index 4f4c528ba1..b3bce290cc 100644 --- a/packages/@vue/cli-plugin-eslint/eslintOptions.js +++ b/packages/@vue/cli-plugin-eslint/eslintOptions.js @@ -7,8 +7,8 @@ exports.config = (api, preset) => { ecmaVersion: 2020 }, rules: { - 'no-console': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'error' : 'off'`), - 'no-debugger': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'error' : 'off'`) + 'no-console': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'warn' : 'off'`), + 'no-debugger': makeJSOnlyValue(`process.env.NODE_ENV === 'production' ? 'warn' : 'off'`) } } diff --git a/packages/@vue/cli-service-global/lib/globalConfigPlugin.js b/packages/@vue/cli-service-global/lib/globalConfigPlugin.js index a98bd7d075..2b15a8c480 100644 --- a/packages/@vue/cli-service-global/lib/globalConfigPlugin.js +++ b/packages/@vue/cli-service-global/lib/globalConfigPlugin.js @@ -114,8 +114,8 @@ module.exports = function createConfigPlugin (context, entry, asLib) { parser: 'babel-eslint' }, rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' } } })) diff --git a/packages/@vue/cli-ui-addon-widgets/.eslintrc.js b/packages/@vue/cli-ui-addon-widgets/.eslintrc.js index 114220552d..f48ff8123b 100644 --- a/packages/@vue/cli-ui-addon-widgets/.eslintrc.js +++ b/packages/@vue/cli-ui-addon-widgets/.eslintrc.js @@ -8,8 +8,8 @@ module.exports = { '@vue/standard' ], rules: { - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' }, parserOptions: { parser: 'babel-eslint'