-
-
Notifications
You must be signed in to change notification settings - Fork 20
feat(178): handle DEP0187 - Passing invalid argument types to fs.existsSync #231
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
base: main
Are you sure you want to change the base?
feat(178): handle DEP0187 - Passing invalid argument types to fs.existsSync #231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good starting ! to fix the red ci you have to run npm install
on root of the repo to sync the npm lock file
I'm a little confused why this is needed? It fundamentally changes the output of pre-modded code, since it coercing previously non-String values to strings. I don't think this is a needed mod, wdyt @nodejs/userland-migrations @nodejs/fs |
Based on the examples in the OP, I think these are not something we should do: node itself could do this but doesn't, presumably, because there is too much assumption, and in some cases, those are smells of real problems (this would sweep those real problems under the rug, making the situation worse / harder to find). If I've misunderstood, please do let me know. |
So what is action point here ? |
This PR adds a new codemod to handle DEP0187 deprecation warnings by validating and converting invalid argument types to
fs.existsSync()
.Changes
require
) and ESM (import
) syntaxExamples
fs.existsSync(123)
→fs.existsSync(String(123))
fs.existsSync(null)
→fs.existsSync(String(null || ''))