From b81310252ff58f7fe52c97a47c069d0fe0cd55bc Mon Sep 17 00:00:00 2001 From: shuxiaokai <2581105856@qq.com> Date: Fri, 5 Feb 2021 18:00:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0eslint=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 10 ++++++++++ babel.config.js | 6 ++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2ac2debf..e78bae60 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,5 +33,15 @@ module.exports = { "no-param-reassign": ["error", { props: false }], //函数参数非对象情况不允许直接改变 "linebreak-style": ["off", "windows"], "spaced-comment": "off", //注释不做限制 + "prefer-destructuring": ["error", { //申明变量解构有限,赋值可以不必解构 + "VariableDeclarator": { + "array": false, + "object": true + }, + "AssignmentExpression": { + "array": false, + "object": true + } + }] }, }; diff --git a/babel.config.js b/babel.config.js index e9558405..6431b568 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,3 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] -} + presets: ["@vue/cli-plugin-babel/preset"], +};