Skip to content

Commit

Permalink
Update vue/no-unregistered-components rule to support `<script setu…
Browse files Browse the repository at this point in the history
…p>` (#1553)
  • Loading branch information
ota-meshi committed Jul 6, 2021
1 parent c8d284b commit 6fdb024
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/no-unregistered-components.js
Expand Up @@ -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 || []
Expand Down
11 changes: 11 additions & 0 deletions tests/lib/rules/no-unregistered-components.js
Expand Up @@ -490,6 +490,17 @@ tester.run('no-unregistered-components', rule, {
}
</script>
`
},
{
filename: 'test.vue',
code: `
<template>
<TheModal />
</template>
<script setup>
import TheModal from 'foo'
</script>`
}
],
invalid: [
Expand Down

0 comments on commit 6fdb024

Please sign in to comment.