Skip to content

Commit

Permalink
add rules
Browse files Browse the repository at this point in the history
  • Loading branch information
czb3279338858 committed Oct 31, 2022
1 parent b4b7e6a commit 1c0bd96
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/lib/rules/require-prop-comment.js
Expand Up @@ -79,6 +79,20 @@ tester.run('require-prop-comment', rule, {
})
</script>
`
},
{
code: `
<script setup lang="ts">
type PropType = {
/** JSDoc comment */
a: number
}
const props = defineProps<PropType>()
</script>
`,
parserOptions: {
parser: require.resolve('@typescript-eslint/parser')
}
}
],
invalid: [
Expand Down Expand Up @@ -230,6 +244,26 @@ tester.run('require-prop-comment', rule, {
message: 'The "a" property should have a JSDoc comment.'
}
]
},
{
code: `
<script setup lang="ts">
type PropType = {
a: number
}
const props = defineProps<PropType>()
</script>
`,
errors: [
{
line: 4,
column: 9,
message: 'The "a" property should have a JSDoc comment.'
}
],
parserOptions: {
parser: require.resolve('@typescript-eslint/parser')
}
}
]
})

0 comments on commit 1c0bd96

Please sign in to comment.