Skip to content

Commit

Permalink
Update vue/require-name-property rule to support <script setup> (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jul 6, 2021
1 parent 1447444 commit e5f0258
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/require-name-property.js
Expand Up @@ -32,6 +32,9 @@ module.exports = {
},
/** @param {RuleContext} context */
create(context) {
if (utils.isScriptSetup(context)) {
return {}
}
return utils.executeOnVue(context, (component, type) => {
if (type === 'definition') {
const defType = getVueComponentDefinitionType(component)
Expand Down
13 changes: 13 additions & 0 deletions tests/lib/rules/require-name-property.js
Expand Up @@ -51,6 +51,19 @@ ruleTester.run('require-name-property', rule, {
})
`,
parserOptions
},
{
filename: 'test.vue',
code: `
<script>
export default {
}
</script>
<script setup>
</script>
`,
parser: require.resolve('vue-eslint-parser'),
parserOptions
}
],

Expand Down

0 comments on commit e5f0258

Please sign in to comment.