1.0.1 ⢠Published 5 months ago
eslint-plugin-phosphor-icons-import v1.0.1
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.