Skip to content

Conversation

@colinrotherham
Copy link
Contributor

Description

This PR adds the TypeScript compiler to automatically discover code autocomplete suggestions etc

Seems a shame not to use the published type declarations from NHS.UK frontend package

E.g. Moving the initAll() import from HTML to the main.js file

Code autocomplete

Checklist

  • Tested against our testing policy (Resolution, Browser & Accessibility)
  • CHANGELOG entry

Comment on lines +248 to +252
app.use((err, req, res, next) => {
if (res.headersSent) {
return next(err)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this as a little example of why using types can be good

Error middleware checks in Express.js use Function.length to check for 4x calling arguments

i.e. We've missed the next param here

@colinrotherham colinrotherham marked this pull request as draft November 11, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants