Registry / testing / eslint-plugin-import-helpers

eslint-plugin-import-helpers

JSON →
library2.0.1jsnpmunverified

ESLint plugin providing configurable import ordering rules, forked from eslint-plugin-import. Current stable version is 2.0.1, supporting ESLint v9. It allows custom grouping (e.g., modules, absolute paths, parent/sibling), newlines between groups, and alphabetical sorting. Compared to eslint-plugin-import, it offers more flexible group definitions and is simpler for import sorting specifically. The maintainer recommends using Prettier instead for formatting. No frequent releases; v2 is a major bump for ESLint v9 support with no other breaking changes.

npm install eslint-plugin-import-helpers
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-IMPO
E
eslint-plugin-import-helpers
testingjavascriptv2.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

order-imports
import-helpers/order-imports (in rules config)
eslint-plugin-import-helpers/order-imports
Rule name is referenced as a string in ESLint config, not imported directly.
plugin
plugins: ['eslint-plugin-import-helpers']
plugins: ['import-helpers']
In ESLint, the plugin name must be prefixed with 'eslint-plugin-' when using the full name, or you can use the shorthand 'import-helpers' if ESLint resolves it.
require('eslint-plugin-import-helpers')
const plugin = require('eslint-plugin-import-helpers')
const plugin = require('eslint-plugin-import')
CommonJS require works, but typically used declaratively in config. Avoid confusing with eslint-plugin-import.

Configures the order-imports rule with groups: external modules, @shared/ internal modules, then relative imports, with newlines between groups and alphabetical sorting.

// Install: npm install --save-dev eslint-plugin-import-helpers // .eslintrc.js module.exports = { plugins: ['eslint-plugin-import-helpers'], rules: { 'import-helpers/order-imports': [ 'warn', { newlinesBetween: 'always', groups: [ 'module', '/^@shared/', ['parent', 'sibling', 'index'], ], alphabetize: { order: 'asc', ignoreCase: true }, }, ], }, };
Debug
Known issues
breakingVersion 2.x requires ESLint v9. ESLint v8 not supported.
fix
Upgrade to ESLint v9 or use version 1.x.
affects: >=2.0.0
deprecatedThe plugin is not actively maintained; maintainer recommends Prettier plugin instead.
fix
Consider using @ianvs/prettier-plugin-sort-imports for formatting.
affects: >=2.0.0
gotchaTypeScript type imports (import type { X }) are not supported and may be incorrectly sorted.
fix
Use a separate rule or plugin for type imports, or configure group order to place type imports manually.
affects: >=2.0.0
gotchaRegular expression groups must start with '/^' and end with '/' to be interpreted as regex; otherwise treated as module names.
fix
Ensure regex patterns are surrounded by '/^.../' in the groups array.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-import-helpers".
Plugin not installed or ESLint cannot resolve it.
fix
Run 'npm install eslint-plugin-import-helpers --save-dev' and ensure node_modules contains it.
Configuration for rule "import-helpers/order-imports" is invalid.
Invalid options object shape (e.g., missing groups array).
fix
Ensure rule options have at least a 'groups' array. Example: ["warn", { groups: ["module"] }]
Cannot read property 'sort' of undefined
Occurs when groups array is empty or malformed.
fix
Provide a non-empty groups array with at least one valid group (e.g., 'module').
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency — plugin requires ESLint to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-import-helpers — npm install eslint-plugin-import-helpers · libregistry