eslint-plugin-svelte
- Purpose: Official ESLint plugin for Svelte that provides custom linting rules by leveraging the AST generated by
svelte-eslint-parser
. - Target Audience: Developers working with Svelte who want to enforce code quality, security, and best practices.
- Key Features:
- Supports Svelte-specific linting rules (e.g., reactive statements, event handlers, DOM manipulation).
- Includes configurations for recommended rules, Prettier compatibility, and all available rules.
- Provides security-focused rules to prevent XSS attacks and unsafe practices.
- Offers stylistic rules for consistent code formatting.
- Supports TypeScript projects with additional setup.
- Notable Rules:
- Security:
no-at-html-tags
(XSS prevention),no-target-blank
(safe links). - Best Practices:
require-store-reactive-access
,no-reactive-literals
. - Styling:
indent
,mustache-spacing
,html-self-closing
.
- Security:
- Editor Integration: Works with VS Code via the ESLint extension.
- Documentation: Detailed rule explanations and migration guides available on the official site .
- Community: Join discussions on Svelte Discord .
eslint-pluginsveltejssvelteeslint
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button