Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a838cf4

Browse files
authoredJun 9, 2023
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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)
Please sign in to comment.