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

False Alert for "fs" #412

Closed
AbdulHannan96 opened this issue Aug 20, 2019 · 5 comments
Closed

False Alert for "fs" #412

AbdulHannan96 opened this issue Aug 20, 2019 · 5 comments

Comments

@AbdulHannan96
Copy link

AbdulHannan96 commented Aug 20, 2019

fs node package false alert in my task. I am using fs in many lines for handling files but depcheck marks it as unused which is quite surprising.

@AbdulHannan96 AbdulHannan96 changed the title False Alert False Alert for "fs" Aug 20, 2019
@rumpl
Copy link
Member

rumpl commented Aug 20, 2019

Do you define fs as a dependecy in your package.json?

@rumpl
Copy link
Member

rumpl commented Aug 20, 2019

“fs” is a core node module and shouldn’t be added in the package.json file

@AbdulHannan96
Copy link
Author

yeah It is defined in my package.json. I am new at using node and typescript so I was not aware of this. Even if it should not be there, why is depcheck pointing it out as an unused dependency ?

@LinusU
Copy link
Member

LinusU commented Aug 20, 2019

why is depcheck pointing it out as an unused dependency

Because when you are doing require('fs') you are not requiring that package, but rather the built-in fs package. Thus the package installed to node_modules/fs is, in fact, unused ☺️

@rumpl
Copy link
Member

rumpl commented Aug 20, 2019

We should maybe have a more explicit error message for the core modules...

I'm closing this one

Cheers

@rumpl rumpl closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants