Force esdoc to process non ES6 code
See original GitHub issueI understand that esdoc is designed for ES6. And I code in ES6 as much as I can, but Node does not implement import
.
I’ve read #168 but still don’t know how to force esdoc to document something like this:
module.exports =
{
/**
* Main function of the module blablabla
*/
doStuff: function()
{
// do stuff
}
};
I don’t think a plugin-feature may help here. Isn’t there a “tag” or something that tells esdoc “please process this”?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:13 (5 by maintainers)
Top Results From Across the Web
javascript - Using non ES6 Code in ES6 Module environment
Always get markerclustererplus is not defined. I saw there is an ES6 Cluster Module, but I need markerclustererplus . package.json
Read more >Read Setting up ES6
Configuring Babel. Setting up ES6 projects that are compiled to ES5 via Babel: Deploying ES6 in browsers via Babel and webpack. Deploying ES6...
Read more >Manual | ESDoc
ESDoc supports ES class syntax and targets codes that are written by it. ES class syntax makes the clear relation of class, method,...
Read more >strictNullChecks - TSConfig Option
When strictNullChecks is false , null and undefined are effectively ignored by the language. This can lead to unexpected errors at runtime.
Read more >Type Safe JavaScript with JSDoc
Instead we'll use it to check the types of our JavaScript code during code time using JSDocs comments and type inference. So there'll...
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 Free
Top 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
Sorry for late reply.
I don’t have plan to support
require/module.exports
. However you can use esdoc-node that is third party plugin for it. And you may solves your problems.I’m having difficulty with this too.
I’m working on modern Node modules that use native ES6 support in Node 6+ (which is now the long-term-support version of Node encouraged for all Node developers to use: https://nodejs.org).
I don’t want the added overhead and complexity of Babel just for documentation. I would like to use ESDoc, but for now it doesn’t seem to be an option for me because it doesn’t understand
require()
andmodule.exports
.I’d be happy to write more annotations in my ESDoc comments to give it the hints it needs to document my code, but this doesn’t seem to be possible right now. For comparison, JSDoc has tags like
@class
and@function
. JSDoc doesn’t actually support most ES6 syntax yet, but I am able to make it work well enough by using these tags to explicitly document syntax structures it does not understand.TL;DR - JSDoc currently works better for my native Node 6 / ES6 code, so I’ll keep using that for now. However, I am interested in ESDoc and I’ll reevaluate it periodically.