* Use reference links in Markdown.
Fixes https://github.com/documentationjs/documentation/issues/948.
This approach might be problematic when inserting markdown under a readme heading if the readme already has link references with conflicting ID’s.
* Reference links edits:
- fix broken normalize() utility in test suite so that it produces
output that doesn't choke referenceLinks.
- add DocumentationConfig option `--noReferenceLinks` which will be
**internal only**, and turns off reference links for `readme` mode
- rebuilds test output with these changes
unrelated but minor
- includes .prettierrc and updates calls to prettier to use that instead
of CLI options
* chore: update test snapshots
* Update readme snap
* github link to typedef points to comment lines
* adding test for typedef github links
* adding comment.loc for flow check
* reverting to original formatting
* use afterEach to restore mock even if tests fail
* fixing line numbers in expected value
The previous support for @name tags suppressing inference from
surrounding code was ad-hoc and incomplete. This commit makes a @name
tag (or a tag acting as a @kind/@name shorthand combo, like @function)
detach the `ast` field from the comment context, so that the surrounding
code will be universally ignored per the JSDoc spec.
Per usejsdoc.org, this tag goes either in a comment attached to a
function that has declared that function to be a class, or in a comment
on an ES6 class constructor.
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.
Fixes#850. Fixes#731. Fixes#702. Fixes#132.
* build: Use Flow syntax without comments.
We're switching to Flow annotations - not Flow comments. This
gives documentation.js the ability to self-document without
JSDoc types and improves our compatibility with tools like
prettier.
Fixes#729. Fixes#709
This will flag cases where people explicitly document things in JSDoc that don't reflect the code
reality - in many cases, misnamed parameter names in documentation tags.
Fixes https://github.com/documentationjs/documentation/issues/575
* refactor(nest): Better nesting implementation
This nesting implementation uses a proper recursive tree algorithm
Fixes https://github.com/documentationjs/documentation/issues/554
BREAKING CHANGE: referencing inferred destructure params without
renaming them, like $0.x, from JSDoc comments will no longer
work. To reference them, instead add a param tag to name the
destructuring param, and then refer to members of that name.
Before:
```js
/**
* @param {number} $0.x a member of x
*/
function a({ x }) {}
```
After:
```js
/**
* @param {Object} options
* @param {number} options.x a member of x
*/
function a({ x }) {}
```
* Address review comments
* Reduce testing node requirement back down to 4
* Don't output empty properties, reduce diff noise
* Rearrange and document params
* Simplify param inference, update test fixtures. This is focused around Array destructuring: documenting destructured array elements with indices instead of names, because the names are purely internal details
* Use temporary fork to get through blocker
* Add support for interface declarations
* Support exported interfaces/type aliases
* Update test fixtures
* Add interface type, fix test
* Fix comment style and typo
* fix(scopes): Support inner scope
The purpose and usage of inner is still unclear, unfortunately, so this is an interim fix at best.
Fixes https://github.com/documentationjs/documentation/issues/652
* Improve comment typedef while we're at it
* feat(core): Switch to Promises everywhere. Adopt Node v4 ES6
Big changes:
* Uses template strings where appropriate
* Config and argument parsing is unified and there is no such thing
as formatterOptions anymore. All user-passed options go through
mergeConfig.
* The node API surface changed (again): `buildSync` is removed,
building operations return Promises.
* Now using Flow for internal type annotations.
More changes:
* Remove buildSync command
* feat(inference): Partially implement object shorthand support
* Refs #649
* Use Flow annotations to enforce types
* Keep flow but switch to comment syntax
* Clarify types
* More flow improvements
* Turn server into class
* LinkerStack becomes class too
* Fix comment description type
* Run flow on lint
* Many more flow fixes
* More intense flow refactoring
* Simplify inference steps
* Update inference tests, flow errors down to 1
* Continue refining types
* Fix more flow issues
* Use 'use strict' everywhere
* Make 'ast' property configurable
* Fix many tests
* Fix more tests
* Fix more tests
* Fix augments
* Test Markdown meta support
* Improve test coverage
* Switch back from for of to for for speed