-
Notifications
You must be signed in to change notification settings - Fork 933
refactor: port ensure to ts #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 name
testcase. (Maybe we should move it to a different PR ??)How Has This Been Tested?
npm test
inside @commitlint/ensureChecklist: