Commit451 / skyhook

Parses webhooks and forwards them in the proper format to Discord.
https://commit451.github.io/skyhook-web
MIT License
367 stars 95 forks source link

Enable strict mode. #183

Closed dscalzi closed 2 years ago

dscalzi commented 2 years ago

The project was initially written without TypeScript. As a result, some areas of the codebase are implemented in ways that both violate strict mode checks and do not conform to typical TypeScript design patterns. By having strict mode disabled to accomodate this, we are limiting TypeScript's ability to detect and report problems before they are discovered at runtime.

Best practices that should ideally be implemented to properly turn on strict mode:

  1. Model provider payload structures with type interfaces, avoid any types.
  2. Convert usages of class to interface when it's being used strictly as a type checking utility (JavaScript carry-over).
  3. Avoid bandaid fixes (// @ts-ignore), logic should be rewritten with TypeScript warnings in mind.

Enabling Strict Mode in tsconfig.json

This would be a good QOL change. Feel free to pick it up and submit a PR.

dscalzi commented 2 years ago

Working on this