npm.io
0.11.0 • Published 4d ago

@mal-icons/eslint-plugin

Licence
MIT
Version
0.11.0
Deps
0
Size
8 kB
Vulns
0
Weekly
0

@mal-icons/eslint-plugin

npm License: MIT

ESLint rules for mal-icons that keep icon usage correct, minimal, and tree-shakeable.

Rules

Rule Description
@mal-icons/prefer-named-import Enforce named subpath imports (@mal-icons/react/fi) so bundlers tree-shake.
@mal-icons/no-unused-icons Flag imported icons that are never used.

Installation

bun add -d @mal-icons/eslint-plugin
# or
npm install --save-dev @mal-icons/eslint-plugin

Requires ESLint 8 or newer (peer dependency).

Use with AI agents

The mal-icons agent skill teaches AI coding agents to use these lint rules and write tree-shakeable icon imports. Install it with the skills CLI:

npx skills add mal-icons/mal-icons

See the ESLint plugin setup guide.

Usage

Flat config (ESLint 9+)

The plugin ships a recommended flat config that enables both rules as errors:

// eslint.config.js
import malIcons from "@mal-icons/eslint-plugin";

export default [malIcons.configs.recommended];

Or wire the rules manually:

import malIcons from "@mal-icons/eslint-plugin";

export default [
  {
    plugins: { "@mal-icons": malIcons },
    rules: {
      "@mal-icons/prefer-named-import": "error",
      "@mal-icons/no-unused-icons": "error",
    },
  },
];

Repository

https://github.com/mal-icons/mal-icons · package directory packages/eslint-plugin.

License

MIT MALDevs