Git Product home page Git Product logo

Comments (6)

tcc-sejohnson avatar tcc-sejohnson commented on June 15, 2024 4

FYI, if you're willing to be a bit heavy-handed, you can disable this warning under the Svelte extension for VSCode:

image

This will at least suppress the warning and let you use the editor without red squigglies. @dummdidumm linked the other places you may have to suppress it.

from sveltekit-autoimport.

ohmree avatar ohmree commented on June 15, 2024 2

Isn't this by design? Nothing is informing the language service about the imports so it complains.

unplugin-vue-components solves this by generating a components.d.ts file that informs the language service about the components.

It looks like this:

// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399

declare module 'vue' {
  export interface GlobalComponents {
    Alert: typeof import('./components/Alert.vue')['default']
    Alerts: typeof import('./components/Alerts.vue')['default']
    Chart: typeof import('./components/Chart.vue')['default'];
    ChartExample: typeof import('./components/ChartExample.vue')['default']
    Donut: typeof import('./components/Donut.vue')['default'];
    FaSolidBolt: typeof import('~icons/fa-solid/bolt')['default']
    FaSolidCheckCircle: typeof import('~icons/fa-solid/check-circle')['default']
    FaSolidExclamationCircle: typeof import('~icons/fa-solid/exclamation-circle')['default']
    FaSolidInfoCircle: typeof import('~icons/fa-solid/info-circle')['default']
    FaSolidPlug: typeof import('~icons/fa-solid/plug')['default']
    FaSolidSlidersH: typeof import('~icons/fa-solid/sliders-h')['default']
    FaSolidTimesCircle: typeof import('~icons/fa-solid/times-circle')['default']
    Logo: typeof import('./components/Logo.vue')['default']
    LogView: typeof import('./components/LogView.vue')['default']
  }
}

export { }

from sveltekit-autoimport.

yuanchuan avatar yuanchuan commented on June 15, 2024

Are you using VSCode? It seems the warning message comes from one of its plugins

from sveltekit-autoimport.

stolinski avatar stolinski commented on June 15, 2024

@felixheidecke did you get this figured out? I'm still seeing this regardless of what I do in my d.ts file

from sveltekit-autoimport.

dummdidumm avatar dummdidumm commented on June 15, 2024

The d.ts file will silence errors by typescript that it cannot find the module. The mentioned warning here is from the Svelte compiler, which cannot be silenced like this. There currently isn't a way to silence a warning across svelte-check, the ide and Kit through a single setting, but they all have ways to silence this on their own (see options of the extension/svelte-check readme/vite-plugin-svelte readme)

from sveltekit-autoimport.

greendesertsnow avatar greendesertsnow commented on June 15, 2024

This sole issue is the only reason I avoid using this library.
You won't believe how many times I've been allured into using Nuxt 3 instead, just for this feature.

from sveltekit-autoimport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.