refactor: port ensure to ts#666
Conversation
First param to enum (`value`) was earlier optional, which kept the tests easy. But user should be discouraged to use this edge case, so it is now required. In test, the function is typecasted to allow testing the edge case
Also updated globby to latest, as it has typescript definition files.
1 Remove ava config and deps from package.json 2 Change ava test script with typescript and jest commands
marionebl
left a comment
There was a problem hiding this comment.
Awesome work, thank you very much! In the meantime some conflicts cropped up - could you resolve those, then we should be able to get this in. 🚀
|
Changed dep "globby": "^9.2.0", as only the newer versions of globby have type definitions (inbuilt). In Because of this, right now, different @commitlint packages have diff versions of globby. I am not sure if this is a good practise - should we update it everywhere at once or change each when moving to ts? |
|
Upgrading to a deviating globby version should be fine as it is only a dev dependency here. |
1 similar comment
|
Upgrading to a deviating globby version should be fine as it is only a dev dependency here. |
|
Ok, then things look good now. |
|
LGTM, thanks for diligent work! |
Fixes part of #659. This ports @commitlint/ensure src and tests to typescript.
Changes made:
index.test.ts, replace .js wildcards with .ts wildcardscase.test.ts, addedthrows TypeError for invalid case nametestcase. (Maybe we should move it to a different PR ??)How Has This Been Tested?
npm testinside @commitlint/ensureChecklist: