Official ESLint plugin for Svelte, providing linting rules and best practices for Svelte components.
eslint-plugin-svelte is the official ESLint plugin for the Svelte framework. It enables developers to enforce code quality, security, and best practices specifically within Svelte components by leveraging the AST generated by svelte-eslint-parser. This tool is essential for maintaining consistent and error-free Svelte codebases.
Svelte developers and teams building applications with Svelte or SvelteKit who need to lint their component code. It is particularly useful for projects requiring adherence to Svelte-specific best practices and security guidelines.
Developers choose this plugin because it is the authoritative, official linting solution for Svelte, offering over 70 framework-aware rules that cover possible errors, security vulnerabilities, best practices, and stylistic issues. It integrates seamlessly with the modern ESLint ecosystem, supports TypeScript, and provides ready-to-use configurations like 'recommended' and 'prettier'.
ESLint plugin for Svelte using AST
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As the official ESLint plugin maintained by the Svelte team, it seamlessly integrates with the framework's compiler and ecosystem, ensuring authoritative support.
Offers over 70 Svelte-specific rules covering errors, security vulnerabilities like XSS from {@html}, best practices, and stylistic issues, as listed in the README's rule table.
Fully supports TypeScript with dedicated configuration and provides a 'prettier' config to avoid conflicts, though it requires additional setup for TypeScript projects.
Includes many fixable rules that can automatically correct issues like indentation or attribute formatting using ESLint's --fix option, improving developer workflow.
The README warns of a TypeScript parser singleton issue that can cause errors if options are changed, complicating configuration for advanced TypeScript projects.
New rules can be added to recommended configs in minor releases per the versioning policy, potentially introducing unexpected warnings that require manual disabling.
Relies on svelte-eslint-parser for AST generation, adding a layer of dependency that can introduce points of failure or compatibility issues in the linting pipeline.