Back to all reviewers

Modern TypeScript style

expressjs/express
Based on 2 comments
TypeScript

Use modern TypeScript syntax and conventions throughout the codebase. This includes: - Using `const` instead of `var` for variable declarations unless reassignment is needed

Code Style TypeScript

Reviewer Prompt

Use modern TypeScript syntax and conventions throughout the codebase. This includes:

  • Using const instead of var for variable declarations unless reassignment is needed
  • Using ES module syntax (import express from 'express') instead of CommonJS require()
  • Explicitly typing function parameters and return values

Example (before):

const express = require("express");

const app: import("express").Application = module.exports = express();

app.get('/', function(request, response) {
    console.log(request.url);

Example (after):

import express from 'express';
import { Request, Response } from 'express';

const app = express();

app.get('/', function(request: Request, response: Response) {
    console.log(request.url);
});
2
Comments Analyzed
TypeScript
Primary Language
Code Style
Category

Source Discussions