Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Investigate using typescript #102

Open
3 tasks
evqna opened this issue Jan 15, 2019 · 0 comments
Open
3 tasks

Investigate using typescript #102

evqna opened this issue Jan 15, 2019 · 0 comments
Labels
enhancement New feature or request task-size-large

Comments

@evqna
Copy link
Contributor

evqna commented Jan 15, 2019

Is your feature request related to a problem? Please describe.

Working on the recent refactoring has been frustrating as javascript offers practically no way to enforce contracts between different functions (in terms of what values they expect and return). This makes it difficult to keep the codebase in sync when changing the object layout of a return value or a parameter.

We have currently been using JSdoc as a bandaid to get some help from VSCode autocomplete but its power is limited.

Describe the solution you'd like

Using typescript in some places (not necessarily converting the whole code base) could let us define schemas for common data types and check that we do not misuse them. Possible use cases:

  • Describe the schema of linter json output
  • Enforce the GitHub checks report object schema as the output of the report merging code
  • Enforce a common interface on all linter runner classes

An other reoccurring has been passing too few parameters to some functions that then silently fail in obscure cases.

Describe alternatives you've considered

It may be possible to write more complex JSDoc rules but these only help autocompletion, they do not generate build errors.

@ericwb ericwb added the enhancement New feature or request label Jan 15, 2019
@evqna evqna mentioned this issue Jan 15, 2019
5 tasks
@joshuagl joshuagl added this to the Distant Future milestone May 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request task-size-large
Projects
None yet
Development

No branches or pull requests

4 participants