Skip to content

Commit

Permalink
fix(docgen): typescript: eslint problems in the generator
Browse files Browse the repository at this point in the history
  • Loading branch information
drauggres committed Dec 18, 2019
1 parent f69c475 commit 618a379
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/titanium-docgen/generators/typescript_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class DocsParser {
const parentNamespaceName = namespaceParts.join('.');
let parentNamespace = null;
if (!this.tree.hasNamespace(parentNamespaceName)) {
let namespacePathFromRoot = [];
const namespacePathFromRoot = [];
namespaceParts.forEach(namespaceName => {
namespacePathFromRoot.push(namespaceName);
const subordinateNamespaceName = namespacePathFromRoot.join('.');
Expand Down Expand Up @@ -444,7 +444,7 @@ class GlobalTemplateWriter {
*/
generateJsDoc(node, nestingLevel) {
let jsDoc = `${this.indent(nestingLevel)}/**\n`;
let summary = node.summary.replace(/\s?\n/g, `\n${this.indent(nestingLevel)} * `);
const summary = node.summary.replace(/\s?\n/g, `\n${this.indent(nestingLevel)} * `);
jsDoc += `${this.indent(nestingLevel)} * ${summary}\n`;
jsDoc += `${this.indent(nestingLevel)} */\n`;
if (node instanceof InterfaceNode && node.name === 'IOStream') {
Expand Down Expand Up @@ -598,7 +598,7 @@ class FunctionNode {
this.name = functionDoc.name;
if (functionDoc.returns) {
if (Array.isArray(functionDoc.returns)) {
this.returnType = functionDoc.returns.map(type => type.type);
this.returnType = functionDoc.returns.map(type => type.type);
} else {
this.returnType = functionDoc.returns.type;
}
Expand Down Expand Up @@ -707,7 +707,7 @@ class MemberNode {

// Filter out create functions for constant only proxies
if (/^create/.test(methodDoc.name)) {
const returnType = methodDoc.returns;
const returnType = methodDoc.returns;
const returnTypeName = Array.isArray(returnType) ? returnType[0].type : returnType.type;
const returnTypeDoc = parser.apis[returnTypeName];
if (returnTypeDoc && isConstantsOnlyProxy(returnTypeDoc)) {
Expand Down Expand Up @@ -759,7 +759,7 @@ class MemberNode {
}

let parameterOverloads = [];
for (let type of parameter.type) {
for (const type of parameter.type) {
if (dictionaryTypePattern.test(type)) {
const anyOverloadDoc = JSON.parse(originalMethodDocJsonString);
anyOverloadDoc.parameters[i].type = 'any';
Expand Down

0 comments on commit 618a379

Please sign in to comment.