18 Commits

Author SHA1 Message Date
Devon Govett
3773e02949 feat: TypeScript support & inference 2019-04-25 08:13:33 -07:00
Yicheng (Jerry) Gong
15bbc063da Adding additional cli option, markdown-toc-max-depth for configuring markdown-toc maxDepth (#1215) 2019-03-12 11:42:43 -07:00
Hugo Dias
ddd675dba0 feat: add support for node resolve algo 2018-10-24 11:07:05 -07:00
Tom MacWright
0d629d6dec test: Update Flow annotations for improved analysis 2018-04-11 09:34:40 -07:00
Tom MacWright
ab494dd1b3
feat: use reference links for Markdown output, improving brevity
* 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
2018-03-01 15:18:20 -08:00
Bob Lannon
37a91b2199 fix: github links for @typedef comments should link to comment, not context (#1024)
* 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
2018-03-01 12:01:35 -08:00
Ryan Hendrickson
a04b6fd61d fix: @name tag disconnects comment (#897)
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.
2017-09-03 23:44:55 -07:00
Ryan Hendrickson
7a07d5118d feat: implement @hideconstructor (#898)
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.
2017-09-03 23:07:13 -07:00
Tom MacWright
5b373ff2fe revert(polyglot): Remove polyglot mode
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.
2017-07-27 13:58:49 -04:00
Anton
ea69608e92 fix: Report nesting errors instead of throwing them as errors
Check on parent element: foo.bar sub-parametr should be documeted with parent.
Fixed #832 issue
2017-07-07 15:37:26 -04:00
Tom MacWright
11d9045a00 Native Flow, use Jest (#767)
* 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
2017-05-08 20:46:21 -04:00
Tom Macwright
ed5c2a04a4 feat(lint): Identify explicit tags that don't match inference in lint stage
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
2017-05-01 14:26:00 -04:00
Tom MacWright
a15b0716fe refactor: Move index.js to lib (#744)
Fixes https://github.com/documentationjs/documentation/issues/736
2017-04-21 17:50:09 -04:00
Tom MacWright
73747306a0 refactor(nest): Better nesting implementation (#732)
* 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
2017-04-21 17:28:53 -04:00
Tom MacWright
e2915dc19c feat(core): Support Flow interface declarations
* Add support for interface declarations

* Support exported interfaces/type aliases

* Update test fixtures

* Add interface type, fix test

* Fix comment style and typo
2017-04-10 13:14:04 -04:00
Tom MacWright
f07285a920 feat(markdown): Add @see tag output in Markdown (#682)
Refs https://github.com/documentationjs/documentation/issues/673
2017-02-24 16:33:12 -05:00
Tom MacWright
8cc34b661f fix(scopes): Support inner scope (#665)
* 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
2017-01-29 18:35:19 -05:00
Tom MacWright
631c6925d4 feat(core): Switch to Promises everywhere. Adopt Node v4 ES6 (#648)
* 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
2017-01-27 16:14:19 -05:00