validatorjs / validator.js

String validation
MIT License
23.01k stars 2.29k forks source link

feat: deprecate non-ESM support #2238

Open benasher44 opened 1 year ago

benasher44 commented 1 year ago

Supporting named imports from this package (at least the root "validator" package) is very difficult due to the number of different module systems supported. I opened a PR briefly to attempt this, but it failed for AMD (and maybe others? unless I misunderstood). It can be supported for validator/es, but IDEs don't default to this, nor is there an index.d.ts in @types/validator to support this (i.e. more work is required).

With node 14 EOL having happened this year, node 16 EOL happening later this year, and most browsers supporting ESM, it feels like a good time to migrate to ESM-only via a validator 14

benasher44 commented 1 year ago

Erg sorry I think I chose the wrong template, and it auto-applied the bug label 🤦

WikiRik commented 1 year ago

This relates to the initial attempt at updating our build tooling as well, and comments/references mentioned in there; https://github.com/validatorjs/validator.js/pull/1869