Appearance
vue/padding-lines-in-component-definition
要求或禁止组件定义中的填充行
- 🔧 command line 上的
--fix
选项可以自动修复此规则报告的一些问题。
📖 规则详情
此规则要求或禁止在组件定义中出现空行。适当的空行有助于开发者提高代码的可读性和代码样式灵活性。
¥This rule requires or disallows blank lines in the component definition. Properly blank lines help developers improve code readability and code style flexibility.
🔧选项
¥🔧 Options
json
{
"vue/padding-lines-in-component-definition": ["error", {
"betweenOptions": "always" | "never",
"withinOption": {
"props": {
"betweenItems": "always" | "never" | "ignore",
"withinEach": "always" | "never" | "ignore",
} | "always" | "never" | "ignore", // shortcut to set both
"data": {
"betweenItems": "always" | "never" | "ignore",
"withinEach": "always" | "never" | "ignore",
} | "always" | "never" | "ignore" // shortcut to set both
// ... all options
} | "always" | "never" | "ignore",
"groupSingleLineProperties": true | false
}]
}
betweenOptions
...设置选项之间的填充行。默认always
¥
betweenOptions
... Setting padding lines between options. defaultalways
withinOption
...设置选项内的填充行¥
withinOption
... Setting padding lines within optionemits
...设置emits
和defineEmits
之间行之间的填充。默认always
¥
emits
... Setting padding between lines betweenemits
anddefineEmits
. defaultalways
props
...设置props
和defineProps
之间行之间的填充。默认always
¥
props
... Setting padding between lines betweenprops
anddefineProps
. defaultalways
...
groupSingleLineProperties
...设置多个连续单行属性的分组(例如name
、inheritAttrs
),默认true
¥
groupSingleLineProperties
... Setting groupings of multiple consecutive single-line properties (e.g.name
,inheritAttrs
), defaulttrue
分组单行属性
¥Group single-line properties
使用自定义选项
¥With custom options
🚀版本
¥🚀 Version
此规则在 eslint-plugin-vue v9.9.0 中引入
¥This rule was introduced in eslint-plugin-vue v9.9.0
🔍代码实现
¥🔍 Implementation