Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): allow files options to be simple strings as well as arrays
Originally, these files options just accepted strings, but they were modified to accept arrays of strings too whilst we were adding lint-staged support so that that plugin could pass in an array of globs. We allowed single strings to still be set as options in order to preserve backwards compatibility, but when writing the original schemas for the migration script the option was encoded as a string array because we planned to deprecate a single string option eventually so it made sense for the migration script to only offer new users to create a list of file globs. However, this became a problem when we translated that schema into a zod schema that would also be used to validate the options a user has set, as that original schema did not allow single strings. This inadvertently created a breaking change when moving to zod. To work around this breaking change, let's tell zod that either a string or an array of strings is valid. We can roll this back in a future major version if we wish.
- Loading branch information