✅
ESLint Compatible
Produces AST compatible with ESLint's parser interface for seamless integration with ESLint rules and plugins.
An SVG parser that produces output compatible with ESLint
npm install svg-eslint-parser -Dimport { parseForESLint, findNodeByType, NodeTypes } from 'svg-eslint-parser'
const { ast } = parseForESLint('<svg><circle cx="50" /></svg>')
const tags = findNodeByType(ast.body[0], NodeTypes.Tag)
console.log(`Found ${tags.length} tags`)