A tiny ESLint plugin (v0.0.2) for checking import/export paths against forbidden patterns and depth limits. It allows defining regex-based or substring-based blacklists and a maximum parent directory depth. Unlike the more comprehensive eslint-plugin-import, this plugin focuses solely on simple path validation without full module resolution. It is stable enough for development use, but the version 0.0.2 indicates it is still in early stages with no release cadence. Key differentiators: lightweight, no external dependencies beyond ESLint, and supports both regex and substring matching with custom error messages.
npm install eslint-plugin-import-pathVerified import paths — ran on the pinned version, not inferred.
Installs the plugin and configures two rules: forbidding paths ending in '/index' and limiting parent directory depth to 2.
Use double escaping in JSON strings, e.g., 'match': '\\.' for a literal '.'
Use 'match' for regex, 'contains' for plain substring.
Run npm install eslint-plugin-import-path --save-dev
Use one of: 'off', 'warn', or 'error'.