addConstructor throw error when class have an JSDOC at the end
See original GitHub issueDescribe the bug
Version: latest
To Reproduce
const { Project, StructureKind } = require("ts-morph");
const project = new Project({});
const classFile = project.createSourceFile("src/MyClass.ts", `
class Foo {
/**
*
*/
}
`);
const classNode = classFile.getClasses()[0];
classNode.addConstructor({
statements: "console.log('i am constructor');",
});
Expected behavior
no error
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Use JSDoc: @throws
The @throws tag allows you to document an error that a function might throw. You can include the @throws tag more than once...
Read more >Documenting TypeScript · Issue #272 · jsdoc/jsdoc - GitHub
I want to be able to comment the class and constructor separately, since 1) not all TypeScript classes have a constructor, and 2)...
Read more >Class: Exception - JSDoc
Constructs an Exception object that has the message specified. Parameters: Name, Type, Description. message, String, The message.
Read more >JSDoc document final method - javascript - Stack Overflow
Wait to create the method until your subclass constructor has already called the superclass constructor. Return an object created without using ...
Read more >JSDoc Reference - TypeScript: Documentation
You can also specify object literal types. For example, an object with properties 'a' (string) and 'b' (number) uses the following syntax:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @lazarljubenovic! I have been taking a bit of a break from working on ts-morph, but I will get back to it very soon. I’ll probably do a quick release to fix this bug over the weekend though.
I’ve gotta hijack this to tell you that I love how you explain the bug when you understand it, @dsherret! Keep up the great work maintaining the lib 😃