validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

feat: deprecate non-ESM support

Open benasher44 opened this issue 2 years ago • 2 comments

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 avatar Jun 21 '23 15:06 benasher44

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

benasher44 avatar Jun 21 '23 15:06 benasher44

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

WikiRik avatar Jun 21 '23 16:06 WikiRik