{"id":19792,"library":"eslint-plugin-import-helpers","title":"eslint-plugin-import-helpers","description":"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.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/Tibfib/eslint-plugin-import-helpers","tags":["javascript","eslint","eslint-plugin","eslintplugin","import","eslint-plugin-import","configurable"],"install":[{"cmd":"npm install eslint-plugin-import-helpers","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-import-helpers","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-import-helpers","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency — plugin requires ESLint to function","package":"eslint","optional":false}],"imports":[{"note":"Rule name is referenced as a string in ESLint config, not imported directly.","wrong":"eslint-plugin-import-helpers/order-imports","symbol":"order-imports","correct":"import-helpers/order-imports (in rules config)"},{"note":"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.","wrong":"plugins: ['import-helpers']","symbol":"plugin","correct":"plugins: ['eslint-plugin-import-helpers']"},{"note":"CommonJS require works, but typically used declaratively in config. Avoid confusing with eslint-plugin-import.","wrong":"const plugin = require('eslint-plugin-import')","symbol":"require('eslint-plugin-import-helpers')","correct":"const plugin = require('eslint-plugin-import-helpers')"}],"quickstart":{"code":"// Install: npm install --save-dev eslint-plugin-import-helpers\n// .eslintrc.js\nmodule.exports = {\n  plugins: ['eslint-plugin-import-helpers'],\n  rules: {\n    'import-helpers/order-imports': [\n      'warn',\n      {\n        newlinesBetween: 'always',\n        groups: [\n          'module',\n          '/^@shared/',\n          ['parent', 'sibling', 'index'],\n        ],\n        alphabetize: { order: 'asc', ignoreCase: true },\n      },\n    ],\n  },\n};","lang":"javascript","description":"Configures the order-imports rule with groups: external modules, @shared/ internal modules, then relative imports, with newlines between groups and alphabetical sorting."},"warnings":[{"fix":"Upgrade to ESLint v9 or use version 1.x.","message":"Version 2.x requires ESLint v9. ESLint v8 not supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Consider using @ianvs/prettier-plugin-sort-imports for formatting.","message":"The plugin is not actively maintained; maintainer recommends Prettier plugin instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Use a separate rule or plugin for type imports, or configure group order to place type imports manually.","message":"TypeScript type imports (import type { X }) are not supported and may be incorrectly sorted.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Ensure regex patterns are surrounded by '/^.../' in the groups array.","message":"Regular expression groups must start with '/^' and end with '/' to be interpreted as regex; otherwise treated as module names.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-import-helpers --save-dev' and ensure node_modules contains it.","cause":"Plugin not installed or ESLint cannot resolve it.","error":"ESLint couldn't find the plugin \"eslint-plugin-import-helpers\"."},{"fix":"Ensure rule options have at least a 'groups' array. Example: [\"warn\", { groups: [\"module\"] }]","cause":"Invalid options object shape (e.g., missing groups array).","error":"Configuration for rule \"import-helpers/order-imports\" is invalid."},{"fix":"Provide a non-empty groups array with at least one valid group (e.g., 'module').","cause":"Occurs when groups array is empty or malformed.","error":"Cannot read property 'sort' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}