File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ import path from "path";
22import ts from "typescript" ;
33import { ComponentDoc , PropItem } from "react-docgen-typescript" ;
44
5+ export interface GeneratorOptions {
6+ filename : string ;
7+ source : string ;
8+ componentDocs : ComponentDoc [ ] ;
9+ docgenCollectionName : string | null ;
10+ setDisplayName : boolean ;
11+ typePropName : string ;
12+ }
13+
514/**
615 * Inserts a ts-ignore comment above the supplied statement.
716 *
@@ -312,15 +321,6 @@ function setComponentDocGen(
312321 ) ;
313322}
314323
315- export interface GeneratorOptions {
316- filename : string ;
317- source : string ;
318- componentDocs : ComponentDoc [ ] ;
319- docgenCollectionName : string | null ;
320- setDisplayName : boolean ;
321- typePropName : string ;
322- }
323-
324324export function generateDocgenCodeBlock ( options : GeneratorOptions ) : string {
325325 const sourceFile = ts . createSourceFile (
326326 options . filename ,
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ export default class DocgenPlugin {
146146 this . options = options ;
147147 }
148148
149- apply ( compiler : webpack . Compiler ) {
149+ apply ( compiler : webpack . Compiler ) : void {
150150 const {
151151 tsconfigPath = "./tsconfig.json" ,
152152 docgenCollectionName = "STORYBOOK_REACT_CLASSES" ,
@@ -168,7 +168,10 @@ export default class DocgenPlugin {
168168 } ;
169169
170170 if ( userCompilerOptions ) {
171- compilerOptions = { ...compilerOptions , ...userCompilerOptions } ;
171+ compilerOptions = {
172+ ...compilerOptions ,
173+ ...userCompilerOptions ,
174+ } ;
172175 } else {
173176 const { options } = getTSConfigFile ( tsconfigPath ) ;
174177 compilerOptions = { ...compilerOptions , ...options } ;
You can’t perform that action at this time.
0 commit comments