Eric FennisandClaude Fable 5.2 bf07c9ced3 build(dev): replace @html-eslint with a custom SVG ESLint plugin (#5348)
* build(lint): replace @html-eslint with a custom SVG ESLint plugin

The HTML parser recovers from malformed markup and has no way to
disallow text nodes, so a stray `]` could be committed to an icon.

Add scripts/eslint/svgPlugin with its own strict XML parser and rules
tailored to the icon code conventions:

- no-text: disallow text nodes and CDATA sections
- allowed-elements: `<svg>` root containing only shape elements
- allowed-attrs: per-element attribute allowlist
- the existing checks (required svg attributes, fill/stroke values,
  duplicate attributes, indentation, spacing, newlines, quotes,
  self-closing tags, empty lines, trailing spaces)

Malformed files (unclosed or mismatched tags, unquoted attributes,
several roots) are now parsing errors.

Also add a `lint:svg:icons` script, include it in `lint:icons:all`, and
run the plugin's tests as part of `test:scripts`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhtVwYGj5HsHrYP3kq

* build(lint): run the SVG ESLint rules on staged icons

Prettier can't remove a stray text node or a disallowed element, so
lint staged icons with ESLint after formatting them. This stops such an
icon at commit time instead of in CI.

Also document `lint:svg:icons` in the icon code conventions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhtVwYGj5HsHrYP3kq

* refactor(lint): parse SVG icons with saxes and leave formatting to Prettier

The plugin's hand-written XML parser was large because it validated the
markup itself and tracked the position of every attribute, quote and
bracket for the formatting rules.

Parse with saxes instead, a strict XML parser that is already installed
through jsdom. The parser module now only turns its events into a tree
with positions. It yields the same tree as before for every icon.

Drop the eight formatting rules. A file that passes the Prettier check is
identical to Prettier's output, so they could never report anything on
it. ESLint now checks what an icon contains and Prettier how it is
formatted. `no-duplicate-attrs` goes too, since saxes rejects a
duplicate attribute as a parsing error.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhtVwYGj5HsHrYP3kq

* refactor(lint): move the ESLint plugins to tools/eslint-plugin in TypeScript

Move everything in scripts/eslint (the SVG plugin, the JSON Schema plugin
and the GitHub formatter) to a workspace package, @lucide/eslint-plugin,
next to the other internal tools, and convert it to TypeScript.

The package declares its own dependencies (saxes, ajv,
jsonc-eslint-parser), so saxes and ajv leave the root manifest. Rules are
typed against their own AST nodes instead of `any`. The tests run on
vitest like the other tools, through `pnpm test:eslint-plugin`, and a
new workflow runs them and the typecheck when the package changes.

Rule names and behaviour are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhtVwYGj5HsHrYP3kq

* Add svgo rule

* Fix codeQL issue

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 14:00:43 +01:00
2026-12-02 12:22:06 +01:00
2026-03-20 16:30:53 +01:00
2026-11-02 12:21:25 +01:00

Lucide - Beautiful & consistent icon toolkit made by the community. Open-source project and a fork of Feather Icons.

license figma installs build status discord chat

Icons · Guide · Packages · License · Showcase

Lucide

Lucide is an open-source icon library that provides 1600+ vector (svg) files for displaying icons and symbols in digital and non-digital projects. The library aims to make it easier for designers and developers to incorporate icons into their projects by providing several official packages to make it easier to use these icons in your project.

Packages

Logo Package Version Downloads Links
JS logo lucide npm NPM Downloads Docs · Source
React logo lucide-react npm NPM Downloads Docs · Source
Vue logo @lucide/vue npm NPM Downloads Docs · Source
Svelte logo @lucide/svelte npm NPM Downloads Docs · Source
Solid logo lucide-solid npm NPM Downloads Docs · Source
Preact logo lucide-preact npm NPM Downloads Docs · Source
React Native logo lucide-react-native npm NPM Downloads Docs · Source
Angular logo @lucide/angular npm NPM Downloads Docs · Source
Astro logo @lucide/astro npm NPM Downloads Docs · Source
SVG logo lucide-static npm NPM Downloads Docs · Source

Figma

The Lucide Figma plugin.

Visit Figma community page to install the plugin.

Figma Lucide Cover

Contributing

For more info on how to contribute please see the contribution guidelines.

Caught a mistake or want to contribute to the documentation? Edit this page on Github

About brand logos

Lucide does not accept brand logos, and we do not plan to add them in the future. This is due to a combination of legal restrictions, design consistency concerns, and practical maintenance reasons.

Click here to read our official statement about brand logos in Lucide.

Community

Join the community on our Discord server!

License

Lucide is totally free for commercial use and personal use, this software is licensed under the ISC License.

Credits

Thank you to all the people who contributed to Lucide!

Sponsors

Powered by Vercel

Bronze 🥉

Sourcegraph – Understand, fix, and automate across your codebase with Sourcegraph's code intelligence platform    Zephyr Cloud

Backers 🍺

Pax Historia    pdfme – Free and Open source PDF generation library!

Supporters ☕️

Fina Money – Build the most flexible finance tracker    Ruud

Other contributors 💸

You can find all our past and non-recurring financial contributors at our Open Collective page.

Languages
TypeScript 91.6%
JavaScript 6.9%
Svelte 0.7%
Vue 0.4%
HTML 0.3%
Other 0.1%