You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
<spanstyle="background-color: #FFF">Hello {{ name }}</span>;
The following patterns are not considered a warning::
<span :style="background-color: color }">Hello {{ name }}</span>;
<spanv-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.
The text was updated successfully, but these errors were encountered:
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?
Provide 2-3 code examples that this rule should warn about:
The following pattern is considered a warning:
The following patterns are not considered a warning::
Additional context
The rule enforce team members to use SFC
<style scope>
instead of inline style attributes.The text was updated successfully, but these errors were encountered: