@@ -37,12 +37,12 @@ export function createTypings(
3737 } ,
3838 querySubtree ( subtree : any , query : string ) : any [ ] {
3939 return astq . query ( subtree , query ) ;
40- }
40+ } ,
4141 } ;
4242 const reactComponentName = getReactComponentName ( ast ) ;
4343 const importedPropTypes : ImportedPropTypes = {
4444 propTypesName : getPropTypesName ( ast ) ,
45- propTypes : getImportedPropTypes ( ast )
45+ propTypes : getImportedPropTypes ( ast ) ,
4646 } ;
4747 const importedTypes = getInstanceOfPropTypes ( ast , importedPropTypes ) ;
4848 const importStatements = getImportStatements (
@@ -53,15 +53,15 @@ export function createTypings(
5353 const componentNames = getUniqueNames ( [
5454 ...getComponentNamesByPropTypeAssignment ( ast ) ,
5555 ...getComponentNamesByStaticPropTypeAttribute ( ast ) ,
56- ...getComponentNamesByJsxInBody ( ast )
56+ ...getComponentNamesByJsxInBody ( ast ) ,
5757 ] ) ;
5858 const tripleSlashDirectives : dom . TripleSlashDirective [ ] = [ ] ;
5959 const m = dom . create . module ( moduleName || 'moduleName' ) ;
6060
6161 m . members . push ( dom . create . importAll ( 'React' , reactImport ) ) ;
6262
6363 if ( importStatements . length > 0 ) {
64- importStatements . forEach ( importStatement => {
64+ importStatements . forEach ( ( importStatement ) => {
6565 if ( importStatement . name === undefined ) {
6666 m . members . push (
6767 dom . create . importDefault ( importStatement . local , importStatement . path )
@@ -71,7 +71,7 @@ export function createTypings(
7171 }
7272 } ) ;
7373 }
74- componentNames . forEach ( componentName => {
74+ componentNames . forEach ( ( componentName ) => {
7575 const exportType = getComponentExportType ( ast , componentName ) ;
7676 const propTypes = getPropTypes ( ast , componentName ) ;
7777 if ( exportType ) {
@@ -89,7 +89,7 @@ export function createTypings(
8989 } ) ;
9090
9191 if ( moduleName === null ) {
92- return m . members . map ( member => dom . emit ( member ) ) . join ( '' ) ;
92+ return m . members . map ( ( member ) => dom . emit ( member ) ) . join ( '' ) ;
9393 } else {
9494 return dom . emit ( m , { tripleSlashDirectives } ) ;
9595 }
@@ -196,7 +196,7 @@ function createPropTypeTypings(
196196 / ObjectProperty
197197 `
198198 ) ;
199- res . forEach ( propertyAst => {
199+ res . forEach ( ( propertyAst ) => {
200200 const typeDecl = types . get (
201201 ast ,
202202 propertyAst . value ,
@@ -217,9 +217,9 @@ function createPropTypeTypings(
217217 } ;
218218 property . jsDocComment = ( propertyAst . leadingComments [ 0 ] . value as string )
219219 . split ( '\n' )
220- . map ( line => line . trim ( ) )
221- . map ( line => line . replace ( / ^ \* \* ? / , '' ) )
222- . map ( line => line . trim ( ) )
220+ . map ( ( line ) => line . trim ( ) )
221+ . map ( ( line ) => line . replace ( / ^ \* \* ? / , '' ) )
222+ . map ( ( line ) => line . trim ( ) )
223223 . filter ( trimLines ( ) )
224224 . reverse ( )
225225 . filter ( trimLines ( ) )
@@ -235,7 +235,7 @@ function extractComplexTypes(
235235 interf : dom . InterfaceDeclaration ,
236236 componentName : string
237237) : void {
238- interf . members . forEach ( member => {
238+ interf . members . forEach ( ( member ) => {
239239 if ( member . kind === 'property' && isExtractableType ( member . type ) ) {
240240 const name = `${ componentName } ${ pascalCase ( member . name ) } ` ;
241241 const extractedMember = createModuleMember ( name , member . type ) ;
@@ -371,7 +371,7 @@ function getImportedPropTypes(ast: AstQuery): ImportedPropType[] {
371371 )
372372 . map ( ( { imported, local } ) => ( {
373373 importedName : imported . name ,
374- localName : local . name
374+ localName : local . name ,
375375 } ) ) ;
376376}
377377
@@ -400,7 +400,7 @@ function getInstanceOfPropTypes(
400400 /:arguments *
401401 ` ) ;
402402
403- return res . map ( identifer => identifer . name ) ;
403+ return res . map ( ( identifer ) => identifer . name ) ;
404404}
405405
406406interface ImportStatement {
@@ -414,7 +414,7 @@ function getImportStatements(
414414 instanceOfResolver : InstanceOfResolver | undefined
415415) : ImportStatement [ ] {
416416 return typeNames
417- . map ( name => {
417+ . map ( ( name ) => {
418418 const res = ast . query ( `
419419 // ImportDeclaration[
420420 /:specifiers * /:local Identifier[@name == '${ name } ']
@@ -426,10 +426,10 @@ function getImportStatements(
426426 ? res [ 0 ] . specifiers [ 0 ] . imported . name
427427 : undefined ,
428428 local : name ,
429- path : res . length > 0 ? res [ 0 ] . source . value : undefined
429+ path : res . length > 0 ? res [ 0 ] . source . value : undefined ,
430430 } ;
431431 } )
432- . map ( importStatement => {
432+ . map ( ( importStatement ) => {
433433 if ( importStatement && instanceOfResolver ) {
434434 const resolvedPath = importStatement . name
435435 ? instanceOfResolver ( importStatement . name )
@@ -440,7 +440,7 @@ function getImportStatements(
440440 }
441441 return importStatement ;
442442 } )
443- . filter ( importStatement => Boolean ( importStatement . path ) ) ;
443+ . filter ( ( importStatement ) => Boolean ( importStatement . path ) ) ;
444444}
445445
446446function getComponentNamesByPropTypeAssignment ( ast : AstQuery ) : string [ ] {
@@ -452,7 +452,7 @@ function getComponentNamesByPropTypeAssignment(ast: AstQuery): string[] {
452452 ]
453453 ` ) ;
454454 if ( res . length > 0 ) {
455- return res . map ( match => match . object . name ) ;
455+ return res . map ( ( match ) => match . object . name ) ;
456456 }
457457 return [ ] ;
458458}
@@ -464,7 +464,7 @@ function getComponentNamesByStaticPropTypeAttribute(ast: AstQuery): string[] {
464464 ]
465465 ` ) ;
466466 if ( res . length > 0 ) {
467- return res . map ( match => ( match . id ? match . id . name : '' ) ) ;
467+ return res . map ( ( match ) => ( match . id ? match . id . name : '' ) ) ;
468468 }
469469 return [ ] ;
470470}
@@ -483,7 +483,7 @@ function getComponentNamesByJsxInBody(ast: AstQuery): string[] {
483483 ]
484484 ` ) ;
485485 if ( res . length > 0 ) {
486- return res . map ( match => ( match . id ? match . id . name : '' ) ) ;
486+ return res . map ( ( match ) => ( match . id ? match . id . name : '' ) ) ;
487487 }
488488 return [ ] ;
489489}
0 commit comments