-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Bug: typeMatchesSpecifier
FileSpecifier
checks in node modules
#6819
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
Comments
🤔 @RebeccaStevens I think this makes sense. But similar to #6818 - is there a more full repro you can provide? |
I made a repo here: https://github.com/RebeccaStevens/typescript-eslint-issue-6818 The test rule I setup simply reports if I also found another strange issue when setting this up. I tried using |
Hi, I propose to think about the behaviour in the two situations separately:
Anyway, I'll try to make a PR. |
@marekdedic Just beat you to it 😛 |
I should probably open a new issue for this, but should we add the ability to specify a partial path? So for example: { from: "file", name: "Foo", path: "src" } Will match any This will act similarly to how when no |
Yes please 😇 |
Well or maybe this should be a part of #6839 ? |
typeMatchesSpecifier
FileSpecifier
checks in node modulestypeMatchesSpecifier
FileSpecifier
checks in node modules
Before You File a Bug Report Please Confirm You Have Done The Following...
Relevant Package
utils
Playground Link
No response
Repro Code
ESLint Config
No response
tsconfig
No response
Expected Result
It shouldn't find this type (as I haven't defined it).
Actual Result
I finds it in "node_modules/.pnpm/typescript@5.0.3/node_modules/typescript/lib/lib.es5.d.ts".
Additional Info
I would expect a
FileSpecifier
to ignore node module files by default.typescript/lib/*.d.ts
files should only match with aLibSpecifier
and other files in node module to only match with aPackageSpecifier
.Maybe
FileSpecifier
needs an extra property likeignorePath
orignoreGlob
that defaults to"node_modules"
.Or alternatively,
path
could be made a glob that defaults to selecting files not in"node_modules"
.Versions
@typescript-eslint/eslint-plugin
6.0.0-alpha.106
@typescript-eslint/parser
6.0.0-alpha.106
@typescript-eslint/scope-manager
6.0.0-alpha.106
@typescript-eslint/typescript-estree
6.0.0-alpha.106
@typescript-eslint/type-utils
6.0.0-alpha.106
@typescript-eslint/utils
6.0.0-alpha.106
TypeScript
5.0.3
ESLint
8.36.0
node
18.15.0
The text was updated successfully, but these errors were encountered: