Skip to content
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

Merged

Conversation

bendtherules
Copy link
Contributor

Fixes part of #659. This ports @commitlint/ensure src and tests to typescript.

Changes made:

  1. Remove ava config, dependencies and scripts from package.json
  2. Add typescript and jest config, dependencies and scripts instead
  3. Port ensure/* source and test files to ts
  4. In index.test.ts, replace .js wildcards with .ts wildcards
  5. In case.test.ts, added throws TypeError for invalid case name testcase. (Maybe we should move it to a different PR ??)

How Has This Been Tested?

npm test inside @commitlint/ensure

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@bendtherules bendtherules changed the title port @commitlint/ensure to ts port ensure to ts May 28, 2019
@bendtherules bendtherules changed the title port ensure to ts port ensure to ts May 28, 2019
@bendtherules bendtherules mentioned this pull request May 28, 2019
18 tasks
@marionebl marionebl changed the title port ensure to ts refactor: port ensure to ts May 31, 2019
@marionebl marionebl self-requested a review May 31, 2019 07:47
Copy link
Contributor

@marionebl marionebl left a 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. 🚀

@bendtherules
Copy link
Contributor Author

bendtherules commented May 31, 2019

Changed dep "globby": "^9.2.0", as only the newer versions of globby have type definitions (inbuilt).

In ensure, it is used in a test file (now in ts). Without type definitions, ts would mark it as an error by default. We have to either update the package or include a local typedef for this package.

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?

@marionebl
Copy link
Contributor

Upgrading to a deviating globby version should be fine as it is only a dev dependency here.

1 similar comment
@marionebl
Copy link
Contributor

Upgrading to a deviating globby version should be fine as it is only a dev dependency here.

@bendtherules
Copy link
Contributor Author

Ok, then things look good now.

@marionebl
Copy link
Contributor

LGTM, thanks for diligent work!

@marionebl marionebl merged commit 4861f74 into conventional-changelog:master Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants