Skip to content

Add svglint and svgo to lint SVGs #633

Open

Description

Problem

The SVGs in the project are inconsistent and sometimes unformatted.

Description

Since the project contains a lot of SVG icons it might be a good idea to enforce

  • fixed viewBox values
  • list of mandatory attributes (like height, width and SVG xmlns)
  • fixed valid group IDs (such as icon)
  • fixed rules for fill (such as fill being set only on the top-level g and having currentColor as the only value)

https://www.npmjs.com/package/svglint and https://github.com/svg/svgo are two tools that could be used for achieving consistency and optimisation in our SVGs.

Additional context

Simple Icons have a very comprehensive SVG linting solution for inspiration.

Configuration file is here:

https://github.com/simple-icons/simple-icons/blob/develop/svglint.config.mjs

Implementation

  • 🙋 I would be interested in implementing this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status

      📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions