Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1836 #1844

Merged
merged 2 commits into from Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rules/multi-word-component-names.js
Expand Up @@ -60,7 +60,7 @@ module.exports = {
ignores.add(casing.kebabCase(ignore))
}
}
let hasVue = false
let hasVue = utils.isScriptSetup(context)
let hasName = false

/**
Expand Down
24 changes: 24 additions & 0 deletions tests/lib/rules/multi-word-component-names.js
Expand Up @@ -202,6 +202,17 @@ tester.run('multi-word-component-names', rule, {
},
}).$mount('#app')
`
},
{
filename: 'MultiWord.vue',
code: `
<template>
<AppButton />
</template>

<script setup lang="ts">
import AppButton from "@/components/AppButton.vue";
</script>`
}
],
invalid: [
Expand Down Expand Up @@ -309,6 +320,19 @@ tester.run('multi-word-component-names', rule, {
line: 4
}
]
},
{
filename: 'test.vue',
code: `
<script setup lang="ts">
import Item from "@/components/Item.vue";
</script>`,
errors: [
{
message: 'Component name "test" should always be multi-word.',
line: 1
}
]
}
]
})