Skip to content

Fixed Typescript template bugs and linting for publishing in definitely typed repo #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Templates/TypeScript/src/entity_types.ts.tt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
var enumTypes = model.GetEnumTypes();
var complexTypes = model.GetComplexTypes();
#>
// Type definitions for the Microsoft Graph API
// Type definitions for the Microsoft Graph <VERSION_STRING>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the intention of <VERSION_STRING>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the version for definitely typed repo should be mentioned like this, <VERSION_STRING> is a place holder string, we will replace this string with version before publishing.

// Project: https://github.com/microsoftgraph/msgraph-typescript-typings
// Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph>

<#= writer.WriteHeader() #>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1

export as namespace microsoftgraph;

<# foreach(var enumType in enumTypes) { #>
export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValues() #>
export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValues() #>;
<# } #>
<#
foreach(var entityType in entityTypes)
Expand All @@ -28,13 +28,11 @@ export type <#= enumType.Name.UpperCaseFirstChar() #> = <#= enumType.GetEnumValu
#>

export interface <#= entityType.Name.UpperCaseFirstChar() #><# if (entityType.Base != null) { #> extends <#= entityType.Base.Name.UpperCaseFirstChar() #><# }#> {

<# foreach(var prop in entityType.Properties.ToList()) { #>
<# if (prop.LongDescription != null || prop.Description != null) { #>
/** <#=prop.GetSanitizedLongDescription()#> */
<# } #>
<#= prop.Name #>?: <#= prop.GetTypeString() #>

<#= prop.Name #>?: <#= prop.GetTypeString() #>;
<# } #>
}
<#
Expand All @@ -45,13 +43,11 @@ export interface <#= entityType.Name.UpperCaseFirstChar() #><# if (entityType.Ba
{
#>
export interface <#= complexType.Name.UpperCaseFirstChar()#><# if (complexType.Base != null) { #> extends <#= complexType.Base.Name.UpperCaseFirstChar() #><# }#> {

<# foreach(var prop in complexType.Properties) { #>
<# if (prop.LongDescription != null || prop.Description != null) { #>
/** <#=prop.GetSanitizedLongDescription()#> */
<# } #>
<#= prop.Name #>?: <#= prop.GetTypeString() #>

<#= prop.Name #>?: <#= prop.GetTypeString() #>;
<# } #>
}
<# } #>