An ESLint plugin (v0.0.3) for restricting imports from specified paths in specified directories. Useful for enforcing barrel imports or preventing cross-package imports in monorepos. Rules use regex patterns to match import paths and file locations. Extends ESLint's plugin architecture and is compatible with Node >=0.10.0. No active maintenance since 2019, limited documentation, and no TypeScript support.
npm install eslint-plugin-restrict-importsVerified import paths — ran on the pinned version, not inferred.
Configures eslint-plugin-restrict-imports to ban imports from clientA in clientB and direct common imports in client directories.
Consider using alternative plugins like eslint-plugin-import with no-restricted-paths or eslint-plugin-boundaries.
Test regex patterns thoroughly; use tools like regex101.com to validate.
Use eslint-plugin-import with import/no-restricted-paths or eslint-plugin-boundaries for TypeScript projects.
Remember the rule ID is 'restrict-imports/restrict-imports', not just 'restrict-imports'.
Run npm install eslint-plugin-restrict-imports --save-dev and ensure node_modules contains the plugin.
Ensure the rule value is an array: ["error", {...}].Remove duplicate rule definitions or ensure only one source defines 'restrict-imports/restrict-imports'.