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

Import without /lib or /es6 paths like fp-ts now does #506

Closed
osdiab opened this issue Aug 7, 2020 · 0 comments · Fixed by #507
Closed

Import without /lib or /es6 paths like fp-ts now does #506

osdiab opened this issue Aug 7, 2020 · 0 comments · Fixed by #507

Comments

@osdiab
Copy link
Contributor

osdiab commented Aug 7, 2020

🚀 Feature request

Current Behavior

To import specific files in io-ts, you need to import with /lib/ or /es6/ prefixes, like import { Encoder } from "io-ts/lib/Encoder"

Desired Behavior

Don't require that prefix, like import { Encoder } from "io-ts/Encoder"

Suggested Solution

Do what fp-ts is now doing with gcanti/fp-ts#1241 to simplify imports

Who does this impact? Who is this for?

All users who use sub-package imports

Describe alternatives you've considered

handling doing the correct import manually leads to a lot of extra boilerplate in setting up linters to avoid the wrong imports, getting confusing errors when you use the wrong one.

Additional context

fp-ts already shows a proof of concept so would be nice to apply it here.

Your environment

Software Version(s)
io-ts 2.2.9
fp-ts 2.8.1
TypeScript 3.9.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant