@mal-icons/eslint-plugin
v0.7.11
Published
ESLint rules for mal-icons: keep icon imports tree-shakeable and tidy.
Maintainers
Readme
@mal-icons/eslint-plugin
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-pluginRequires 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-iconsSee 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
