-
-
Notifications
You must be signed in to change notification settings - Fork 107
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 positive for detect-non-literal-fs-filename #54
Comments
+1 on this issue. Code to reproduce...
|
+1 |
Also |
It also false positive for any function with name which overlaps with fs method names: const id = '123'
const obj = {
readFile() {
return 1
},
writeFile() {
return 2
},
}
obj.readFile(id) // Yields here
obj.writeFile(id) // and here |
Any fix for the same? |
+1 on this issue. |
Summary
Still relevant? Next steps
|
Verified with the actual version and this snippet:
Versions:
|
PR raised |
I believe this issue has been fixed in the latest version. |
Yup, you're correct. Thanks! |
detect-non-literal-fs-filename
seems to also be triggered when passingfs.writeFile
to other functions, especially explicitly safe ones likeutil.promisify
.The message is also quite wrong ("Found
fs.writeFile
with non literal argument at index 0") while the actual warning is more that it's being passed in to a function and who knows what that function does with it?The text was updated successfully, but these errors were encountered: