Skip to content

Commit

Permalink
fix: typesOnly 模式下对于 FileData 的声明加上 ts-ignore 防止未使用到时报红
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Aug 16, 2021
1 parent 99141f7 commit da2b084
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Generator.ts
Expand Up @@ -463,6 +463,7 @@ export class Generator {
${
syntheticalConfig.typesOnly
? dedent`
// @ts-ignore
type FileData = File
${content.join('\n\n').trim()}
Expand Down
1 change: 1 addition & 0 deletions tests/__snapshots__/Generator.test.ts.snap
Expand Up @@ -764,6 +764,7 @@ exports[`Generator 只生成类型代码并写入文件: 接口文件 1`] = `

/* 该文件由 yapi-to-typescript 自动生成,请勿直接修改!!! */

// @ts-ignore
type FileData = File

/**
Expand Down

0 comments on commit da2b084

Please sign in to comment.