Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESDoc doesn't parse comment after object containing other objects without a ; at the end #549

Open
1 of 5 tasks
BarbourSmith opened this issue Aug 1, 2019 · 2 comments
Open
1 of 5 tasks

Comments

@BarbourSmith
Copy link

Make sure these boxes are checked before submitting your issue - thank you!
(If your issue is neither a both bug nor a request, please write in a free style)

Short summary of your issue

ESdoc requires a semicolon after an object containing objects before it will recognize the documentation of the next line.

Input data for reproducing

Configuration

{
  "source": "./src",
  "destination": "./dist/documentation",
  "excludes": ["lib"],
  "plugins": [{"name": "esdoc-standard-plugin"}]
}

Codes

/** 
 * A description.
 * @type {object}
 */
this.materialProperties = {
    paper: {
        roughness: 0.5,
        metalness: 0.0,
        reflectivity: 0.5
    },
    wood: {
        roughness: 0.5,
        metalness: 0.0,
        reflectivity: 0.5
    },
    metal: {
        roughness: 0.5,
        metalness: 0.5,
        reflectivity: 0.9,
        clearCoat: 1,
        clearCoatRoughness: 0
    },
    glass: {
        roughness: 0.5,
        metalness: 0.5,
        reflectivity: 0.9,
        clearCoat: 1,
        clearCoatRoughness: 0,
        opacity: 0.5,
        transparent: true
    }
}

/** 
 * The camera which controls how the scene is rendered.
 * @type {object}
 */
this.camera = new THREE.PerspectiveCamera(27, window.innerWidth / window.innerHeight, 1, 10500);

What happens is that this.camera is not documented unless there is a ';' after this.materialProperties. The tricky thing is that if I put the semi colon there, then my pull request fails lint because the project stipulates no semicolons so I either fail lint or fail for not having documented.

What should I do?

Screen shot of documentation

image

Your environment

  • Windows 10
  • Node v12.7.0 (but also tested on V10)
@mstruensee
Copy link

try putting @desc in front of The camera which controls how the scene is rendered. and A description.

@BarbourSmith
Copy link
Author

Thanks for the suggestion @mstruensee . I gave that a go, but unfortunately no difference.

I think that for some reason the parser is relying on the semicolon to do the parsing and without the semicolon the comment isn't seen at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants