Code review checklist
style: primary
label: Uncheck All
action:
type: "regexpReplaceInNote"
regexp: "- \\[x\\]"
replacement: "- [ ]"
General
- variable/function/export names should be clear & specific
- failure states:
-
- in the example below, if
process.env.API_KEY
is not set andreq.body.apiKey
is not provided, the happy path will be followed, which is probably not desired! - this could be fixed by checking
if (!apiKey || apiKey !== process.env.API_KEY)
- in the example below, if
/* this is bad code! */
const apiKey = req.body.apiKey
if (apiKey !== process.env.API_KEY) {
throw new Error ('incorrect api key')
}
// happy path
-
- ESLint no-floating-promises and no-misused-promises can help catch these