Skip to content

Commit

Permalink
docs: improve example to better clarify rule (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Sep 20, 2022
1 parent fdb67d1 commit 467e85f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/rules/define-emits-declaration.md
Expand Up @@ -25,6 +25,12 @@ const emit = defineEmits<{
(e: 'update', value: string): void
}>()
/* ✗ BAD */
const emit = defineEmits({
change: (id) => typeof id == 'number',
update: (value) => typeof value == 'string'
})
/* ✗ BAD */
const emit = defineEmits(['change', 'update'])
</script>
Expand Down Expand Up @@ -53,6 +59,12 @@ const emit = defineEmits<{
(e: 'update', value: string): void
}>()
/* ✓ GOOD */
const emit = defineEmits({
change: (id) => typeof id == 'number',
update: (value) => typeof value == 'string'
})
/* ✓ GOOD */
const emit = defineEmits(['change', 'update'])
</script>
Expand Down

0 comments on commit 467e85f

Please sign in to comment.