eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Add an option to `v-slot-style` to enforce even shorter syntax for default slot

Open andreww2012 opened this issue 2 weeks ago • 2 comments

What rule do you want to change?

v-slot-style

Does this change cause the rule to produce more or fewer warnings?

Depends

How will the change be implemented? (New option, new default behavior, etc.)?

Add a new style, say shortest, which would act the same as shorthand for non-default slots and additionally suggest using # instead of #default (see an example below).

Please provide some example code that this change will affect:

It is possible to use an even shorter syntax of v-slot with the default slot: simply # (without default word) (playground):

<Comp #="{foo}">...</Comp>

<Comp>
  <template #="{foo}">...</template>
</Comp>

What does the rule currently do for this code?

Currently, it seems like # attributes are ignored by this rule completely.

What will the rule do after it's changed?

# attributes will be recognized and reported if they don't satisfy the enforced style.

Additional context

andreww2012 avatar Nov 26 '25 18:11 andreww2012