* Add test for memberof normalization: @memberof Foo#, @memberof Foo.prototype
* Add memberof normalization for @memberof Foo#, @memberof Foo.prototype
* Add test to infer membership of properties defined inside constructor
* Added inference of membership for properties defined inside constructor
* Fix Membership spelling, switch let for var to keep node compat broad
* Change memberof normalization to use RegExp
This improves detection of cases where we have:
```js
export const f = function () {};
export const o = { ... };
```
and similarly indirection using default/named.
```js
const f = function () {};
export {f};
```
Fixes#543
This infers the type from Flow type annotations for variable
declarations and class properties.
This also moves the logic for setting the `type` for typedefs
to the same type inferrer.
Also infer the type for statements like:
```js
const x = 42;
```
same as:
```js
const x: number = 42;
```
* Change document-exported to traverse the code
Instead of traversing over all input files this changes
documentExported to traverse from the exports in the input files,
loading, parsing and traversing the module specifier as needed.
Fixes#515
* Move parseToAst to its own module
* Skip non export declarations for speed
Valid values for the `--sort-order` flag are `"source"` (default) and
`"alpha"`. When set to `"alpa"` the order of the entries in the docs
are sorted alphabetically.
Fixes#534
When doing `--shallow --watch` we called `generator` (which
synchronously called `updateWatcher`/`addNewFiles`) but the watcher has
not been created yet. Instead create the watcher first before
`generator` is called.
Fixes#531
* Adds test support for flow difference
* New support for FunctionTypeAnnotation
* New support for ObjectTypeAnnotation
* New support for MixedTypeAnnotation
* Add the type property to typedef comments
When using Flow type aliases we didn't add the `type` property
to the JSDoc comment for the inferred `typedef`.
Fixes#516
* Rename files and update test expectations
When inferring the membership of a class that is an unnamed default
export we hit a null pointer exception.
```js
export default class {
/** */
member() {}
}
```
Inferring the name for the class above fails
Fixes#506
* Fix issue where exported declarations did not set the kind
For cases like:
```js
/** */ export class C {}
/** */ export function f {}
/** */ export const k = 42;
```
the kind did not get set properly.
Towards #484
* Infer kind for export default too
Towards #484
If a binding name is provided we should use that in the documentation.
For example:
```js
// test.js
/** */
export default function find() {}
```
Should use the name `find` and not `test`.
Fixes#504
* Add a flag to document all exported bindings
This adds a boolean flag called `document-exported` (defaults to false)
that effectively adds an empty comment to all exported bindings that do
not already have a JSDoc comment. It also does the same for the
members of exported classes and objects.
```js
export class C {
method() {}
}
```
Both `C` and `C#method` are now part of the generated documentation.
Related to #424
* Fix lint error
* Rebase and use options pragma in test file
* Create extractor type as a generalized comment/export getter
* Document exported extractor
Also:
* Fixes many issues in the default theme
* Moves the default theme from default-theme to default_theme
* Creates a new, robust linker infrastructure that will support
bare links
* Replaces slugg with github-slugger
* Outputs unknown types as Any. Fixes#451
When using `--config configuration.yml` with narrative sections, `documentation build` crashes with `TypeError: Cannot read property 'github' of undefined` (regardless if `--github` is passed or not). Verify that the `comment.context` object exists before reading its properties.