feat(178): handle DEP0187 - Passing invalid argument types to fs.existsSync#231
feat(178): handle DEP0187 - Passing invalid argument types to fs.existsSync#231techflare641 wants to merge 4 commits intonodejs:mainfrom
Conversation
AugustinMauroy
left a comment
There was a problem hiding this comment.
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 ? |
|
team, any updates here? fyi, i encouraged Ethan/@techflare641 to make contributions to node.js codemods. hope we get to some resolutions here. thanks for all of your great work! 🍻❤️ |
|
Here we need input from @nodejs/fs about how do we can handle this dep? Can we handle it with a codemod ? |
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 || ''))