* Add support for interface declarations
* Support exported interfaces/type aliases
* Update test fixtures
* Add interface type, fix test
* Fix comment style and typo
- Tags with `@lends` are now filtered out early on, so they never
generate documentation. Lends tags are structural hints only.
- Uses built-in type checks instead of babel-types where appropriate.
- More internal documentation
- Now reuses code for parsing lends between different forms
Previously broken syntax, now working:
```js
/** parent */
export default function() {
/** child */
this.a = 1;
}
```
This allows `type T = number => string`. Previously we were only
handling `type T = (x: number) => string` correctly.
Followup to #672 that:
- Adds a test fixture
- Fixes lint errors
If no parameter name exists in a function type, then set it to empty. Also,
fix the formatter so that `{param}: {ty}` is formatted as `{ty}` when
`{param}` is empty.
Fixes#671
* 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
Adds a new option, `--no-markdown-toc`, to turn off Table of Contents generation. Table of contents are now generated by default with markdown output, including through the `readme` command.
Fixes https://github.com/documentationjs/documentation/issues/220
This brings logic from eslint over to documentation: instead of readdirSync, we're using the glob
module. This also, I hope, will let us support globs on Windows without changing OSX/Linux behavior.
Fixes#607
With `--document-exported` we used to only support
```js
export default Declaration
```
and
```js
export default IdentifierExpression
```
With this change we generate a comment for all default exports.
Fixes#543
Fixes#598
This _changes behavior_: previously in the case of
```js
/** base */
var Foo = function Bar() {
{
/** */
this.baz = 0;
}
};
```
We assigned baz to Bar. Now we will assign Baz to Foo. I believe this is
right, since in JavaScript Bar is not actually bound in this code.
When we find the binding for an export we get the VariableDeclarator.
It is common for people to write their JSDoc comment on the parent
VariableDeclaration so we check that in case there is no comment on the
declarator.
Fixes#570
For `--document-exported` we now use Node.js's `require.resolve`
method to resolve the path for modules referenced by other modules.
This fixes issues where we failed to load imported modules which lead to
a null comment being attached which caused an exception.
* 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;
```