A Vite plugin for checking Svelte files with Typescript support.
You can try this plugin directly in your browser using this StackBlitz example.
npm install vite-plugin-svelte-checker --save-dev
// vite.config.ts
import {defineConfig} from 'vite'
import {svelteChecker} from 'vite-plugin-svelte-checker'
export default defineConfig({
plugins: [
svelteChecker({
// configuration options
})
]
})
Below are the available configuration options for the plugin:
Option | Type | Default | Description |
---|---|---|---|
typescript | boolean, { tsConfigPath: string } |
true |
Enable TypeScript checking |
cli | boolean, { theme: BundledTheme, enabled: boolean } |
true |
Display CLI checker results settings |
overlay | boolean | true |
Display browser overlay settings |
ignoreWarnings | boolean | false |
Ignore warning-level diagnostics |
eslint (coming soon) | TBD | false |
Enable ESLint checking |
Creates a new instance of the Svelte checker plugin.
options
: Configuration object (optional)
import {defineConfig} from 'vite'
import {svelteChecker} from 'vite-plugin-svelte-checker'
export default defineConfig({
plugins: [
svelteChecker({
typescript: true,
ignoreWarnings: false
})
]
})
Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.