question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Force esdoc to process non ES6 code

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
h13i32marucommented, Dec 27, 2016

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.

0reactions
adamjmurraycommented, Nov 3, 2016

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() and module.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found