jsdoc / jsdoc/jsdoc

ES6 import with brackets makes first variable not documented

Open
#1,718 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
15.5k
Forks
1.5k
Avg merge
10d 23h
Merged PRs (30d)
1

Description

Input code
import {b} from 'b'

/** x */
const x = 0

/** y */
const y = 0

JSDoc debug output
DEBUG: JSDoc 3.6.3 (Sun, 14 Jul 2019 17:01:26 GMT)
DEBUG: Environment info: {"env":{"conf":{"plugins":[],"recurseDepth":10,"source":{"includePattern":".+\\.js(doc|x)?$","excludePattern":"(^|\\/|\\\\)_"},"sourceType":"module","tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}}},"opts":{"_":["."],"debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["%PROJECT_DIRECTORY%\\a.js","%PROJECT_DIRECTORY%\\b.js"]
Parsing %PROJECT_DIRECTORY%\a.js ...
Parsing %PROJECT_DIRECTORY%\b.js ...
DEBUG: Finished parsing source files.
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing complete.
Generating output files...
Finished running in 0.60 seconds.

Expected behavior

Both x and y should be documented.

Current behavior

x is not documented. Only the first declaration (variables, functions) in file is not documented.

This doesn't happen when I write import b from 'b'. Bracket seems to break something, I suppose?

Or am I doing something wrong?

Your environment
Software Version
JSDoc 3.6.3
Node.js 8.10.0
npm 5.10.0
Operating system Windows 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run JSDoc 3.6.3 against the provided JavaScript snippet and compare the generated documentation for x and y with the import written using brackets versus a default import. Trace the parsing path for the import form, then verify that both declarations are documented in the generated output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.