Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(no-missing-require): handle multiple resolvePaths #383

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

GertSallaerts
Copy link

When you add multiple paths to the resolvePaths option and the required or imported file isn't in the first path, ImportTarget's resolveError field will get populated. This will later cause the check-existence utility to mark the file as missing. I fixed this by clearing the resolveError when resolution is successful.

The same happens when you add a single path resolvePaths and try to require a relative path.

Copy link

@scagood scagood left a comment

Choose a reason for hiding this comment

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

💜 This looks great, thank you!

tests/lib/rules/no-missing-import.js Outdated Show resolved Hide resolved
@scagood scagood self-assigned this Nov 14, 2024
@scagood scagood added bug enhancement accepted rule:update An update to a current rule labels Nov 14, 2024
Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aladdin-add aladdin-add merged commit df6ad2a into eslint-community:master Nov 15, 2024
29 checks passed
@GertSallaerts GertSallaerts deleted the fix/resolve-paths branch November 15, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants