import-js / import-js/eslint-plugin-import

no-restricted-paths: `deep` mode

Open
#421 2 comments 0 reactions 0 assignees View on GitHub
enhancement semver-minor
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

In addition to checking resolved imported paths for restrictions, could also deeply traverse the imports of imports and report if there is any deep module dependency on a restricted path.

Would not be necessary if you are linting all the dependencies together, since the root module would report the original import, but could be useful in a context like Sublime where a deep relationship might have snuck in elsewhere (like a `git pull`).

Would also be useful if all the intermediate dependencies are not being linted. This would be able to traverse imported `node_modules` if ES6 was available (e.g. via `jsnext:main`).

@lo1tuma: thoughts?

Contributor guide

Open the contributing guide

Research direction

Start by locating the no-restricted-paths rule entry point and its existing tests. Review how resolved imported paths are checked, then define the traversal behavior and reporting expectations for transitive dependencies, including imported node_modules; done means deep restricted-path dependencies are reported without requiring every intermediate dependency to be linted.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.