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

Bug: n/no-restricted-require does not work for relative imports (as opposed to no-restricted-modules from ESLint) #151

Open
1 task
benglewis opened this issue Dec 19, 2023 · 0 comments
Assignees
Labels

Comments

@benglewis
Copy link

benglewis commented Dec 19, 2023

Environment

Node version: 18.18.0
npm version: 9.4.2
ESLint version: 8.52.0
eslint-plugin-n version: 16.4.0
Operating System: macOS 14

What rule do you want to report?

n/no-restricted-require

Link to Minimal Reproducible Example

https://stackblitz.com/edit/stackblitz-starters-veyq3i?file=.eslintrc.yml

What did you expect to happen?

Run npm run lint, expected to see an error because the glob "**/" pattern at the beginning should match the "../" in the require statement

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

It looks like the issue is with Minimatch. I suggest switching to another glob matcher

@benglewis benglewis added the bug label Dec 19, 2023
@aladdin-add aladdin-add self-assigned this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants