eslint-plugin-svg
v0.0.6
Published
Rules for consistent, readable and valid SVG files.
Readme
eslint-plugin-svg
Rules for consistent, readable and valid SVG files.
[!CAUTION] Status: Work In Progress. Not ready for use.
Install
npm install eslint-plugin-svg -Dyarn add eslint-plugin-svg -Dpnpm add eslint-plugin-svg -DUsage
Config in ESLint config files:
import { defineConfig } from 'eslint/config'
import pluginSVG from 'eslint-plugin-svg'
export default defineConfig([
// Other configs...
...pluginSVG.configs.recommended,
]):apple: For advanced usaged, please check Advanced Usage
Rules
💼 Configurations enabled in.
✅ Set in the recommended preset.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
| Name | Description | 💼 | 🔧 | 💡 | | :--------------------------------------------------------------------------------- | :--------------------------------------- | :-: | :-: | :-: | | no-empty-title | Disallow empty title element | ✅ | | | | no-empty-desc | Disallow empty desc element | ✅ | | | | no-empty-text | Disallow empty text element | ✅ | | | | no-empty-container | Disallow empty container element | ✅ | | | | no-empty-groups | Disallow empty g element | ✅ | | | | no-base64-data-url | Disallow base64 data URLs in attributes | | | | | no-inline-styles | Disallow inline style attribute | ✅ | | | | no-event-handlers | Disallow inline event handlers | ✅ | | | | no-script-tags | Disallow script elements | ✅ | | | | require-viewbox | Require viewBox on svg elements | ✅ | | | | no-deprecated | Disallow deprecated elements | ✅ | | | | no-doctype | Disallow doctype | ✅ | 🔧 | | | no-duplicate-ids | Disallow duplicate id attributes | ✅ | | | | no-elements | Disallow elements by name | | | | | no-comments | Disallow comments in SVG files | | | | | no-invalid-role | Disallow invalid value of role attribute | ✅ | | |
