Skip to content

Commit a838cf4

Browse files
authored
Merge pull request #393 from Code-Hex/fix/documents-useTypeImports
fixed documents for useTypeImports
2 parents 623a5bd + 871dc44 commit a838cf4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ import { GeneratedInput } from './graphql'
8686
/* generates validation schema here */
8787
```
8888

89+
### `useTypeImports`
90+
91+
type: `boolean` default: `false`
92+
93+
Will use `import type {}` rather than `import {}` when importing generated TypeScript types.
94+
This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option.
95+
Should used in conjunction with `importFrom` option.
96+
8997
### `typesPrefix`
9098

9199
type: `string` default: (empty)

src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
5757
* @description Will use `import type {}` rather than `import {}` when importing generated typescript types.
5858
* This gives compatibility with TypeScript's "importsNotUsedAsValues": "error" option
5959
* Should used in conjunction with `importFrom` option.
60+
* @default false
6061
*
6162
* @exampleMarkdown
6263
* ```yml
@@ -71,7 +72,6 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
7172
* schema: yup
7273
* importFrom: ./path/to/types
7374
* useTypeImports: true
74-
*
7575
* ```
7676
*/
7777
useTypeImports?: boolean;

0 commit comments

Comments
 (0)