Skip to content

Commit 1c0bd96

Browse files
committed
add rules
1 parent b4b7e6a commit 1c0bd96

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/lib/rules/require-prop-comment.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ tester.run('require-prop-comment', rule, {
7979
})
8080
</script>
8181
`
82+
},
83+
{
84+
code: `
85+
<script setup lang="ts">
86+
type PropType = {
87+
/** JSDoc comment */
88+
a: number
89+
}
90+
const props = defineProps<PropType>()
91+
</script>
92+
`,
93+
parserOptions: {
94+
parser: require.resolve('@typescript-eslint/parser')
95+
}
8296
}
8397
],
8498
invalid: [
@@ -230,6 +244,26 @@ tester.run('require-prop-comment', rule, {
230244
message: 'The "a" property should have a JSDoc comment.'
231245
}
232246
]
247+
},
248+
{
249+
code: `
250+
<script setup lang="ts">
251+
type PropType = {
252+
a: number
253+
}
254+
const props = defineProps<PropType>()
255+
</script>
256+
`,
257+
errors: [
258+
{
259+
line: 4,
260+
column: 9,
261+
message: 'The "a" property should have a JSDoc comment.'
262+
}
263+
],
264+
parserOptions: {
265+
parser: require.resolve('@typescript-eslint/parser')
266+
}
233267
}
234268
]
235269
})

0 commit comments

Comments
 (0)