From 1ba44241c6e61bd4e7df8d09622e30fde4dc62c3 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Fri, 3 Jan 2020 21:46:51 +0800 Subject: [PATCH] feat: don't throw on console/debugger statements for `vue serve` 1. they're useful in development 2. to be in line with the default preset --- packages/@vue/cli-service-global/lib/globalConfigPlugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/@vue/cli-service-global/lib/globalConfigPlugin.js b/packages/@vue/cli-service-global/lib/globalConfigPlugin.js index fa82581ae2..ddda032955 100644 --- a/packages/@vue/cli-service-global/lib/globalConfigPlugin.js +++ b/packages/@vue/cli-service-global/lib/globalConfigPlugin.js @@ -112,6 +112,10 @@ module.exports = function createConfigPlugin (context, entry, asLib) { ], parserOptions: { parser: 'babel-eslint' + }, + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': `process.env.NODE_ENV === 'production' ? 'error' : 'off'` } } }))