Skip to content

Commit

Permalink
feat: update eslint-plugin-vue
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Feb 7, 2022
1 parent 76d84b0 commit 1c6235a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint-plugin-react": ">=7.27.0",
"eslint-plugin-react-hooks": ">=3.0.0",
"eslint-plugin-unicorn": ">=40.0.0",
"eslint-plugin-vue": ">=8.1.1",
"eslint-plugin-vue": ">=8.4.1",
"eslint-plugin-vue-scoped-css": ">=2.0.0"
},
"peerDependenciesMeta": {
Expand Down
6 changes: 6 additions & 0 deletions vue/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ module.exports = {
'vue/no-useless-mustaches': 'warn',
// 自动去除不必要的 v-bind 绑定
'vue/no-useless-v-bind': 'warn',
// 禁止在组件上声明 v-text 和 v-html
'vue/no-v-text-v-html-on-component': 'error',
// 自动在单文件组件的根元素之间加入换行
'vue/padding-line-between-blocks': 'warn',
// 必须为 emits 声明校验函数
Expand Down Expand Up @@ -150,8 +152,12 @@ module.exports = {
'vue/object-curly-newline': config.rules['object-curly-newline'],
// 自动为对象字面量、解构和导入的花括号内侧添加空格
'vue/object-curly-spacing': config.rules['object-curly-spacing'],
// 自动优化对象字面量的值为简写
'vue/object-shorthand': config.rules['object-shorthand'],
// 自动优化行尾操作符至下一行行首
'vue/operator-linebreak': config.rules['operator-linebreak'],
// 自动删除不必要的对象字面量键的引号
'vue/quote-props': config.rules['quote-props'],
// 自动删除括号内侧的空格
'vue/space-in-parens': config.rules['space-in-parens'],
// 自动在多元操作符前后添加空格
Expand Down

0 comments on commit 1c6235a

Please sign in to comment.