Guide
Install
shell
npm i svg-eslint-parser -D
shell
yarn add svg-eslint-parser -D
shell
pnpm add svg-eslint-parser -D
Usage
ESLint
ts
import pluginSVG from 'eslint-plugin-svg'
import * as parserSVG from 'svg-eslint-parser'
/**
* @type {import('eslint').Linter.Config[]}
*/
export default [
// other configs
{
name: 'svg/rules',
files: ['**/*.svg'],
plugins: {
svg: pluginSVG,
},
languageOptions: {
parser: parserSVG,
},
rules: {
// enable rules of eslint-plugin-svg
'svg/no-empty-title': 'error',
},
},
]