vue/no-static-inline-styles
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-static-inline-styles": "error",
},
},
]; <div style="color: pink;"></div>
<div :style="{ color: 'pink' }"></div>
<div :style="[{ color: 'pink' }, { 'font-size': '85%' }]"></div>
<div :style="{ backgroundImage, color: 'pink' }"></div>
</template> <div style="transform: scale(0.5);"></div>
</template><div :style="styleObject"></div>
<div :style="{ backgroundImage: 'url(' + img + ')' }"></div><div :style="{ transform: 'scale(0.5)' }"></div>
<div :style="[{ transform: 'scale(0.5)' }, { 'user-select': 'none' }]"></div>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vue/no-static-inline-styles
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-static-inline-styles": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow unsupported Vue.js syntax on the specified version