-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
I think that this sounds really nice:
https://eslint.org/blog/2022/07/interesting-bugs-caught-by-no-constant-binary-expression/
Ecosystem impact:
fastify/fastify:test/internals/reply.test.js:175:reply.serializer((x) => (customSerializerCalled = true) && JSON.stringify(x))
test/internals/reply.test.js:184:const context = { [kReplySerializerDefault]: (x) => (customSerializerCalled = true) && JSON.stringify(x) }
The only affected code is the two lines above, where Fastify is using a little trick to do two things on one line. It could be replaced with e.g.
reply.serializer((x) => { customSerializerCalled = true; return JSON.stringify(x) })or
reply.serializer((x) => {
customSerializerCalled = true
return JSON.stringify(x)
})(ping @mcollina, since your repo is the affected one)
wesleytodd and rhettjaycaptbaritone
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status