eslint-plugin-next-unplugin-icons v1.0.1
eslint-plugin-next-unplugin-icons
A custom ESLint plugin for Next.js projects that integrates with unplugin-icons to catch potential issues related to its usage.
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-next-unplugin-icons:
npm install eslint-plugin-next-unplugin-icons --save-devUsage
Enable the recommended configuration:
To automatically enable the recommended rules, add
plugin:next-unplugin-icons/recommendedto theextendssection of your.eslintrcconfiguration file:{ "extends": [ "plugin:next-unplugin-icons/recommended" ] }This enables all the recommended lint rules for ensuring best practices with
next-unplugin-icons.Using the plugin manually:
Add
next-unplugin-iconsto the plugins section of your.eslintrcconfiguration file. You can omit theeslint-plugin-prefix:{ "plugins": [ "next-unplugin-icons" ] }Then, manually enable the specific rules you need in the
rulessection. For example:{ "rules": { "next-unplugin-icons/require-jsx-extension-in-icons-import": "error" } }
Configurations
| Name | |
|---|---|
| ✅ | recommended |
Rules
💼 Configurations enabled in.\
✅ Set in the recommended configuration.\
🔧 Automatically fixable by the --fix CLI option.
| Name | Description | 💼 | 🔧 |
|---|---|---|---|
| require-jsx-extension-in-icons-import | Enforces the explicit use of the .jsx extension in icon import paths to ensure proper module resolution and consistency across Next.js projects. | ✅ | 🔧 |