diff --git a/README.md b/README.md index 665a4d52..13d3d4a4 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,14 @@ import { GeneratedInput } from './graphql' /* generates validation schema here */ ``` +### `useTypeImports` + +type: `boolean` default: `false` + +Will use `import type {}` rather than `import {}` when importing generated TypeScript types. +This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option. +Should used in conjunction with `importFrom` option. + ### `typesPrefix` type: `string` default: (empty) diff --git a/src/config.ts b/src/config.ts index ecaecd96..04c1af45 100644 --- a/src/config.ts +++ b/src/config.ts @@ -57,6 +57,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * @description Will use `import type {}` rather than `import {}` when importing generated typescript types. * This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option * Should used in conjunction with `importFrom` option. + * @default false * * @exampleMarkdown * ```yml @@ -71,7 +72,6 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig { * schema: yup * importFrom: ./path/to/types * useTypeImports: true - * * ``` */ useTypeImports?: boolean;