Node.js and TypeScript back ends checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
NODE-1(9) Don't block the event loop. (specific/nodejs) Automatable: eslint-plugin-nno-sync, eslint-plugin-regexpno-super-linear-backtracking.
Recommended (6–8)¶
-
NODE-2(8) Await or return every promise, and don't pass async functions where the caller ignores the returned promise. (specific/nodejs) Automatable: typescript-eslintno-floating-promises. -
NODE-3(8) Validate all external input, such as request bodies, query strings and messages, at runtime with a schema library. (specific/nodejs) -
NODE-4(8) Commit the lockfile, install withnpm ci, and check dependencies for known vulnerabilities in CI. (specific/nodejs) Automatable: npm ci. -
NODE-5(8) Run only Active LTS or Maintenance LTS releases of Node.js in production. (specific/nodejs) -
NODE-6(7) Treat unknown errors as fatal: log them, shut down gracefully and let the platform restart the process. (specific/nodejs) -
NODE-7(7) Structure the service by business components, each with its own entry points, domain logic and data access, and keep web-framework objects out of the domain logic. (specific/nodejs) Automatable: dependency-cruiser. -
NODE-8(7) Type-check Node.js services in CI withtsc, and setmoduletonodenext. (specific/nodejs) Automatable: TypeScriptstrict. -
NODE-9(7) Shut down gracefully onSIGTERM: fail the readiness check, stop accepting connections, finish in-flight requests, close resources, then exit. (specific/nodejs) -
NODE-10(7) Log structured JSON to stdout with a mature logger such as Pino, add request context with child loggers, and redact secrets. (specific/nodejs) -
NODE-11(6) Handle errors in one central handler that every entry point (HTTP routes, jobs, message consumers) calls, and throw onlyErrorobjects or subclasses of it. (specific/nodejs) -
NODE-12(6) Set HTTP server timeouts and connection limits, and put a reverse proxy in front of the service. (specific/nodejs)