The `typescript-svelte-plugin` provides enhanced TypeScript and JavaScript language intelligence when working with Svelte components. Specifically, it enables features like Rename, Find Usages, Go To Definition, and Diagnostics within `.ts` and `.js` files that interact with or import Svelte components. This plugin operates as a TypeScript language service plugin, extending the capabilities of the TypeScript compiler. It is part of the broader Svelte Language Tools monorepo and currently stands at version 0.3.51. The project sees active development with frequent patch releases, often co-released with `svelte2tsx`, `svelte-language-server`, and `svelte-check`, reflecting continuous improvements and bug fixes. It differentiates itself by focusing on the TypeScript/JavaScript-to-Svelte interaction, complementing the `svelte-language-server` which handles intellisense *within* Svelte files themselves.
npm install typescript-svelte-pluginVerified import paths — ran on the pinned version, not inferred.
This `tsconfig.json` configuration enables the `typescript-svelte-plugin` for Svelte projects, providing enhanced intellisense in TypeScript/JavaScript files.
Always save your Svelte component files after making changes to ensure the TypeScript language service processes the latest state.
Ensure you have the Svelte for VS Code extension (or an equivalent language server setup) installed alongside this plugin for full Svelte intellisense capabilities.
Add an entry for `typescript-svelte-plugin` within the `plugins` array under `compilerOptions` in your `tsconfig.json` or `jsconfig.json`.
Verify that `typescript-svelte-plugin` is listed in the `plugins` array within your `tsconfig.json` and that your Svelte component file has been saved.
Check for errors in your Svelte component's script tag (e.g., `export let someProp`). Ensure the component file is saved and that `svelte2tsx` (a core dependency) is correctly installed and up-to-date.