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

Add better type checking #124

Open
moltar opened this issue Apr 26, 2020 · 4 comments
Open

Add better type checking #124

moltar opened this issue Apr 26, 2020 · 4 comments

Comments

@moltar
Copy link
Contributor

moltar commented Apr 26, 2020

Is your feature request related to a problem? Please describe.

Problem: lack of tests for types can introduce defects.

This is a spillover from the discussion in #117 and defects from #119.

Describe the solution you'd like

Add testing for types.

Found this interesting library today: expect-type

Describe alternatives you've considered

Using:

  • tsd
  • conditional-type-checks (currently used)

Another drastic alternative is to rewrite the project to TypeScript, which will then remove the need to maintain separate types.

Additional context

Can help with a PR.

@evanshortiss
Copy link
Owner

@moltar thanks for raising this, expect-type looks pretty nice, though I think tsd is more mature. Have you used both? What do you think? It would be fantastic to be able to more confidently release with improved checks like these so I'd be very grateful for a PR in this area 🙏

I'm conflicted on rewriting to TS since it narrows the audience of potential contributors, and I think features such as the additional accessors could be challenging.

@moltar
Copy link
Contributor Author

moltar commented May 14, 2020

Have you used both?

Actually haven't used either. Just saw it, and that reminded me to open this issue :)

I'm conflicted on rewriting to TS since it narrows the audience of potential contributors, and I think features such as the additional accessors could be challenging.

That's fair!

@just-chillin
Copy link

Honestly, it would be nice if you didn't use any libraries. One of the major reasons I choose env-var is because it doesn't have any dependencies that may break down the line.

@evanshortiss
Copy link
Owner

evanshortiss commented May 18, 2020

@just-chillin agreed. This would be a devDependency so it won't affect users of the module. I'm much more dubious about adding regular dependencies.

Edit: In other words, I completely agree @just-chillin 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants