Skip to content

svg-eslint-parser

An SVG parser that produces output compatible with ESLint

CINPM VERSIONNPM DOWNLOADSCODECOVLICENSE

Quick Start

bash
npm install svg-eslint-parser -D
typescript
import { 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`)

Resources