diff --git a/lib/rules/no-unregistered-components.js b/lib/rules/no-unregistered-components.js
index 58e2324c6..5cc22a9f8 100644
--- a/lib/rules/no-unregistered-components.js
+++ b/lib/rules/no-unregistered-components.js
@@ -61,6 +61,9 @@ module.exports = {
},
/** @param {RuleContext} context */
create(context) {
+ if (utils.isScriptSetup(context)) {
+ return {}
+ }
const options = context.options[0] || {}
/** @type {string[]} */
const ignorePatterns = options.ignorePatterns || []
diff --git a/tests/lib/rules/no-unregistered-components.js b/tests/lib/rules/no-unregistered-components.js
index 6a51bf494..f120cde81 100644
--- a/tests/lib/rules/no-unregistered-components.js
+++ b/tests/lib/rules/no-unregistered-components.js
@@ -490,6 +490,17 @@ tester.run('no-unregistered-components', rule, {
}
`
+ },
+ {
+ filename: 'test.vue',
+ code: `
+
+
+
+
+ `
}
],
invalid: [