From 1e3d31165a5c8afb420b55e01a6e22b5f704e46a Mon Sep 17 00:00:00 2001 From: Ivan Popelyshev Date: Thu, 3 Jan 2019 04:52:25 +0300 Subject: [PATCH 1/3] `readonly` should go after visibility modifier --- src/create_helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/create_helpers.ts b/src/create_helpers.ts index 3a005cc..74f0d53 100644 --- a/src/create_helpers.ts +++ b/src/create_helpers.ts @@ -256,9 +256,6 @@ export function createClassMember(doclet: IMemberDoclet): ts.PropertyDeclaration const mods: ts.Modifier[] = []; const type = resolveType(doclet.type, doclet); - if (doclet.kind === 'constant' || doclet.readonly) - mods.push(readonlyModifier); - if (doclet.scope === 'static') mods.push(ts.createModifier(ts.SyntaxKind.StaticKeyword)); @@ -269,6 +266,9 @@ export function createClassMember(doclet: IMemberDoclet): ts.PropertyDeclaration else if (doclet.access === 'public') mods.push(ts.createModifier(ts.SyntaxKind.PublicKeyword)); + if (doclet.kind === 'constant' || doclet.readonly) + mods.push(readonlyModifier); + return handleComment(doclet, ts.createProperty( undefined, // decorators mods, // modifiers From d474adcfe6069de7e75d7e74c3e07d6dd9b7f8e9 Mon Sep 17 00:00:00 2001 From: Ivan Popelyshev Date: Thu, 3 Jan 2019 04:56:18 +0300 Subject: [PATCH 2/3] and static too. --- src/create_helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/create_helpers.ts b/src/create_helpers.ts index 74f0d53..970327c 100644 --- a/src/create_helpers.ts +++ b/src/create_helpers.ts @@ -256,9 +256,6 @@ export function createClassMember(doclet: IMemberDoclet): ts.PropertyDeclaration const mods: ts.Modifier[] = []; const type = resolveType(doclet.type, doclet); - if (doclet.scope === 'static') - mods.push(ts.createModifier(ts.SyntaxKind.StaticKeyword)); - if (doclet.access === 'private') mods.push(ts.createModifier(ts.SyntaxKind.PrivateKeyword)); else if (doclet.access === 'protected') @@ -266,6 +263,9 @@ export function createClassMember(doclet: IMemberDoclet): ts.PropertyDeclaration else if (doclet.access === 'public') mods.push(ts.createModifier(ts.SyntaxKind.PublicKeyword)); + if (doclet.scope === 'static') + mods.push(ts.createModifier(ts.SyntaxKind.StaticKeyword)); + if (doclet.kind === 'constant' || doclet.readonly) mods.push(readonlyModifier); From e775c8b83811b159cab4946f1d2eb2f105507d12 Mon Sep 17 00:00:00 2001 From: Ivan Popelyshev Date: Thu, 3 Jan 2019 05:19:00 +0300 Subject: [PATCH 3/3] found one more --- src/create_helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/create_helpers.ts b/src/create_helpers.ts index 970327c..875db48 100644 --- a/src/create_helpers.ts +++ b/src/create_helpers.ts @@ -171,9 +171,6 @@ export function createClassMethod(doclet: IFunctionDoclet): ts.MethodDeclaration if (!doclet.memberof) mods.push(declareModifier); - if (doclet.scope === 'static') - mods.push(ts.createModifier(ts.SyntaxKind.StaticKeyword)); - if (doclet.access === 'private') mods.push(ts.createModifier(ts.SyntaxKind.PrivateKeyword)); else if (doclet.access === 'protected') @@ -181,6 +178,9 @@ export function createClassMethod(doclet: IFunctionDoclet): ts.MethodDeclaration else if (doclet.access === 'public') mods.push(ts.createModifier(ts.SyntaxKind.PublicKeyword)); + if (doclet.scope === 'static') + mods.push(ts.createModifier(ts.SyntaxKind.StaticKeyword)); + if (doclet.name.startsWith('exports.')) doclet.name = doclet.name.replace('exports.', '');