Sitelet https://github.com/import-js/eslint-plugin-import/pull/2090
Skip to content

[Fix] no-restricted-paths: false-positive matches - #2090

Merged
ljharb merged 1 commit into
import-js:masterfrom
malykhinvi:fix-paths
May 18, 2021
Merged

ljharb merged 1 commit into
import-js:masterfrom
malykhinvi:fix-paths

Conversation

@malykhinvi

@malykhinvi malykhinvi commented May 18, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #2089

In this PR I removed contains-paths dependency and used node's path.relative to identify if a file is inside the target. I used an approach similar to the one used in src/core/importType

@malykhinvi malykhinvi changed the title Reproduce partial paths error [Fix] no-restricted-paths: partial paths false-positive matches May 18, 2021
@coveralls

coveralls commented May 18, 2021 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+1.02%) to 82.434% when pulling ddb2132 on malykhinvi:fix-paths into bc99b86 on benmosher:master.

@malykhinvi
malykhinvi marked this pull request as ready for review May 18, 2021 13:21
@malykhinvi malykhinvi changed the title [Fix] no-restricted-paths: partial paths false-positive matches [Fix] no-restricted-paths: false-positive matches May 18, 2021

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great. Normally I firmly believe that more deps is better, but I'm stoked to remove this particular dep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

no-restricted-path: incorrect zone.target match

3 participants