josdejong/mathjs

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

オープン

#2,472 opened on 2022/03/07

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (1,314 件のフォーク)batch import
featurehelp wantedtypescript

Repository metrics

Stars
 (15,065 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド