💼recommended
, ✅ recommended-flat
. This rule warns in the following configs: 🌐 all
, 🌐 all-flat
.
❌ Examples of incorrect code for this rule:
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { doubleCount }
})
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
})
✅ Examples of correct code for this rule:
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const obj = reactive({ count })
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, obj }
})