eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

Lint/format svg files

Open some-user123 opened this issue 1 year ago • 3 comments

Clear and concise description of the problem

My project (nuxt + antfu eslint config) contains different file types, incl. svg files. Currently they are not linted/formattet.

Suggested solution

Apply stylistic rules to them as well...

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

some-user123 avatar Dec 18 '24 10:12 some-user123

we have xml support with prettier formatters which includes svgs. if you can find some sort of eslint plugin or language support for svgs/xmls that can be added natively.

i know there was a discussion about html support, but it didnt go anywhere. maybe circle back on that?

pauliesnug avatar Dec 23 '24 21:12 pauliesnug

I've created an ESLint plugin eslint-plugin-svgo which provides SVG optimize services based on SVGO. It supports all SVGO options and plugins. You can even create custom SVGO plugins and run with it.

I'm also working on eslint-plugin-svg, but it's not production ready for now.

ntnyq avatar Jan 07 '25 19:01 ntnyq

I believe this was implemented by now.

thasmo avatar Jul 18 '25 17:07 thasmo