vue/no-extra-parens
eslint-plugin-vue
Safe autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-extra-parens": "error",
},
},
]; <div :class="(foo + bar)" />
{{ (foo + bar) }}
{{ (foo + bar) | filter }}
</template><div :class="foo + bar" />
{{ foo + bar }}
{{ foo + bar | filter }}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-extra-parens
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-extra-parens": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow the <template> <script> <style> block to be empty
Disallow object, array, and function literals in template
Disallow duplication of class names in class attributes
Disallow a potential typo in your component property
Enforce inheritAttrs to be set to false when using v-bind="$attrs"