Skip to content

Commit e5f0258

Browse files
authored
Update vue/require-name-property rule to support <script setup> (#1558)
1 parent 1447444 commit e5f0258

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: lib/rules/require-name-property.js

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ module.exports = {
3232
},
3333
/** @param {RuleContext} context */
3434
create(context) {
35+
if (utils.isScriptSetup(context)) {
36+
return {}
37+
}
3538
return utils.executeOnVue(context, (component, type) => {
3639
if (type === 'definition') {
3740
const defType = getVueComponentDefinitionType(component)

Diff for: tests/lib/rules/require-name-property.js

+13
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ ruleTester.run('require-name-property', rule, {
5151
})
5252
`,
5353
parserOptions
54+
},
55+
{
56+
filename: 'test.vue',
57+
code: `
58+
<script>
59+
export default {
60+
}
61+
</script>
62+
<script setup>
63+
</script>
64+
`,
65+
parser: require.resolve('vue-eslint-parser'),
66+
parserOptions
5467
}
5568
],
5669

0 commit comments

Comments
 (0)