pageClass | sidebarDepth | title | description |
---|---|---|---|
rule-details |
0 |
vue/enforce-style-attribute |
enforce either the `scoped` or `module` attribute in SFC top level style tags |
enfore either the
scoped
ormodule
attribute in SFC top level style tags
- ❗ This rule has not been released yet.
{
"vue/attribute-hyphenation": ["error", "either" | "scoped" | "module"]
}
This rule warns you about top level style tags that are missing either the scoped
or module
attribute.
"either"
(default) ... Warn if a style tag doesn't have neitherscoped
normodule
attributes."scoped"
... Warn if a style tag doesn't have thescoped
attribute."module"
... Warn if a style tag doesn't have themodule
attribute.
<!-- ✓ GOOD -->
<style scoped></style>
<style lang="scss" src="../path/to/style.scss" scoped></style>
<!-- ✓ GOOD -->
<style module></style>
<!-- ✗ BAD -->
<style></style>
<!-- ✓ GOOD -->
<style scoped></style>
<style lang="scss" src="../path/to/style.scss" scoped></style>
<!-- ✗ BAD -->
<style></style>
<style module></style>
<!-- ✓ GOOD -->
<style module></style>
<!-- ✗ BAD -->
<style></style>
<style scoped></style>
<style lang="scss" src="../path/to/style.scss" scoped></style>