Closed
Description
Please describe what the rule should do:
No unused computed properties or data.
What category of rule is this? (place an "X" next to just one item)
[X] 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 will warn about:
<template>
<h1>{{ used }}</h1>
</template>
<script>
export default {
data(){
return {
unused: 0, //error
used: 'Hello World!'
}
}
}
</script>
<template>
<h1>{{ used }}</h1>
</template>
<script>
export default {
computed: {
used() {
return 'Hello World';
},
unUsed() { //error
return 'Unused';
}
}
</script>
Why should this rule be included in ESLint (instead of a plugin)?
Unused computed properties and data makes Vue components difficult to read.