Skip to content

declares globals and exports in .d.ts file not recognized #1172

@KraXen72

Description

@KraXen72

sveltekit projects have a app.d.ts file. i use it like this:

declare global {
	interface NavLink {
		type: 'nav',
		title: string,
		href: string,
	}
	interface SubmenuSeparator {
		type: 'separator'
	}
}
// ...
export {};

However, the global types are not recognized and show:
image

tsconfig:

{
   "extends": "./.svelte-kit/tsconfig.json",
   "compilerOptions": {
   	"allowJs": true,
   	"checkJs": true,
   	"esModuleInterop": true,
   	"forceConsistentCasingInFileNames": true,
   	"resolveJsonModule": true,
   	"skipLibCheck": true,
   	"sourceMap": true,
   	"strict": true,
   	"target": "es2021"
   }
   // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
   //
   // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
   // from the referenced tsconfig.json - TypeScript does not merge them in
}

the "./.svelte-kit/tsconfig.json" is auto-generated / changes a lot, better to check a bare sveltekit starter project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    false positiveSevere bug: quick-lint-js rejects valid code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions