feature: Move IsPhoneNumber outside of this package

Author: alcalynCreated May 26, 2026Updated May 26, 2026
Labelstype: featureflag: needs discussion

Description

First, I've read about https://github.com/typestack/class-validator/issues/1803 where we should use tree shaking, and it's planned to move all validator to subpackages.

But I think IsPhoneNumber is a special case: it's pretty big, and this only validator requires the import for libphonenumber-js, 43kb gzipped.

I suggest moving it first.

Proposed solution

Deprecate IsPhoneNumber now (at least before next major), and suggest to replace it by the newly extracted package, and in next major, remove dependency to libphonenumber-js

Source: typestack/class-validator