Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed documents for useTypeImports #393

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -71,7 +72,6 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
* schema: yup
* importFrom: ./path/to/types
* useTypeImports: true
*
* ```
*/
useTypeImports?: boolean;
Expand Down