When implementing code that uses the Fastify package in TypeScript, ensure the following conventions are followed:

  1. Avoid Contractions: Use full words instead of contractions in code and comments. For example, use “it is” instead of “it’s”.
// Incorrect
// app.get('/hello', (req, res) => res.send("it's working!"));

// Correct 
app.get('/hello', (req, res) => res.send("it is working!"));
  1. Use Oxford Commas: Include an Oxford comma (serial comma) when listing three or more items in function parameters, middleware, or plugin configurations.
// Incorrect
app.use(helmet, compression, morgan);

// Correct
app.use(helmet, compression, and morgan);
  1. Maintain Consistent Formatting: Keep formatting consistent throughout the codebase, including:

Adhering to these conventions ensures the Fastify codebase remains readable, maintainable, and cohesive across different developers and components.