We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Suppose I have a npm package named package. The package.json of package looks like:
package
{ "name": "package", "version": "1.0.0", "main": "index.js", "types": "./types/index.d.ts", "exports": { ".": { "default": "./index.js" }, "./Component": { "default": "./Component.svelte" } } }
The types directory in package looks like:
- index.d.ts - Component.d.ts
The content of Component.d.ts is:
Component.d.ts
/// <reference types="svelte" /> import { SvelteComponentTyped } from 'svelte'; export interface Props { /** * @default "svelte" */ prop?: string; } export default class Component extends SvelteComponentTyped<Props, {}, {}> {}
Now in my app where I have svelte with typescript with the content of the tsconfig.json as
tsconfig.json
{ "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { "moduleResolution": "node", "module": "es2020", "lib": ["es2020"], "target": "es2019", "importsNotUsedAsValues": "error", "isolatedModules": true, "resolveJsonModule": true, "sourceMap": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, "baseUrl": ".", "allowJs": true, "checkJs": true }, "include": ["src/**/*"] }
and my svelte.config.js is:
svelte.config.js
const sveltePreprocess = require('svelte-preprocess'); module.exports = { preprocess: sveltePreprocess(), };
And in my Svelte file I import package/Component:
package/Component
To Reproduce
pnpm i
cd app
src/Page.svelte
Expected behavior No ts error
Information about your project:
svelte-preprocess
The text was updated successfully, but these errors were encountered:
Hey I think this is a bug with language-tools and not svelte-preprocess, so transferring the issue.
Sorry, something went wrong.
sveltejs/language-tools#1021
No branches or pull requests
Describe the bug
Suppose I have a npm package named
package
. The package.json ofpackage
looks like:The types directory in
package
looks like:The content of
Component.d.ts
is:Now in my app where I have svelte with typescript with the content of the
tsconfig.json
asand my
svelte.config.js
is:And in my Svelte file I import
package/Component
:To Reproduce
pnpm i
cd app
src/Page.svelte
Expected behavior
No ts error
Information about your project:
svelte-preprocess
version 4.7.3The text was updated successfully, but these errors were encountered: