Skip to content

Commit

Permalink
feat: add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ItMaga committed Apr 3, 2024
1 parent 7018649 commit 34df4e6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/lib/rules/no-unused-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,16 @@ tester.run('no-unused-properties', rule, {
},

// props.prop in template
{
filename: 'test.vue',
code: `
<template>
{{props}}
</template>
<script setup>
const props = defineProps(['a', 'b', 'c'])
</script>`
},
{
filename: 'test.vue',
code: `
Expand Down Expand Up @@ -3957,6 +3967,22 @@ tester.run('no-unused-properties', rule, {
]
},

// a property used as a template $props member expression
{
filename: 'test.vue',
code: `
<template>
<div>{{ $props.foo }}</div>
</template>
<script>
export default {
props: ['foo', 'bar']
}
</script>
`,
errors: ["'bar' of property found, but never used."]
},

// props.prop in template
{
filename: 'test.vue',
Expand Down

0 comments on commit 34df4e6

Please sign in to comment.