Closed dddssw closed 5 months ago
This rule seems to mainly enforce the declaration order of the Optional API.
When using the setup
Composition API, there isn't a strict requirement for the order of declaration for watch
and computed
.
@waynzh The property I set is also invalid under the setup syntax sugar Maybe this isn't supported?
You could use the playground to provide a reproduction of this issue.
@waynzh yes,this is a example example
These two rules did not take effect
Both vue/order-in-components
and vue/new-line-between-multi-line-property
only target components using the Option API, not <script setup>
.
For vue/order-in-components
, the request to also apply it for components using the Composition API was rejected, see https://github.com/vuejs/eslint-plugin-vue/issues/2055#issuecomment-1480909340. Also note that the style guide rule you linked does not mention whether it applies to Options API or Composition API.
For vue/new-line-between-multi-line-property
, I also don't think it makes sense to extend it to components using the Composition API. It is quite specific to adding new lines between object properties. In <script setup>
or in the setup()
function, there are no "blocks" that can be separated by an ESLint rule. So I agree that the style guide rule should be followed manually while writing the code, but it can't be enforced by ESLint if you are using the Composition API.
So I'll close this as won't fix.
It is best to mark it in the document to avoid others having the same problem
PRs to improve the docs are always welcome :slightly_smiling_face:
Tell us about your environment
According to the style guide, watch should be placed after computed, but there is no eslint prompt
But I see that it is in the default rules, I don't know what went wrong
However, the attribute on the component has a prompt