I've created a Vue mixin with the following structure:
/* eslint-disable */
const amount = null;
const currency = '';
export default {
methods: {
formatPrice(amount, currency) {
this.amount = amount;
this.currency = currency;
const isInt = Number.isInteger(this.amountToPrice);
return isInt ? this.stripDecimalZeroes : this.localePrice;
}
}
}
In adding some local state variables to this file, I ran into an ESLint "no-shadow" error when removing my eslint-disable
.
How can I properly incorporate local state within this mixin without passing it around to every function? I believe that if the logic is contained within the mixin, this should not be required.
Furthermore, I'm confused by the no-shadow-error
since referencing my local state as this.state
seems to work fine.