{"id":19751,"library":"eslint-plugin-fast-import","title":"eslint-plugin-fast-import","description":"An ESLint plugin for validating imports and exports, leveraging a novel algorithm with the OXC Rust-based parser for high performance. Current stable version is 2.2.1, with a rapid release cadence. It offers an editor mode that keeps in-memory data structures updated with filesystem changes, preventing stale errors. Unlike eslint-plugin-import and eslint-plugin-import-x, it does not support user-supplied resolvers and only analyzes first-party code within rootDir. It includes rules like no-cycle, no-entry-point-imports, no-external-barrel-reexports, and no-named-as-default. Requires ESLint >= 9.0.0 and ESM-only codebases.","status":"active","version":"2.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/nebrius/eslint-plugin-fast-import","tags":["javascript","eslint","eslintplugin","eslint-plugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-fast-import","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-fast-import","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-fast-import","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin runs as an ESLint plugin","package":"eslint","optional":false}],"imports":[{"note":"CommonJS require is not supported; the plugin is ESM-only.","wrong":"const fastImport = require('eslint-plugin-fast-import')","symbol":"default","correct":"import fastImport from 'eslint-plugin-fast-import'"},{"note":"Individual rules are not exported; access via rules object.","wrong":"import { noCycle } from 'eslint-plugin-fast-import'","symbol":"rules","correct":"import { rules } from 'eslint-plugin-fast-import'"},{"note":"Use configs.recommended or configs.all for predefined configurations.","wrong":"import recommended from 'eslint-plugin-fast-import'","symbol":"configs","correct":"import { configs } from 'eslint-plugin-fast-import'"},{"note":"Utility for rule authors to access ESM analysis context.","wrong":null,"symbol":"getESMInfo","correct":"import { getESMInfo } from 'eslint-plugin-fast-import'"}],"quickstart":{"code":"// Install: npm install --save-dev eslint-plugin-fast-import\n\n// eslint.config.js (flat config)\nimport fastImport from 'eslint-plugin-fast-import';\n\nexport default [\n  {\n    plugins: { 'fast-import': fastImport },\n    rules: {\n      'fast-import/no-cycle': 'error',\n      'fast-import/no-entry-point-imports': 'error',\n      'fast-import/no-external-barrel-reexports': 'error',\n      'fast-import/no-named-as-default': 'error',\n    },\n    settings: {\n      'fast-import': {\n        rootDir: __dirname, // required\n        alias: { '@': './src' },\n        mode: process.env.CI ? 'build' : 'editor',\n      },\n    },\n  },\n];","lang":"typescript","description":"Configuring eslint-plugin-fast-import with recommended rules and settings including rootDir and alias."},"warnings":[{"fix":"Upgrade to ESLint 9+ and use flat config with ESM imports.","message":"Version 2.0.0 dropped support for ESLint <= 8 and CommonJS. Flat config and ESM are required.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set rootDir to the root of your project (e.g., path.resolve(__dirname, 'src')).","message":"rootDir setting is required; all first-party code must reside under rootDir. Files outside are not analyzed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Convert your codebase to ESM syntax.","message":"CommonJS (require, module.exports) is not supported. Only ESM import/export syntax is analyzed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"For third-party re-exports, manually check or use a different plugin.","message":"Barrel re-exports of third-party modules are ignored; rules like no-external-barrel-reexports only apply to first-party code.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Switch to configs.recommended and add extra rules as needed.","message":"The 'all' configuration is deprecated in v2; use 'recommended' and opt-in to additional rules individually.","severity":"deprecated","affected_versions":">=2.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 --save-dev eslint-plugin-fast-import' and ensure it's in package.json.","cause":"Package not installed or missing from dependencies.","error":"Error: Cannot find module 'eslint-plugin-fast-import'"},{"fix":"Use a unique key, e.g., plugins: { 'fast-import': fastImport }.","cause":"Multiple versions or conflicting names in plugins object.","error":"ESLint couldn't determine the plugin 'fast-import' uniquely."},{"fix":"Set rule to 'error', 'warn', 'off', or ['warn', { ... }].","cause":"Rule severity must be 'off', 'warn', or 'error', or an array.","error":"Configuration for rule \"fast-import/no-cycle\" is invalid: Value \"warn\" is not allowed."},{"fix":"Add settings: { 'fast-import': { rootDir: __dirname } } to ESLint config.","cause":"fast-import settings not defined or rootDir missing.","error":"TypeError: Cannot read properties of undefined (reading 'rootDir')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}