typescript-svelte-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.3.37 • Public • Published

A TypeScript plugin for Svelte intellisense

This plugin provides intellisense for interacting with Svelte files. It is in a very early stage, so expect bugs. So far the plugin supports

  • Rename
  • Find Usages
  • Go To Definition
  • Diagnostics

Note that these features are only available within TS/JS files. Intellisense within Svelte files is provided by the svelte-language-server.

Usage

The plugin comes packaged with the Svelte for VS Code extension. If you are using that one, you don't need to add it manually.

Adding it manually:

npm install --save-dev typescript-svelte-plugin

Then add it to your tsconfig.json or jsconfig.json:

{
    "compilerOptions": {
        ...
        "plugins": [{
            "name": "typescript-svelte-plugin",
            // the following options can be set additionally; they are optional; their default values are listed here
            "enabled": true, // enables this plugin
            "assumeIsSvelteProject": false // if true, skip detection and always assume it's a Svelte project
        }]
    }
}

Limitations

Changes to Svelte files are only recognized after they are saved to disk.

Credits

  • pushkine for his initial POC and the inspiration/discussion that stemmed from it

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.37
    3,647
    • latest

Version History

Package Sidebar

Install

npm i typescript-svelte-plugin

Weekly Downloads

5,484

Version

0.3.37

License

MIT

Unpacked Size

148 kB

Total Files

54

Last publish

Collaborators

  • dummdidumm
  • svelte-language-tools-deploy
  • orta