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

autofix for vue/no-empty-component-block

Open RedBlueKoi opened this issue 1 year ago • 4 comments

What rule do you want to change?

  • Rule to change is vue/no-empty-component-block

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

  • This change would not change the amount of errors/warnings

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

  • Preferably default behaviour

Please provide some example code that this change will affect:

<script setup lang="ts">
  defineProps<{...}>()
</script>

<template>
  <h1>My awesome title</h1>
</template>

<style scoped lang="postcss"></style>

What does the rule currently do for this code?

  • Currently the rule marks the style tag as an error, but you would have to remove it manually

What will the rule do after it's changed?

  • After change eslint will be able to remove the style tag with pnpm eslint --fix

Additional context

RedBlueKoi avatar Sep 20 '24 11:09 RedBlueKoi

PRs welcome!

FloEdelmann avatar Sep 20 '24 12:09 FloEdelmann

@FloEdelmann got you, let me see if I can pull it off

RedBlueKoi avatar Sep 20 '24 15:09 RedBlueKoi

PRs welcome!

Do you maybe have an example that I can reference?

RedBlueKoi avatar Sep 20 '24 15:09 RedBlueKoi

Nice! I think vue/block-order might have a similar autofix. Please also add test cases.

FloEdelmann avatar Sep 20 '24 16:09 FloEdelmann