This file describes notable changes in each version of JSDoc 3.
Fixes a compatibility issue with Node.js 8.5.0. (#1438)
@hideconstructor
tag, the default template no longer displays the names of
parameters that the constructor accepts. (#1397)import
and export
declarations anywhere where a statement is allowed. (#1411)return
statements outside of functions. (#1411)super()
calls outside of a method definition. (#1411)STDOUT
pipe has been flushed. (#1408)/**
) are now ignored. (#1398)'use strict';
directive,
the comments are no longer ignored. (#1396)@
sign (for example, module:@prefix/my-module~myCallback
) are now
parsed correctly. (#1302)@alias
tag, the class's constructor now gets the
correct longname. (#1395)@hideconstructor
tag. (#1397)@alias
tag identifies an instance member (for example, @alias Foo#bar
), the alias is
now applied correctly. (#1385)@alias
tag is applied to a class that is within a module and is aliased to the module
name, the class's instance members are now documented correctly. (#1134)@param
tag uses the wrong delimiter to close the type expression (for
example, @param {Object)
). (#1221)@summary
tag. (#1149)JSDoc now uses the Babylon JavaScript parser, which means that JSDoc can parse any JavaScript or JSX file that is supported by the Babel compiler. For example, JSDoc can now parse JavaScript files that include all of the following language features:
You can now use a JavaScript file to configure JSDoc. The JavaScript file must be a CommonJS module that exports a single configuration object. See the documentation for details and examples.
Fixed multiple issues with documenting ES2015 classes and modules. See "Bug fixes" for details.
JSDoc now requires Node.js 4.2.0 or later.
Note: Third-party templates may not support these new tags.
@async
tag to indicate that a
function is asynchronous (that is, that it was declared with the syntax async function foo() {}
).
In general, you do not need to use this tag, because JSDoc autodetects asynchronous functions.
(#1188)@generator
tag to indicate
that a function is a generator function. In general, you do not need to use this tag, because JSDoc
autodetects generator functions. (#1158)@hideconstructor
tag to
tell JSDoc to hide a class's constructor from the documentation. (#952)@package
tag to indicate that a
symbol is package-private. (#962)@yields
tag to document the
value that is yielded by a generator function. (#1388)async function foo() {}
), and JSDoc autodetects when a function is asynchronous. (#1188)jsdocCommentFound
and symbolFound
events, the event now includes a columnno
property indicating the column number on which the comment or symbol was found. (#1362)sourceType
configuration option to control how JavaScript files are
parsed. The default value is module
. Set the value to script
to suppress implied strict mode;
this setting will also prevent you from using ES2015 modules. (#1210)recurseDepth
configuration option to control how many levels deep JSDoc
will recursively search for files. The default value is 10. (#1340)plugins/
or templates/
directory, JSDoc can now
discover plugins and templates in other directories. (#1081, #1308)@author
tag does not have a value. (#1289)process.exit()
when exiting. (#1287)Updated JSDoc's LICENSE.md
file.
tags.allowUnknownTags
may now contain an array of tag names that
should be allowed. (#1159){@link chat."#channel"}
. (#1035)plugins/
or templates/
directory, JSDoc can now
discover plugins and templates in other directories. (#1081)<h2>
and <h3>
elements.
(#1108)silent
template that generates no output. This template makes it easier to
use JSDoc as a linter to check for syntax errors and unrecognized tags in documentation comments.
(#1160)app
and env
global variables are now deprecated. Avoid using the app
global. Use the
jsdoc/env
module instead of the env
global. (#812)const
declarations are now automatically treated as constants. (#555)publish
method. (#953)#
and .
(for example, Foo.prototype['this#is#bar']
).
(#888)this
(for example, this['bar']
)
now get the correct longname. (#890)this.bar
) is documented within a member of a prototype
(for example, Foo.prototype.setBar
), the instance member's longname is now set correctly. (#1011)@borrows
tag now works with symbol names that contain whitespace. (#818)markdown.idInHeadings
to true
. (#1032)templates.default.useLongnameInNav
to true
. (#986)prototype
are now handled correctly. (#891)JSDoc no longer crashes when parsing a large number of files, or a single object that has a large number of properties. (#976)
{0: string}
), the
type expression is now parsed correctly. (#1016)@interface
and @implements
tags to document interfaces and their
implementations. (#720, #828)@inheritDoc
and @override
tags are now supported. (#53)@mixes
tag, all of the mixins now appear in the
symbol's documentation. (#378)--verbose
flag. (#416)-P/--package/
and -R/--readme
flags to specify the package and README file. (#708)--pedantic
flag to treat all errors as fatal errors, and to treat warnings
as errors. This flag replaces the --lenient
flag, which had roughly the opposite meaning and is no
longer available. (#416)-a/--access
flag to control whether private, protected, and public symbols
appear in the documentation. (#860, #861)--debug
flag to log detailed debugging information to the console. This
information can help you diagnose bugs in JSDoc itself. (#416)source.exclude
option in the configuration file. (#484)source.exclude
option now works correctly when JSDoc is run with the -r/--recurse
flag.
(#616)-r/--recurse
flag, it now scans for tutorials recursively. (#712)-X/--explain
option now runs much more quickly. (#633)@example
tag is indented, JSDoc now removes the extra indentation.
(#540)@param {Array.<string>} [foo=['bar']]
). (#640)@property {string} foo='bar'
). (#791)@type
tag includes a description (for example, @type {string} some text
), JSDoc now
parses the type expression correctly and discards the description. (#615)tags.dictionaries
option to ['closure']
. This option can contain the values
jsdoc
, closure
, or both. If multiple dictionaries are enabled, and a tag is defined in more than
one dictionary, JSDoc uses the definition from the first dictionary that contains the tag. (#729,
#730, #731, #732)overrides
property to the doclet that is
overriding another. The overrides
property contains the longname of the overridden symbol. (#792)type
object now includes a hidden
parsedType
property. The parsedType
property contains a syntax tree that represents the type
expression. The syntax tree is generated by Catharsis, and
its format may change in the future. (#576)id
attributes in output files are unique within that file. (#539)lib/jsdoc/schema.js
. (#327)allowUnknownTags
option is set to false
, JSDoc no longer logs warnings about the
presence of @also
and @scope
tags. (#574)module.exports
object can now be documented. (#500)Vector
in
V.Vector
), JSDoc now assigns the correct longname to the symbol. (#608)memberof
, longname
, and scope
properties. (#631)scope
property to global
for all global doclets. (#684)scope
property. (#782)Foo#bar(variation)
), the link text is now
preserved when generating HTML links. (#857)@class
, @classdesc
, and @constructor
tags, JSDoc no
longer ignores the value of the @classdesc
tag. (#806)@constant
, @external
, @member
,
@module
, @namespace
, and @param
), JSDoc now parses the tag correctly when it includes a type
but not a name. (#351, #535)@default
tag now works correctly when used with an array literal. (#604)@enum
tag now works correctly when the enumeration is part of a chain of assignments (for
example, var FOO = exports.FOO = {/* enumerated values */}
). (#702)@exports
and @module
tags now work correctly when their value includes a module:
namespace (for example, @exports module:foo
). (#786)@memberof
tag now works correctly when it refers to a module that is defined in a separate
file. (#880)@variation
tag now works correctly when its value is enclosed in parentheses (for example,
@variation (foo)
). (#850)mustNotHaveDescription
property. When this property is set to
true
, JSDoc will warn the user if the tag text includes a description (such as The description
in @param {string} foo - The description
). (#615)dictionary.normalize
, which is a synonym for
dictionary.normalise
. (#884){@link}
tags from working. (#518)@author
and @throws
tag values to HTML by default. (#736,
#878)summarize
plugin that automatically generates summaries based on the
description. (#485)underscore
plugin that finds symbols whose names begin with an underscore
and automatically tags them as @private
. (#471)doclet
property of newDoclet
events. (#584)layout.tmpl
, by setting the
templates.default.layoutFile
option in JSDoc's configuration file. The property can contain a
relative or absolute path to the replacement for layout.tmpl
. Relative paths are resolved against
the path to the configuration file; the current working directory; and the JSDoc directory, in that
order. (#480)templates.default.outputSourceFiles
option is set to false
, the documentation no
longer shows the path to each source file. (#571)templates.default.staticFiles.include
to list files that will be
copied to the output directory. For backwards compatibility, the property
templates.default.staticFiles.paths
is also supported but is deprecated. (#785)templates.default.staticFiles.include
now works correctly when an absolute path is
specified. (#939)templates.default.staticFiles
options now work correctly on Windows. (#785)templates.default.includeDate
to false
. (#910)module.exports
, the value of the @classdesc
tag now appears in
the documentation. (#740)module.exports
, and the constructor inherits from another class,
the parent class is now listed in the documentation. (#594)@example
tag, including HTML tags, is now properly escaped. (#511)@fires
tag, the tag information now appears in the documentation. (#568)@mixin
tag, the mixins are now listed in the documentation.
(#379, #602)@param
tags are used to document properties of array values (for example,
@param {Object[]} foo
and @param {string} foo[].bar
), the properties are now grouped into the
appropriate row of the parameters table. (#870)@requires
tag, the tag information now appears in the documentation. (#563)module.exports
, the documentation now displays all of
the signatures for the overloaded function. (#727)...!string
(a repeatable, non-nullable string) is now parsed correctly. (#502)prototype
, the parameter is no longer renamed during
parsing. (#505)processingComplete
event after JSDoc has completed all
post-processing of the parse results. This event has a doclets
property containing an array of
doclets. (#421)parseComplete
event, the event now includes a doclets
property
containing an array of doclets. (#431)source.exclude
option. Relative
paths will be resolved relative to the current working directory. (#405)@default
tag, and its default value is an object literal, this value is now
stored as a string, and the doclet will have a defaultvaluetype
property containing the string
object
. This change enables templates to show the default value with appropriate syntax
highlighting. (#419){@link}
tags can now contain newlines. (#441)#!/usr/bin/env node
),
the hashbang is now ignored when the file is parsed. (#499)let
. (#477)function[]
is now parsed correctly. (#493)@module
and @param
, if a hyphen is used to separate the
name and description, the hyphen must appear on the same line as the name. This change prevents a
Markdown bullet on the followng line from being interpreted as a separator. (#459)@param
tag with an invalid type expression no longer causes a
crash. (#448)@requires
tag can now contain an inline tag in its tag text. (#486)@returns
tag can now contain inline tags even if a type is not specified. (#444)@returns
tag with no value no longer causes a crash. (#451)@type
tag now works correctly with type expressions that span multiple lines. (#427){@link}
tags preceded by bracketed link text (for example,
[test]{@link Test#test}
), HTML links are now generated correctly even if the string contains other
bracketed text. (#470)templates.default.outputSourceFiles: false
to your conf.json
file. (#454)-e/--encoding
option. (#496)@default
tag is added to a symbol whose default value is an object, the value is now
displayed in the output file. (#419)--lenient
(-l
) command-line option. (Multiple issues)@listens
tag to indicate that a symbol listens for an event. (#273)parseBegin
event before it starts parsing files, as well as a
parseComplete
event after all files have been parsed. Plugins can define event handlers for these
events, and parseBegin
handlers can modify the list of files to parse. (#299)jsdocCommentFound
events can now modify the JSDoc comment. (#228)markdown.excludeTags
in
the configuration file. (#337)markdown.parser
to marked
. In addition, if markdown.parser
is set to
gfm
, JSDoc will now use the "marked" parser instead. (#385)The @typedef
tag no longer requires a name when used with a Closure Compiler-style type
definition. For example, the following type definition will automatically get the name Foo.Bar
:
/** @typedef {string} */
Foo.Bar;
(#391)
You can now use an inline {@type}
tag in a parameter's description. If this tag is present,
JSDoc will assume that the parameter uses the type specified in the inline {@type}
tag. For
example, the following @param
tag would cause myParam
's type to be documented as Foo
:
@param {(boolean|string)} myParam - My special parameter. {@type Foo}
(#152)
The console.log
function now behaves the same way as on Node.js. In addition, the functions
console.info
, console.error
, console.warn
, and console.trace
have been implemented. (#298)
You can now use npm to install JSDoc globally by running npm install -g
. Note: JSDoc will
still run under Mozilla Rhino, not Node.js. (#374)
The jsVersion
configuration property has been removed. (#390)
--explain
(-X
) option now runs much more quickly, and it outputs valid JSON to the
console. (#298)--lenient
(-l
) option now prints warnings on STDERR rather than STDOUT. (#298){@link}
tag now works correctly when @link
is followed by a tab. (#359)overloadHelper
plugin makes it easier to link to overloaded methods. (#179)markdown
plugin now converts Markdown links in the @see
tag. (#297)templates.default.staticFiles
to copy additional
static files to the output directory. (#393)@property
tag does not identify the property's name, the template no longer throws an
error. (#373)@typedef
is now displayed. (#391)@see
tag contains a URL (for example, @see http://example.com
or
@see <http://example.com>
), the tag text is now converted to a link. (#371)README.md
or package.json
will now be processed when they are specified on the
command line. (#350)@emits
as a synonym for @fires
. (#324)jsdoc/util/templateHelper
now allows you to specify the CSS class for links that are
generated by the following methods: (#331)
getAncestorLinks
getSignatureReturns
getSignatureTypes
linkto
You can now use the new @callback
tag to provide information about a callback function's
signature. To document a callback function, create a standalone JSDoc comment, as shown in the
following example:
```javascript /**
/**
/**
The inline link tag, {@link}
, has been improved:
conf.json
file, you can now enable the option templates.cleverLinks
to display
code links in a monospace font and URL links in plain text. You can also enable the option
templates.monospaceLinks
to display all links in a monospace font. Note: JSDoc templates
must be updated to respect these options.{@linkplain}
, which forces a plain-text link, and
{@linkcode}
, which forces a monospace link. These tags always override the settings in your
conf.json
file. (#250)JSDoc now provides a -l/--lenient
option that tells JSDoc to continue running if it encounters a
non-fatal error. (Multiple issues)
A template's publish.js
file should now assign its publish
function to exports.publish
,
rather than defining a global publish
function. The global publish
function is deprecated and
may not be supported in future versions. JSDoc's built-in templates reflect this change. (#166)
The template helper (templateHelper.js
) exports a variety of new functions for finding
information within a parse tree. These functions were previously contained within the default
template. (#186)
Updated the fs
and path
modules to make their behavior more consistent with Node.js. In
addition, created extended versions of these modules with additional functionality. (Multiple
commits)
Updated or replaced numerous third-party modules. (Multiple commits)
Reorganized the JSDoc codebase in preparation for future enhancements. (Multiple commits)
JSDoc now embeds a version of Mozilla Rhino that recognizes Node.js packages, including
package.json
files. (Multiple commits)
Node.js' npm
utility can now install JSDoc from its GitHub repository. Note: JSDoc is not
currently compatible with Node.js. However, this change allows JSDoc to be installed as a dependency
of a Node.js project. In this version, global installation with npm
is not supported. (Multiple
commits)
README.md
file is passed to JSDoc, its contents will be included on the index.html
page
of the generated documentation. (#128)@augments
tag can now refer to an undocumented member, such as window.XMLHTTPRequest
.
(#160)@extends
tag can now refer to an undocumented member, such as window.XMLHttpRequest
. In
addition, you can now use @host
as a synonym for @extends
. (#145)@lends
tag is now supported in multiline JSDoc comments. (#163)jsdoc.cmd
now provides the same options as the jsdoc
shell script. (#127)setTimeout()
, clearTimeout()
, setInterval()
, and clearInterval()
functions. (Multiple commits)exit()
function. Use process.exit()
instead. (1228a8f7)-v/--version
option to display information about the current version.
(#303)--nocolor
option to disable colored output. On Windows,
colored output is always disabled. (e17601fe, 8bc33541)@event
tag to define an event within a class or namespace, the event's longname
is now set correctly regardless of tag order. (#280)@property
tag no longer results in malformed parse trees. (20f87094)jsdoc
and jsdoc.cmd
scripts now work correctly with paths that include spaces. (#127,
#130)jsdoc
script now works correctly on Cygwin and MinGW, and with the dash
shell. (#182,
#184, #187)-d/--destination
option is no longer treated as a path relative to the JSDoc directory.
Instead, it can contain an absolute path, or a path relative to the current working directory.
(f5e3f0f3)conf.json
. (#129)conf.json
file does not exist, JSDoc no longer tries to create it, which prevents errors
if the current user does not have write access to the JSDoc directory. (d2d05fcb)!
, indicating that it is non-nullable, the leading !
is now removed
from the type name. (#226){@link}
tags are no longer treated as
Markdown formatting characters. (#259)constructor
, is used
as the link text. (#249)conf.json
, rather than
using the "evilstreak" Markdown parser in all cases. (#220).js
files, JSDoc no longer attempts to parse
the .js
files as JSON files. (#222)conf.json
file is not present. (#206)partial
plugin adds support for a @partial
tag, which links to an external file that
contains JSDoc comments. (#156)commentsOnly
plugin removes everything in a file except JSDoc-style comments. You can
use this plugin to document source files that are not valid JavaScript, including source files for
other languages. (#304)eventDumper
plugin logs information about parser events to the console. (#242)verbose
plugin logs the name of each input file to the console. (#157)templates.default.outputSourceFiles: false
to your conf.json
file. (#208)@author
tag contains text in the format "Jane Doe jdoe@example.com", the value is now
converted to an HTML mailto:
link. (#326)index.html
output file is no longer overwritten if a namespace called index
has been
documented. (#244)conf.json
file may now contain source.include
and source.exclude
properties. (#56)
source.include
specifies files or directories that JSDoc should always check for
documentation.source.exclude
specifies files or directories that JSDoc should never check for
documentation.
These settings take precedence over the source.includePattern
and source.excludePattern
properties, which contain regular expressions that JSDoc uses to search for source files.-t/--template
option may now specify the absolute path to a template. (#122)hasOwnProperty
.
(1ef37251)@alias
tag now works correctly when documenting inner classes as globals. (810dd7f7)@example
, @members
, and @returns
tags. (6580e176,
59655252, 31c8554d)Initial release.