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

tsc complaining about violating noUncheckedIndexedAccess in node_modules #48779

Closed
hibaAkroush opened this issue Apr 20, 2022 · 2 comments
Closed
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@hibaAkroush
Copy link

hibaAkroush commented Apr 20, 2022

Bug Report

after enabling noUncheckedIndexedAccess compilation rule I noticed TSC is complaining about the rule being violated inside node_modules/someLib/someFile.tsx.

what i have tried

1- skipLibCheck: which will only exclude .d.ts files

2- explicitly excluding node_modules which will not work because imported files are always part of the compilation!

due to:

You're most likely including the source file in your project. `exclude` only acts as a filter on top of `include`, but imported files are always part of the compilation. You can use the [--explainFiles](https://www.typescriptlang.org/tsconfig/#explainFiles) compiler option to figure out why the file was included in the compilation.

This might be relevant to you: #30511

Originally posted by @MartinJohns in #47387 (comment)

this basically means that if one wants to enable any type check ALL the libraries used by me have to have the same level of strictness and have to enable the same type checks which makes no sense for something optional like noUncheckedIndexedAccess.

is there a way to really exclude type checking for files inside node_modules?

Similar Issues

#47387
#46634

@MartinJohns
Copy link
Contributor

Duplicate of #44205.

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Apr 20, 2022
@RyanCavanaugh
Copy link
Member

See specifically #44205 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

3 participants