esdoc / esdoc

ESDoc - Good Documentation for JavaScript
https://esdoc.org
MIT License
2.74k stars 205 forks source link

ESDoc not able to generate documentation if React render method has a JSX comment #465

Open karanbajaj2209 opened 6 years ago

karanbajaj2209 commented 6 years ago
Hello,

I am not able to create documentation for the React render method if it contains a JSX comment.

=== JSX comment example ===
{/* Test Coment */}

Is there any configuration by which I can ignore these comments and generate comments for the render method?

=== Render method example ===
/**
 * render is a react lifecycle method.
 * @access private
 * @return {ReactElement} HTML
*/
render () {
        let _this = this;
        return (
            <div>
                {/* Test Coment */}
             </div>
        )
}

=== ESDOC json config file ===
{
  "source": "src",
  "destination": "docs",
  "includes": ["\\.(js|jsx)$"],
  "plugins": [
    {
      "name": "esdoc-standard-plugin",
      "option": {
        "lint": {"enable": false},
        "coverage": {"enable": true},
        "accessor": {
          "access": ["public", "protected"],
          "autoPrivate" : false
        },
        "undocumentIdentifier" : {"enable": false},
        "typeInference": {"enable": true},
      }
    },
    {
      "name": "esdoc-jsx-plugin", 
      "option": {"enable": true}
    },
    {
      "name": "esdoc-react-plugin", 
      "option": {"enable": true}
    },
    {
      "name": "esdoc-lint-plugin",
      "option": {"enable": true}
    }
  ]
}
MattMcFarland commented 6 years ago

Hi, yeah right now react isnt really supported with esdoc, we could add that as a feature to use react-docgen or something, similar to react-styleguidist.

Personally I would recommend documenting react code with react-styleguidist instead of esdoc, - but this could be a nice feature (its just react-styleguidist does react component documentation sooo well)