useTypeImports option and consistent-type-imports
socnacom opened this issue · 2 comments
socnacom commented
When using enums, if useTypeImports is set to true, then generated code won't work since enums cannot be used as values. Example of generated code :
export const AddressTypeEnumSchema = yup.string<AddressTypeEnum>().oneOf([AddressTypeEnum.Billing, AddressTypeEnum.Delivery, AddressTypeEnum.FolderOrMission, AddressTypeEnum.HeadOffice, AddressTypeEnum.ResearchUnit, AddressTypeEnum.Residence, AddressTypeEnum.SecondaryOffice]).defined();
Alternatively, If useTypeImports is set to false, then generated import instruction isn't perfectly valid :
Imports "XXX", "YYY" are only used as type.eslint[@typescript-eslint/consistent-type-imports](https://typescript-eslint.io/rules/consistent-type-imports)
Code-Hex commented
Code-Hex commented
No reply. close