Skip to content

Commit 6fdb024

Browse files
authored
Update vue/no-unregistered-components rule to support <script setup> (#1553)
1 parent c8d284b commit 6fdb024

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: lib/rules/no-unregistered-components.js

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ module.exports = {
6161
},
6262
/** @param {RuleContext} context */
6363
create(context) {
64+
if (utils.isScriptSetup(context)) {
65+
return {}
66+
}
6467
const options = context.options[0] || {}
6568
/** @type {string[]} */
6669
const ignorePatterns = options.ignorePatterns || []

Diff for: tests/lib/rules/no-unregistered-components.js

+11
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,17 @@ tester.run('no-unregistered-components', rule, {
490490
}
491491
</script>
492492
`
493+
},
494+
{
495+
filename: 'test.vue',
496+
code: `
497+
<template>
498+
<TheModal />
499+
</template>
500+
501+
<script setup>
502+
import TheModal from 'foo'
503+
</script>`
493504
}
494505
],
495506
invalid: [

0 commit comments

Comments
 (0)