# vue-scoped-css/enforce-style-type

enforce the <style> tags to be plain or have the scoped or module attribute

  • ⚙️ This rule is included in "plugin:vue-scoped-css/all".

# 📖 Rule Details

This rule reports invalid <style> tag types.

<template> </template> <!-- ✗ BAD --> <style> </style> <!-- ✓ GOOD --> <style scoped> </style>
Now loading...

# 🔧 Options

Default is set to { allows: ['scoped'] }.

{
  "vue-scoped-css/enforce-style-type": ["error", { allows: ['scoped'] }]
}
  • allows (default ['scoped']) ... allowed types of <style> tags. Possible values: plain, scoped, module

# allows: ['module']

Only allow CSS Modules.

<template> </template> <!-- ✓ GOOD --> <style module> </style> <style module="$s"> </style> <!-- ✗ BAD --> <style> </style> <style scoped> </style>
Now loading...

# allows: ['plain']

Only allow plain styles; no scoped or module attributes.

<template> </template> <!-- ✓ GOOD --> <style> </style> <!-- ✗ BAD --> <style scoped> </style> <style module> </style> <style module="$s"> </style>
Now loading...

# 📚 Further reading

# Implementation

Last Updated: 10/15/2021, 12:03:51 PM