mirror of
https://github.com/unraid/api.git
synced 2026-05-09 08:41:12 -05:00
fix: resolve no-undef lint errors for auto-imported composables in Vue files
Problem: ESLint was flagging auto-imported composables (like `useToast`) as undefined variables in `.vue` files. While TypeScript correctly identified these globals via `auto-imports.d.ts`, the default `no-undef` rule in our Vue ESLint config did not account for them, causing false positive linting errors. Solution: - Disable the `no-undef` rule specifically for `.vue` files in `eslint.config.mjs`. - Rely on TypeScript (via `vue-tsc`) and `auto-imports.d.ts` to handle global variable validation, ensuring type safety without conflicting with the auto-import build process. - Remove manual imports of `useToast` that were added as a workaround (p sure the path I used didn't even exist in node modules).
This commit is contained in:
@@ -144,6 +144,7 @@ export default [
|
||||
rules: {
|
||||
...commonRules,
|
||||
...vueRules,
|
||||
'no-undef': 'off', // Allow TypeScript to handle global variable validation (fixes auto-import false positives)
|
||||
},
|
||||
}, // Ignores
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { useMutation, useQuery, useSubscription } from '@vue/apollo-composable';
|
||||
import { useToast } from '@nuxt/ui/composables/useToast.js';
|
||||
|
||||
import type { FragmentType } from '~/composables/gql';
|
||||
import type {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useMutation, useQuery, useSubscription } from '@vue/apollo-composable';
|
||||
import { useToast } from '@nuxt/ui/composables/useToast.js';
|
||||
|
||||
import ConfirmDialog from '~/components/ConfirmDialog.vue';
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user