For import isEmail from 'validator/es/lib/isEmail';'
Could not find a declaration file for module 'validator/es/lib/isEmail'`
But for import isEmail from 'validator/lib/isEmail';
It's ok.
The tree shakable path does not appear to be working
@banjankri -- could you please help look into this, re: #1015
Related: #1204. Wish I had time to volunteer to convert this project to TypeScript.
@steida would you be able to provide some further details on this issue please? Like typescript version used, tsconfig, whether you are using typings for this library etc. I am using the very same imports in a TS project and it seem to be working fine. Also exact version of validator.js used could help to pinpoint the culprit.
As I wrote, try this example https://github.com/validatorjs/validator.js#tree-shakeable-es-imports
"validator": "^13.0.0"
"@types/validator": "^13.0.0",
Still does not work for es6.
Using exatly this import in my project. Upgraded to pointed versions of validator and @types/validator and still cannot seem to reproduce the issue. All seems fine.
@steida Could you share some more information re your typescript/tsconfig please? Or provide sample repository ideally.
Not sure if it helps, but removing the strict flag fixes the error. However should you want to enforce that you'd need to either amend the typings for the library or add a typing locally or a path mapping in your tsconfig.
The way to go would be amending the typings for the library or as mentioned before converting it to typescript altogether.
Remove 'strict' is nogo. Please, do not castrate TypeScript.
Opened up a PR with DefinitelyTyped so castration should not be necessary :)
@steida the PR got merged, please give it a go using the latest typings.
@banjankri Great, TypeScript error is gone.
Unfortunately, tree shakable path still does not appear to be working.

But it's another error so I am closing this issue. Thank you.
Most helpful comment
The tree shakable path does not appear to be working