vue/no-unused-vars
eslint-plugin-vue
SuggestionRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-unused-vars": "error",
},
},
];Disallow unused variable definitions of v-for directives or scope attributes
<ol v-for="i in 5">
<li>item</li>
</ol>
</template><ol v-for="i in 5">
<li>{{ i }}</li>
</ol>Examples from the ESLint documentation.
vue/no-unused-vars
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-unused-vars": "error",
},
},
];Oxlint does not have this rule.
correctness/noUnusedVariables
correctness · since 1.0.0
{
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "error"
}
}
}
}Unused local variables and functions should be removed
Disallow the use of reserved names in component definitions
Enforce component's data property to be a function