Skip to content

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

Open
@benglewis

Description

@benglewis

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions