I have this error reported by the linter
on the call to _.isEqual
:
Do you know how I can correct this error?
const liste = computed(() => { return _.uniqWith(_.map(liste.value, 'contrat'), _.isEqual) })
There are some options:
As _.isEqual
does not use this
inside its body you may safely ignore this rule in this particular case:
/* eslint-disable-next-line @typescript-eslint/unbound-method */
const liste = computed(() => { return _.uniqWith(_.map(liste.value, 'contrat'), _.isEqual) })
You may use wrapping function to preserve calling context:
const liste = computed(() => { return _.uniqWith(_.map(liste.value, 'contrat'), (a, b) => _.isEqual(a, b)) })
Explicitly bind calling context. Kind of ugly but does the job:
const liste = computed(() => { return _.uniqWith(_.map(liste.value, 'contrat'), _.isEqual.bind(_)) })