我想使用vue的风格指南,或许可以借助eslint #11070
Unanswered
dddssw
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我想使用这个风格https://cn.vuejs.org/style-guide/rules-recommended.html#component-instance-options-order
使用的eslint插件是这个https://eslint.vuejs.org/rules/order-in-components.html
我的eslint文件内容:
`
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'plugin:vue/recommended',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
parserOptions: {
ecmaVersion: 'latest'
},
rules: {
'vue/new-line-between-multi-line-property': [
'error',
{
minLineOfMultilineProperty: 2
}
]
}
}
`


但是很可惜这不起作用,风格指南上computed应该放在watch前面
但对应组件上的属性顺序确实是生效了给了提示
如果有人知道如何处理,十分感谢🙏
Beta Was this translation helpful? Give feedback.
All reactions