eslint
eslint copied to clipboard
Error: with `@nuxt/eslint-config` eslint marks composables as "undefined" when used inside another composable
When using @nuxt/eslint-config, eslint uncorrectly marks composables as undefined when they are used inside another composable.
According to how Nuxt works, composables are auto-imported (and they work when executed), so eslint should not report this error.
A simple test composable that uses internal functions is
export const useComposable = () => {
const myConst = ref('hello');
onMounted(() => {
console.log(myConst.value);
});
};
And it is available in this minimal demo https://stackblitz.com/edit/github-nxygas?file=package.json,.eslintrc.cjs
(please note that you have to CTRL + C and run npm run lint to see the errors)
Same issue for me
Still having this issue. Did anyone find a workaround?