-
-
Notifications
You must be signed in to change notification settings - Fork 699
Closed
Labels
Description
Please describe what the rule should do:
This rule detect inline styles in components.
It's (subjectively) a good practice to separate styles from the view layout, when possible. This rule detects static inline style objects when they contain literal values. v-bind:style and :style are acceptable because it's sometimes necessary to set styles based on data, computed property or methods result.
What category should the rule belong to?
- Enforces code style
- Warns about a potential error
- Suggests an alternate way of doing something
- Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
The following pattern is considered a warning:
<span style="background-color: #FFF">Hello {{ name }}</span>;The following patterns are not considered a warning::
<span :style="background-color: color }">Hello {{ name }}</span>;
<span v-bind:style="background-color: color }">Hello {{ name }}</span>;Additional context
The rule enforce team members to use SFC <style scope> instead of inline style attributes.
armano2, ota-meshi, razorfever, arcil and carlfranz