eslint-plugin-vue
eslint-plugin-vue copied to clipboard
`vue/new-line-between-multi-line-property`: { onlyComponentOptions: true }
What rule do you want to change? vue/new-line-between-multi-line-property
Does this change cause the rule to produce more or fewer warnings? fewer
How will the change be implemented? (New option, new default behavior, etc.)?
onlyComponentOptions option (default: false)
Please provide some example code that this change will affect:
export default {
name: 'ComponentName',
props: {
foo: String,
bar: Number, // no error if onlyComponentOptions is true
},
created() {
// ...
},
methods: {
baz() {
// ...
},
qux() { // no error if onlyComponentOptions is true
// ...
},
},
}
What does the rule currently do for this code?
If the rule is on, an error is displayed for adjacent props & methods:
Enforce new lines between multi-line properties in Vue components.
What will the rule do after it's changed?
If onlyComponentOptions is set to true, props & method properties will be ignored.
Thank you for proposing an option.
I think the style provide by that option is good. However, there may be users who want to exclude only props in the future. I think it would be better to extends the options a little more, but what do you think?
@ota-meshi I think it's a good idea to make it fully configurable.
I wish there was an option to disable it for return statements only