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"], +};