josdejong / josdejong/mathjs

Testing: add check that every function is mentioned in types/index.d.ts

Open
#2,472 1 comment 1 reaction 0 assignees View on GitHub
feature help wanted typescript
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

A mild thorn in the side of mathjs has been frequent need to update the TypeScript typings. #2448 if merged will make some progress toward stabilizing this, as the TypeScript "exercising" of mathjs in the tests increases over time (as well as allow the ability to make changes to those typings with confidence that existing use won't be broken).

Another piece of the puzzle would simply be a check that at least every function (perhaps with some exception list) exported by mathjs is at least _mentioned_ in both `types/index.d.ts` and `types/index.ts`, so that there's at least a chance it is both declared and tested. That should at least prevent the (so far relatively common) case of "I added a function but oops forgot to type it."

My feeling is this should likely be another step in the new `test:types` script created if #2448 is merged, if possible.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.