eslint-plugin-phosphor-icons-import
v1.0.1
Published
ESLint plugin to enforce optimized imports for Phosphor Icons, reducing bundle size and improving consistency.
Readme
eslint-plugin-phosphor-icons-import
🎨 ESLint plugin to enforce optimized imports for Phosphor Icons.
This plugin helps standardize imports, reducing bundle size and improving consistency.
🚀 Installation
Install the package via npm:
npm install --save-dev eslint-plugin-phosphor-icons-import📌 Usage
module.exports = {
plugins: ['phosphor-icons-import'],
rules: {
'phosphor-icons-import/import-pattern': 'error',
},
}🔧 What It Does
This plugin enforces optimized imports for Phosphor Icons. It transforms imports like:
import { ShieldCheck } from '@phosphor-icons/react'Into more efficient, tree-shakable imports:
import { ShieldCheck } from '@phosphor-icons/react/ShieldCheck'🛠 Rule: phosphor-icons-import/import-pattern
| Rule | Description | Fixable | Default | | ------------------------------------ | --------------------------------------------- | ------- | ------- | | phosphor-icons-import/import-pattern | Enforces optimized imports for Phosphor Icons | ✅ Yes | "error" |
🏆 Benefits
- Reduces bundle size by only importing what's needed.
- Ensures consistent imports across the project.
- Works with React, Next.js, and other frameworks.
