eslint-plugin-jsdoc
JSDoc linting rules for ESLint.
Reference to jscs-jsdoc
This table maps the rules between eslint-plugin-jsdoc
and jscs-jsdoc
.
Installation
Install ESLint either locally or globally.
npm install --save-dev eslint
If you have installed ESLint
globally, you have to install JSDoc plugin globally too. Otherwise, install it locally.
npm install --save-dev eslint-plugin-jsdoc
Configuration
Add plugins
section and specify eslint-plugin-jsdoc
as a plugin.
{
"plugins": [
"jsdoc"
]
}
Finally, enable all of the rules that you would like to use.
{
"rules": {
"jsdoc/check-alignment": 1,
"jsdoc/check-examples": 1,
"jsdoc/check-indentation": 1,
"jsdoc/check-param-names": 1,
"jsdoc/check-syntax": 1,
"jsdoc/check-tag-names": 1,
"jsdoc/check-types": 1,
"jsdoc/implements-on-classes": 1,
"jsdoc/match-description": 1,
"jsdoc/newline-after-description": 1,
"jsdoc/no-types": 1,
"jsdoc/no-undefined-types": 1,
"jsdoc/require-description": 1,
"jsdoc/require-description-complete-sentence": 1,
"jsdoc/require-example": 1,
"jsdoc/require-hyphen-before-param-description": 1,
"jsdoc/require-jsdoc": 1,
"jsdoc/require-param": 1,
"jsdoc/require-param-description": 1,
"jsdoc/require-param-name": 1,
"jsdoc/require-param-type": 1,
"jsdoc/require-returns": 1,
"jsdoc/require-returns-check": 1,
"jsdoc/require-returns-description": 1,
"jsdoc/require-returns-type": 1,
"jsdoc/valid-types": 1
}
}
Or you can simply use the following which enables the rules commented
above as "recommended":
{
"extends": ["plugin:jsdoc/recommended"]
}
You can then selectively add to or override the recommended rules.
Settings
settings.jsdoc.ignorePrivate
- Disables all rules for the comment block
on which a @private
tag occurs. Defaults to false
.
Alias Preference
Use settings.jsdoc.tagNamePreference
to configure a preferred alias name for a JSDoc tag. The format of the configuration is: <primary tag name>: <preferred alias name>
, e.g.
{
"rules": {},
"settings": {
"jsdoc": {
"tagNamePreference": {
"param": "arg",
"returns": "return"
}
}
}
}
One may also use an object with a message
and replacement
.
The following will report the message @extends is to be used over @augments as it is more evocative of classes than @augments
upon encountering @augments
.
{
"rules": {},
"settings": {
"jsdoc": {
"tagNamePreference": {
"augments": {
"message": "@extends is to be used over @augments as it is more evocative of classes than @augments",
"replacement": "extends"
}
}
}
}
}
If one wishes to reject a normally valid tag, e.g., @todo
, one may set the tag to false
:
{
"rules": {},
"settings": {
"jsdoc": {
"tagNamePreference": {
"todo": false
}
}
}
}
Or one may set the targeted tag to an object with a custom message
, but without a replacement
property:
{
"rules": {},
"settings": {
"jsdoc": {
"tagNamePreference": {
"todo": {
"message": "We expect immediate perfection, so don't leave to-dos in your code."
}
}
}
}
}
Note that the preferred tags indicated in the settings.jsdoc.tagNamePreference
map will be assumed to be defined by check-tag-names
.
The defaults in eslint-plugin-jsdoc
(for tags which offer
aliases) are as follows:
@abstract
(over @virtual
)@augments
(over @extends
)@class
(over @constructor
)@constant
(over @const
)@default
(over @defaultvalue
)@description
(over @desc
)@external
(over @host
)@file
(over @fileoverview
, @overview
)@fires
(over @emits
)@function
(over @func
, @method
)@member
(over @var
)@param
(over @arg
, @argument
)@property
(over @prop
)@returns
(over @return
)@throws
(over @exception
)@yields
(over @yield
)
This setting is utilized by the the rule for tag name checking
(check-tag-names
) as well as in the @param
and @require
rules:
check-param-names
check-tag-names
require-hyphen-before-param-description
require-description
require-param
require-param-description
require-param-name
require-param-type
require-returns
require-returns-check
require-returns-description
require-returns-type
@override
/@augments
/@extends
/@implements
Without Accompanying @param
/@description
/@example
/@returns
The following settings allows the element(s) they reference to be omitted
on the JSDoc comment block of the function or that of its parent class
for any of the "require" rules (i.e., require-param
, require-description
,
require-example
, or require-returns
).
settings.jsdoc.overrideReplacesDocs
(@override
) - Defaults to true
settings.jsdoc.augmentsExtendsReplacesDocs
(@augments
or its alias @extends
) - Defaults to false
.settings.jsdoc.implementsReplacesDocs
(@implements
) - Defaults to false
The format of the configuration is as follows:
{
"rules": {},
"settings": {
"jsdoc": {
"overrideReplacesDocs": true,
"augmentsExtendsReplacesDocs": true,
"implementsReplacesDocs": true
}
}
}
Settings to Configure check-types
and no-undefined-types
-
settings.jsdoc.preferredTypes
An option map to indicate preferred
or forbidden types (if default types are indicated here, these will
have precedence over the default recommendations for check-types
).
The keys of this map are the types to be replaced (or forbidden).
These keys may include:
- The "ANY" type,
*
- The pseudo-type
[]
which we use to denote the parent (array)
types used in the syntax string[]
, number[]
, etc. - The pseudo-type
.<>
(or .
) to represent the format Array.<value>
or Object.<key, value>
- The pseudo-type
<>
to represent the format Array<value>
or
Object<key, value>
- A plain string type, e.g.,
MyType
- A plain string type followed by one of the above pseudo-types (except
for
[]
which is always assumed to be an Array
), e.g., Array.
, or
SpecialObject<>
.
If a bare pseudo-type is used, it will match all parent types of that form.
If a pseudo-type prefixed with a type name is used, it will only match
parent types of that form and type name.
The values can be:
false
to forbid the type- a string to indicate the type that should be preferred in its place
(and which
fix
mode can replace); this can be one of the formats
of the keys described above. Note that the format will not be changed
unless you use a pseudo-type in the replacement (e.g.,
'Array.<>': 'MyArray'
will change Array.<string>
to MyArray.<string>
,
preserving the dot; to get rid of the dot, you must use the pseudo-type:
'Array.<>': 'MyArray<>'
which will change Array.<string>
to
MyArray<string>
). If you use a bare pseudo-type in the replacement,
e.g., 'MyArray.<>': '<>'
, the type will be converted to the format
of the pseudo-type without changing the type name, i.e., MyArray.<string>
will become MyArray<string>
but Array.<string>
will not be modified. - an object with the key
message
to provide a specific error message
when encountering the discouraged type and, if a type is to be preferred
in its place, the key replacement
to indicate the type that should be
used in its place (and which fix
mode can replace) or false
if
forbidding the type. The message string will have the substrings with
special meaning, {{tagName}}
and {{tagValue}}
, replaced with their
corresponding value.
Note that the preferred types indicated as targets in settings.jsdoc.preferredTypes
map will be assumed to be defined by no-undefined-types
.
See the option of check-types
, unifyParentAndChildTypeChecks
, for
how the keys of preferredTypes
may have <>
or .<>
(or just .
)
appended and its bearing on whether types are checked as parents/children
only (e.g., to match Array
if the type is Array
vs. Array.<string>
).
Rules
check-alignment
Reports invalid alignment of JSDoc block asterisks.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | N/A |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
class Foo {
quux(a) {}
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {}
check-examples
Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules.
Options
The options below all default to no-op/false
except as noted.
captionRequired
JSDoc specs use of an optional <caption>
element at the beginning of
@example
.
The option captionRequired
insists on a <caption>
being present at
the beginning of any @example
.
exampleCodeRegex
and rejectExampleCodeRegex
JSDoc does not specify a formal means for delimiting code blocks within
@example
(it uses generic syntax highlighting techniques for its own
syntax highlighting). The following options determine whether a given
@example
tag will have the check-examples
checks applied to it:
exampleCodeRegex
- Regex which whitelists lintable
examples. If a parenthetical group is used, the first one will be used,
so you may wish to use (?:...)
groups where you do not wish the
first such group treated as one to include. If no parenthetical group
exists or matches, the whole matching expression will be used.
An example might be "^```(?:js|javascript)([\\s\\S]*)```$"
to only match explicitly fenced JavaScript blocks.rejectExampleCodeRegex
- Regex blacklist which rejects
non-lintable examples (has priority over exampleCodeRegex
). An example
might be "^`"
to avoid linting fenced blocks which may indicate
a non-JavaScript language.
If neither is in use, all examples will be matched. Note also that even if
captionRequired
is not set, any initial <caption>
will be stripped out
before doing the regex matching.
reportUnusedDisableDirectives
If not set to false
, reportUnusedDisableDirectives
will report disabled
directives which are not used (and thus not needed). Defaults to true
.
Corresponds to ESLint's --report-unused-disable-directives
.
Inline ESLint config within @example
JavaScript is allowed, though the
disabling of ESLint directives which are not needed by the resolved rules
will be reported as with the ESLint --report-unused-disable-directives
command.
Options for Determining ESLint Rule Applicability (allowInlineConfig
, noDefaultExampleRules
, matchingFileName
, configFile
, eslintrcForExamples
, and baseConfig
)
The following options determine which individual ESLint rules will be
applied to the JavaScript found within the @example
tags (as determined
to be applicable by the above regex options). They are ordered by
decreasing precedence:
allowInlineConfig
- If not set to false
, will allow
inline config within the @example
to override other config. Defaults
to true
.noDefaultExampleRules
- Setting to true
will disable the
default rules which are expected to be troublesome for most documentation
use. See the section below for the specific default rules.matchingFileName
- Option for a file name (even non-existent) to trigger
specific rules defined in one's config; usable with ESLint .eslintrc.*
overrides
-> files
globs, to apply a desired subset of rules with
@example
(besides allowing for rules specific to examples, this option
can be useful for enabling reuse of the same rules within @example
as
with JavaScript Markdown lintable by
other plugins, e.g.,
if one sets matchingFileName
to dummy.md
so that @example
rules will
follow one's Markdown rules). Note that this option may come at somewhat
of a performance penalty as the file's existence is checked by eslint.configFile
- A config file. Corresponds to ESLint's -c
.eslintrcForExamples
- Defaults to true
in adding rules
based on an .eslintrc.*
file. Setting to false
corresponds to
ESLint's --no-eslintrc
.baseConfig
- An object of rules with the same schema
as .eslintrc.*
for defaults
Rules Disabled by Default Unless noDefaultExampleRules
is Set to true
eol-last
- Insisting that a newline "always" be at the end is less likely
to be desired in sample code as with the code file conventionno-console
- Unlikely to have inadvertent temporary debugging within
examplesno-undef
- Many variables in examples will be undefined
.no-unused-vars
- It is common to define variables for clarity without always
using them within examples.padded-blocks
- It can generally look nicer to pad a little even if one's
code follows more stringency as far as block padding.import/no-unresolved
- One wouldn't generally expect example paths to
resolve relative to the current JavaScript file as one would with real code.import/unambiguous
- Snippets in examples are likely too short to always
include full import/export infonode/no-missing-import
- See import/no-unresolved
node/no-missing-require
- See import/no-unresolved
| |
---|
Context | ArrowFunctionExpression , ClassDeclaration , FunctionDeclaration , FunctionExpression |
Tags | example |
Options | See above |
The following patterns are considered problems:
function quux () {
}
class quux {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux2 () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {}
function quux () {}
function quux2 () {
}
function quux2 () {
}
function quux2 () {
}
function quux () {
}
function f () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {}
function quux () {}
check-indentation
Reports invalid padding inside JSDoc block.
The following patterns are considered problems:
function quux () {
}
class Moo {}
The following patterns are not considered problems:
function quux () {
}
check-param-names
Ensures that parameter names in JSDoc match those in the function declaration.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param |
The following patterns are considered problems:
function quux (foo = 'FOO') {
}
function quux (foo = 'FOO') {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (bar, foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo, bar) {
}
function quux (foo, foo) {
}
export class SomeClass {
constructor(private property: string) {}
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo, bar) {
}
function quux (foo, bar, baz) {
}
function quux (foo, bar) {
}
function quux (...args) {
}
function quux ({a, b}) {
}
function quux ({a, b} = {}) {
}
function quux ([a, b] = []) {
}
function assign (employees) {
};
export class SomeClass {
constructor(private property: string) {}
}
Deconstructing Function Parameter
eslint-plugin-jsdoc
does not validate names of parameters in function deconstruction, e.g.
function quux ({
a,
b
}) {
}
{a, b}
is an ObjectPattern
AST type and does not have a name. Therefore, the associated parameter in JSDoc block can have any name.
Likewise for the pattern [a, b]
which is an ArrayPattern
.
check-syntax
Reports against Google Closure Compiler syntax.
The following patterns are considered problems:
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
check-tag-names
Reports invalid block tag names.
Valid JSDoc 3 Block Tags are:
abstract
access
alias
async
augments
author
borrows
callback
class
classdesc
constant
constructs
copyright
default
deprecated
description
enum
event
example
exports
external
file
fires
function
generator
global
hideconstructor
ignore
implements
inheritdoc
inner
instance
interface
kind
lends
license
listens
member
memberof
memberof!
mixes
mixin
module
name
namespace
override
package
param
private
property
protected
public
readonly
requires
returns
see
since
static
summary
this
throws
todo
tutorial
type
typedef
variation
version
yields
Note that the tags indicated as replacements in settings.jsdoc.tagNamePreference
will automatically be considered as valid.
Options
definedTags
Use an array of definedTags
strings to configure additional, allowed JSDoc tags.
The format is as follows:
{
"definedTags": ["define", "record"]
}
| |
---|
Context | everywhere |
Tags | N/A |
Options | definedTags |
Settings | tagNamePreference |
The following patterns are considered problems:
let a;
function quux () {
}
function quux () {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {}
function quux (foo) {
}
function quux () {
}
check-types
Reports invalid types.
By default, ensures that the casing of native types is the same as in this list:
undefined
null
boolean
number
string
object
Array
Function
Date
RegExp
Options
check-types
allows one option:
- An option object:
- with the key
noDefaults
to insist that only the supplied option type
map is to be used, and that the default preferences (such as "string"
over "String") will not be enforced. The option's default is false
. - with the key
unifyParentAndChildTypeChecks
which will treat
settings.jsdoc.preferredTypes
keys such as SomeType
as matching
not only child types such as an unadorned SomeType
but also
SomeType<aChildType>
, SomeType.<aChildType>
, or if SomeType
is
Array
(or []
), it will match aChildType[]
. If this is false
or
unset, the former format will only apply to types which are not parent
types/unions whereas the latter formats will only apply for parent
types/unions. The special types []
, .<>
(or .
), and <>
act only as parent types (and will not match a bare child type such as
Array
even when unified, though, as mentioned, Array
will match
say string[]
or Array.<string>
when unified). The special type
*
is only a child type. Note that there is no detection of parent
and child type together, e.g., you cannot specify preferences for
string[]
specifically as distinct from say number[]
, but you can
target both with []
or the child types number
or string
.
See also the documentation on settings.jsdoc.preferredTypes
which impacts
the behavior of check-types
.
Why not capital case everything?
Why are boolean
, number
and string
exempt from starting with a capital letter? Let's take string
as an example. In Javascript, everything is an object. The string Object has prototypes for string functions such as .toUpperCase()
.
Fortunately we don't have to write new String()
everywhere in our code. Javascript will automatically wrap string primitives into string Objects when we're applying a string function to a string primitive. This way the memory footprint is a tiny little bit smaller, and the GC has less work to do.
So in a sense, there two types of strings in Javascript; {string}
literals, also called primitives and {String}
Objects. We use the primitives because it's easier to write and uses less memory. {String}
and {string}
are technically both valid, but they are not the same.
new String('lard')
'lard'
new String('lard') === 'lard'
To make things more confusing, there are also object literals and object Objects. But object literals are still static Objects and object Objects are instantiated Objects. So an object primitive is still an object Object.
However, Object.create(null)
objects are not instanceof Object
, however, so
in the case of this Object we lower-case to indicate possible support for
these objects.
Basically, for primitives, we want to define the type as a primitive, because that's what we use in 99.9% of cases. For everything else, we use the type rather than the primitive. Otherwise it would all just be {object}
.
In short: It's not about consistency, rather about the 99.9% use case. (And some
functions might not even support the objects if they are checking for identity.)
type name | typeof | check-types | testcase |
---|
Array | object | Array | ([]) instanceof Array -> true |
Function | function | function | (function f () {}) instanceof Function -> true |
Date | object | Date | (new Date()) instanceof Date -> true |
RegExp | object | RegExp | (new RegExp(/.+/)) instanceof RegExp -> true |
Object | object | object | ({}) instanceof Object -> true but Object.create(null) instanceof Object -> false |
Boolean | boolean | boolean | (true) instanceof Boolean -> false |
Number | number | number | (41) instanceof Number -> false |
String | string | string | ("test") instanceof String -> false |
| |
---|
Context | everywhere |
Tags | class , constant , enum , implements , member , module , namespace , param , property , returns , throws , type , typedef , yields |
Aliases | constructor , const , var , arg , argument , prop , return , exception |
Closure-only | package , private , protected , public , static |
Options | noDefaults , unifyParentAndChildTypeChecks |
Settings | preferredTypes |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux () {
}
function quux (foo, bar, baz) {
}
function quux (foo, bar, baz) {
}
function quux (foo, bar, baz) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(foo, bar, baz) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(foo, bar) {
}
function qux(foo, bar) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(baz) {
}
function qux(baz) {
}
function qux(foo, bar) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo, bar, baz) {
}
function quux (foo, bar, baz) {
}
function quux (foo, bar, baz) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(foo) {
}
function qux(foo) {
}
function quux () {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
implements-on-classes
Reports an issue with any non-constructor function using @implements
.
Constructor functions, whether marked with @class
, @constructs
, or being
an ES6 class constructor, will not be flagged.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | implements (prevented) |
The following patterns are considered problems:
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
class quux {
constructor () {
}
}
const quux = class {
constructor () {
}
}
function quux () {
}
match-description
Enforces a regular expression pattern on descriptions.
The default is this basic expression to match English sentences (Support
for Unicode upper case may be added in a future version when it can be handled
by our supported Node versions):
^([A-Z]|[`\\d_])[\\s\\S]*[.?!`]$
Options
matchDescription
You can supply your own expression to override the default, passing a
matchDescription
string on the options object.
{
'jsdoc/match-description': ['error', {matchDescription: '[A-Z].*\\.'}]
}
As with the default, the supplied regular expression will be applied with the
Unicode ("u"
) flag and is not case-insensitive.
tags
If you want different regular expressions to apply to tags, you may use
the tags
option object:
{
'jsdoc/match-description': ['error', {tags: {
param: '\\- [A-Z].*\\.',
returns: '[A-Z].*\\.'
}}]
}
In place of a string, you can also add true
to indicate that a particular
tag should be linted with the matchDescription
value (or the default).
{
'jsdoc/match-description': ['error', {tags: {
param: true,
returns: true
}}]
}
The tags @param
/@arg
/@argument
will be properly parsed to ensure that
the matched "description" text includes only the text after the name.
All other tags will treat the text following the tag name, a space, and
an optional curly-bracketed type expression (and another space) as part of
its "description" (e.g., for @returns {someType} some description
, the
description is some description
while for @some-tag xyz
, the description
is xyz
).
mainDescription
If you wish to override the main function description without changing the
default match-description
, you may use mainDescription
:
{
'jsdoc/match-description': ['error', {
mainDescription: '[A-Z].*\\.',
tags: {
param: true,
returns: true
}
}]
}
There is no need to add mainDescription: true
, as by default, the main
function (and only the main function) is linted, though you may disable checking
it by setting it to false
.
contexts
Set this to an array of strings representing the AST context
where you wish the rule to be applied (e.g., ClassDeclaration
for ES6 classes).
Overrides the default contexts (see below).
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression ; others when contexts option enabled |
Tags | N/A by default but see tags options |
Settings | |
Options | contexts , tags (allows for 'param', 'arg', 'argument', 'description', 'desc', and any added to tags option, e.g., 'returns', 'return'), mainDescription , matchDescription |
The following patterns are considered problems:
const q = class {
}
const q = {
};
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux (foo) {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function longDescription (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux () {
}
function quux () {
}
class quux {
}
class MyClass {
myClassField = 1
}
interface quux {
}
const myObject = {
myProp: true
};
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
class quux {
}
class quux {
}
class MyClass {
myClassField = 1
}
interface quux {
}
const myObject = {
myProp: true
};
const q = class {
}
const q = {
};
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
newline-after-description
Enforces a consistent padding of the block description.
Options
This rule allows one optional string argument. If it is "always"
then a problem is raised when there is a newline after the description. If it is "never"
then a problem is raised when there is no newline after the description. The default value is "always"
.
| |
---|
Context | everywhere |
Options | (a string matching `"always" |
Tags | N/A |
The following patterns are considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
no-types
This rule reports types being used on @param
or @returns
.
The rule is intended to prevent the indication of types on tags where
the type information would be redundant with TypeScript.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param , returns |
Aliases | arg , argument , return |
The following patterns are considered problems:
function quux (foo) {
}
function quux () {
}
The following patterns are not considered problems:
function quux (foo) {
}
no-undefined-types
Checks that types in jsdoc comments are defined. This can be used to check
unimported types.
When enabling this rule, types in jsdoc comments will resolve as used
variables, i.e. will not be marked as unused by no-unused-vars
.
In addition to considering globals found in code (or in ESLint-indicated
globals
) as defined, the following tags will also be checked for
name(path) definitions to also serve as a potential "type" for checking
the tag types in the table below:
@callback
, @class
(or @constructor
), @constant
(or @const
), @event
, @external
(or @host
), @function
(or @func
or @method
), @interface
, @member
(or @var
), @mixin
, @name
, @namespace
, @template
(for Closure/TypeScript), @typedef
.
The following types are always considered defined.
null
, undefined
, string
, boolean
, object
, function
number
, NaN
, Infinity
any
, *
Array
, Object
, RegExp
, Date
, Function
Note that preferred types indicated within settings.jsdoc.preferredTypes
will
also be assumed to be defined.
Options
An option object may have the following key:
definedTypes
- This array can be populated to indicate other types which
are automatically considered as defined (in addition to globals, etc.).
Defaults to an empty array.
| |
---|
Context | everywhere |
Tags | class , constant , enum , implements , member , module , namespace , param , property , returns , throws , type , typedef , yields |
Aliases | constructor , const , var , arg , argument , prop , return , exception , yield |
Closure-only | package , private , protected , public , static |
Options | definedTypes |
Settings | preferredTypes |
The following patterns are considered problems:
function quux(foo, bar, baz) {
}
function quux(foo, bar, baz) {
}
function quux(foo) {
}
function quux(foo, bar) {
}
function quux(foo, bar, baz) {
}
function quux(foo, bar, baz) {
}
function foo (bar) {
};
class Foo {
bar () {
}
}
class Foo {
invalidTemplateReference () {
}
}
class Bar {
validTemplateReference () {
}
}
The following patterns are not considered problems:
function quux(foo) {
}
function quux(foo) {
}
class MyClass {}
function quux(foo) {
console.log(foo);
}
quux(0);
const MyType = require('my-library').MyType;
function quux(foo) {
}
const MyType = require('my-library').MyType;
function quux(foo) {
}
import {MyType} from 'my-library';
function quux(foo, bar, baz) {
}
function quux(foo, bar) {
}
function quux(foo) {
}
function quux(foo) {
}
function testFunction(callback) {
callback();
}
function foo () {
}
function foo () {
}
function quux(foo, bar) {
}
function quux(foo, bar, baz) {
}
function quux(foo, bar, baz) {
}
function foo (bar) {
};
class Foo {
bar () {
}
}
class Foo {
bar (baz) {
}
}
function quux () {
}
require-description-complete-sentence
Requires that block description, explicit @description
, and @param
/@returns
tag descriptions are written in complete sentences, i.e.,
- Description must start with an uppercase alphabetical character.
- Paragraphs must start with an uppercase alphabetical character.
- Sentences must end with a period.
- Every line in a paragraph (except the first) which starts with an uppercase
character must be preceded by a line ending with a period.
| |
---|
Context | everywhere |
Tags | param , returns , description |
Aliases | arg , argument , return , desc |
The following patterns are considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function longDescription (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
require-description
Requires that all functions have a description.
- All functions must have a
@description
tag. - Every description tag must have a non-empty description that explains the purpose of the method.
Options
An options object may have any of the following properties:
contexts
- Set to an array of strings representing the AST context
where you wish the rule to be applied (e.g., ClassDeclaration
for ES6 classes).
Overrides the default contexts (see below).exemptedBy
- Array of tags (e.g., ['type']
) whose presence on the document
block avoids the need for a @description
. Defaults to an empty array.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression ; others when contexts option enabled |
Tags | description |
Aliases | desc |
Options | contexts , exemptedBy |
Settings | overrideReplacesDocs , augmentsExtendsReplacesDocs , implementsReplacesDocs |
The following patterns are considered problems:
function quux () {
}
class quux {
}
class quux {
}
class quux {
}
function quux () {
}
interface quux {
}
var quux = class {
};
var quux = {
};
function quux () {
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
class quux {
}
function quux () {
}
function quux () {
}
interface quux {
}
var quux = class {
};
var quux = {
};
require-example
Requires that all functions have examples.
- All functions must have one or more
@example
tags. - Every example tag must have a non-empty description that explains the method's usage.
Options
This rule has an object option:
-
exemptedBy
- Array of tags (e.g., ['type']
) whose presence on the document
block avoids the need for an @example
. Defaults to an empty array.
-
avoidExampleOnConstructors
(default: false) - Set to true
to avoid the
need for an example on a constructor (whether indicated as such by a
jsdoc tag or by being within an ES6 class
).
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | example |
Options | exemptedBy , avoidExampleOnConstructors |
Settings | overrideReplacesDocs , augmentsExtendsReplacesDocs , implementsReplacesDocs |
The following patterns are considered problems:
function quux () {
}
function quux () {
}
function f () {
}
function quux () {
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
class Foo {
constructor () {
}
}
function quux () {
}
function quux () {
}
require-hyphen-before-param-description
Requires a hyphen before the @param
description.
Options
This rule takes one optional string argument. If it is "always"
then a problem is raised when there is no hyphen before the description. If it is "never"
then a problem is raised when there is a hyphen before the description. The default value is "always"
.
| |
---|
Context | everywhere |
Tags | param |
Aliases | arg , argument |
Options | (a string matching `"always" |
The following patterns are considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
require-jsdoc
Checks for presence of jsdoc comments, on class declarations as well as
functions.
Options
Accepts one optional options object with the following optional keys.
-
publicOnly
- This option will insist that missing jsdoc blocks are
only reported for function bodies / class declarations that are exported
from the module. May be a boolean or object. If set to true
, the defaults
below will be used. If unset, jsdoc block reporting will not be limited to
exports.
This object supports the following optional boolean keys (false
unless
otherwise noted):
ancestorsOnly
- Only check node ancestors to check if node is exportedesm
- ESM exports are checked for JSDoc comments (Defaults to true
)cjs
- CommonJS exports are checked for JSDoc comments (Defaults to true
)window
- Window global exports are checked for JSDoc comments
-
require
- An object with the following optional boolean keys which all
default to false
except as noted, indicating the contexts where the rule
will apply:
ArrowFunctionExpression
ClassDeclaration
ClassExpression
FunctionDeclaration
(defaults to true
)FunctionExpression
MethodDefinition
-
contexts
- Set this to an array of strings representing the additional
AST contexts where you wish the rule to be applied (e.g., Property
for
properties). Defaults to an empty array.
-
exemptEmptyFunctions
(default: false) - When true
, the rule will not report
missing jsdoc blocks above functions/methods with no parameters or return values
(intended where variable names are sufficient for themselves as documentation).
| |
---|
Context | ArrowFunctionExpression , ClassDeclaration , ClassExpression , FunctionDeclaration , FunctionExpression |
Tags | N/A |
Options | publicOnly , require , contexts , exemptEmptyFunctions |
The following patterns are considered problems:
export var test = function () {
};
function test () {
}
export var test2 = test;
export const test = () => {
};
export let test = class {
};
export default function () {}
export default () => {}
export default (function () {})
export default class {}
function quux (foo) {
}
function quux (foo) {
}
function myFunction() {}
class A {
constructor(xs) {
this.a = xs;
}
}
class A {
constructor(xs) {
this.a = xs;
}
}
class A extends B {
constructor(xs) {
this.a = xs;
}
}
export class A extends B {
constructor(xs) {
this.a = xs;
}
}
export default class A extends B {
constructor(xs) {
this.a = xs;
}
}
var myFunction = () => {}
var myFunction = () => () => {}
var foo = function() {}
const foo = {bar() {}}
var foo = {bar: function() {}}
function foo (abc) {}
function foo () {
return true;
}
module.exports = function quux () {
}
module.exports = function quux () {
}
module.exports = {
method: function() {
}
}
module.exports = {
test: {
test2: function() {
}
}
}
module.exports = {
test: {
test2: function() {
}
}
}
const test = module.exports = function () {
}
const test = module.exports = function () {
}
test.prototype.method = function() {}
const test = function () {
}
module.exports = {
test: test
}
const test = () => {
}
module.exports = {
test: test
}
class Test {
method() {
}
}
module.exports = Test;
export default function quux () {
}
export default function quux () {
}
function quux () {
}
export default quux;
export function test() {
}
export function test() {
}
var test = function () {
}
var test2 = 2;
export { test, test2 }
var test = function () {
}
export { test as test2 }
export default class A {
}
export default class A {
}
var test = function () {
}
window.test = function () {
}
function test () {
}
module.exports = function() {
}
export function someMethod() {
}
export function someMethod() {
}
const myObject = {
myProp: true
};
The following patterns are not considered problems:
var array = [1,2,3];
array.forEach(function() {});
function MyClass() {}
function myFunction() {}
var myFunction = function() {};
Object.myFunction = function () {};
var obj = {
myFunction: function () {} };
function myFunction() {}
function myFunction() {}
function myFunction() {}
var myFunction = function () {}
var myFunction = function () {}
var myFunction = function () {}
Object.myFunction = function() {}
Object.myFunction = function() {}
Object.myFunction = function() {}
(function(){})();
var object = {
myFunction: function() {} }
var object = {
myFunction: function() {} }
var object = {
myFunction: function() {} }
var array = [1,2,3];
array.filter(function() {});
Object.keys(this.options.rules || {}).forEach(function(name) {}.bind(this));
var object = { name: 'key'};
Object.keys(object).forEach(function() {})
function myFunction() {}
var myFunction = function() {}
class A {
constructor(xs) {
this.a = xs;
}
}
class App extends Component {
constructor(xs) {
this.a = xs;
}
}
export default class App extends Component {
constructor(xs) {
this.a = xs;
}
}
export class App extends Component {
constructor(xs) {
this.a = xs;
}
}
class A {
constructor(xs) {
this.a = xs;
}
}
var myFunction = () => {}
var myFunction = function () {}
var myFunction = () => {}
var myFunction = () => () => {}
setTimeout(() => {}, 10);
var foo = function() {}
const foo = {
bar() {}}
var foo = {
bar: function() {}}
var foo = { [function() {}]: 1 };
function foo () {}
function foo () {
return;
}
const test = {};
test.method = function () {
}
module.exports = {
prop: { prop2: test.method }
}
function test() {
}
module.exports = {
prop: { prop2: test }
}
test = function() {
}
module.exports = {
prop: { prop2: test }
}
test = function() {
}
exports.someMethod = {
prop: { prop2: test }
}
const test = () => {
}
module.exports = {
prop: { prop2: test }
}
const test = () => {
}
module.exports = {
prop: { prop2: test }
}
window.test = function() {
}
module.exports = {
prop: window
}
test = function() {
}
test = function() {
}
module.exports = {
prop: { prop2: test }
}
test = function() {
}
test = 2;
module.exports = {
prop: { prop2: test }
}
function test() {
}
test.prototype.method = function() {
}
module.exports = {
prop: { prop2: test }
}
class Test {
method() {
}
}
module.exports = Test;
export default function quux () {
}
export default function quux () {
}
function quux () {
}
export default quux;
function quux () {
}
export default quux;
export function test() {
}
export function test() {
}
var test = function () {
}
var test2 = 2;
export { test, test2 }
var test = function () {
}
export { test as test2 }
export default class A {
}
var test = function () {
}
let test = function () {
}
let test = class {
}
let test = class {
}
export function someMethod() {
}
export function someMethod() {
}
exports.someMethod = function() {
}
const myObject = {
myProp: true
};
require-param-description
Requires that @param
tag has description
value.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param |
Aliases | arg , argument |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
require-param-name
Requires that all function parameters have name.
The @param
tag requires you to specify the name of the parameter you are documenting. You can also include the parameter's type, enclosed in curly brackets, and a description of the parameter.
JSDoc
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param |
Aliases | arg , argument |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
require-param-type
Requires that @param
tag has type
value.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param |
Aliases | arg , argument |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
require-param
Requires that all function parameters are documented.
Options
An options object accepts one optional property:
exemptedBy
- Array of tags (e.g., ['type']
) whose presence on the document
block avoids the need for a @param
. Defaults to an empty array.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | param |
Aliases | arg , argument |
Options | exemptedBy |
Settings | overrideReplacesDocs , augmentsExtendsReplacesDocs , implementsReplacesDocs |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo, bar) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
export class SomeClass {
constructor(private property: string, private foo: number) {}
}
function quux (foo) {
}
The following patterns are not considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
class A {
quux (foo) {
}
}
function quux (foo) {
}
class A {
quux (foo) {
}
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
class A {
quux (foo) {
}
}
function quux (foo) {
}
const test = something?.find(_ => _)
function foo(req, res, next) {}
function quux () {
}
var A = class {
quux (foo) {
}
}
export class SomeClass {
constructor(private property: string) {}
}
require-returns-check
Checks if the return expression exists in function body and in the comment.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | returns |
Aliases | return |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
const quux = () => {}
function quux () {
return foo;
}
const language = {
get name() {
this._name = name;
}
}
class Foo {
bar () {
}
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
return foo;
}
function quux () {
return foo;
}
function quux () {
return foo;
}
function quux () {
}
const quux = () => foo;
function quux () {}
function quux () {}
async function quux() {}
const quux = async function () {}
const quux = async () => {}
function quux () {
throw new Error('must be implemented by subclass!');
}
function quux () {
throw new Error('must be implemented by subclass!');
}
function quux () {
}
class Foo {
bar () {
}
}
function quux () {
}
function quux () {
}
function quux () {
return undefined;
}
function quux () {
return;
}
function quux () {
return undefined;
}
function quux () {
return;
}
function quux () {
try {
return true;
} catch (err) {
}
return;
}
function quux () {
try {
} finally {
return true;
}
return;
}
function quux () {
try {
return;
} catch (err) {
}
return true;
}
function quux () {
try {
something();
} catch (err) {
return true;
}
return;
}
function quux () {
switch (true) {
case 'abc':
return true;
}
return;
}
function quux () {
switch (true) {
case 'abc':
return;
}
return true;
}
function quux () {
for (const i of abc) {
return true;
}
return;
}
function quux () {
if (true) {
return;
}
return true;
}
function quux () {
if (true) {
return true;
}
}
function quux () {
if (true) {
return;
} else {
return true;
}
return;
}
require-returns-description
Requires that @returns
tag has description
value.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | returns |
Aliases | return |
The following patterns are considered problems:
function quux (foo) {
}
function quux (foo) {
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
require-returns-type
Requires that @returns
tag has type
value.
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | returns |
Aliases | return |
The following patterns are considered problems:
function quux () {
}
function quux () {
}
function quux () {
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
}
require-returns
Requires returns are documented.
Options
exemptedBy
- Array of tags (e.g., ['type']
) whose presence on the document
block avoids the need for a @returns
. Defaults to an empty array.forceRequireReturn
- Set to true
to always insist on
@returns
documentation regardless of implicit or explicit return
's
in the function. May be desired to flag that a project is aware of an
undefined
/void
return. Defaults to false
.forceReturnsWithAsync
- By default async
functions that do not explicitly return a value pass this rule. You can force all async
functions to require return statements by setting forceReturnsWithAsync
to true
on the options object. This may be useful as an async
function will always return a Promise
, even if the Promise
returns void. Defaults to false
.
'jsdoc/require-jsdoc': ['error', {forceReturnsWithAsync: true}]
| |
---|
Context | ArrowFunctionExpression , FunctionDeclaration , FunctionExpression |
Tags | returns |
Aliases | return |
Options | exemptedBy , forceRequireReturn , forceReturnsWithAsync |
Settings | overrideReplacesDocs , augmentsExtendsReplacesDocs , implementsReplacesDocs |
The following patterns are considered problems:
function quux (foo) {
return foo;
}
const foo = () => ({
bar: 'baz'
})
const foo = bar=>({ bar })
const foo = bar => bar.baz()
function quux (foo) {
return foo;
}
function foo() {}
function bar() {}
async function quux() {
}
const quux = async function () {}
const quux = async () => {}
async function quux () {}
function quux () {
}
const language = {
get name() {
return this._name;
}
}
async function quux () {
}
function quux (foo) {
return foo;
}
function quux () {
}
The following patterns are not considered problems:
function quux () {
return foo;
}
function quux () {
}
function quux (bar) {
bar.filter(baz => {
return baz.corge();
})
}
function quux (bar) {
return bar.filter(baz => {
return baz.corge();
})
}
const quux = (bar) => bar.filter(({ corge }) => corge())
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
}
function quux (foo) {
return foo;
}
function quux (foo) {
}
function quux (foo) {
}
function quux () {
return {a: foo};
}
const quux = () => ({a: foo});
const quux = () => {
return {a: foo}
};
function quux () {
}
const quux = () => {
}
function quux () {
}
const quux = () => {
}
function quux () {
}
const quux = () => {
}
class Foo {
constructor () {
}
}
const language = {
set name(name) {
this._name = name;
}
}
function quux () {
}
function quux () {
return undefined;
}
function quux () {
return undefined;
}
function quux () {
return;
}
function quux () {
}
function quux () {
return;
}
function quux (req, res , next) {
return;
}
async function quux () {
}
async function quux () {
}
async function quux () {}
const quux = async function () {}
const quux = async () => {}
class foo {
constructor () {
this.bar = true;
}
}
export default foo;
function quux () {
}
function quux () {
}
valid-types
Requires all types to be valid JSDoc or Closure compiler types without syntax errors.
Also impacts behaviors on namepath (or event)-defining and pointing tags:
- Name(path)-defining tags requiring namepath:
@external
, @host
, @name
, @typedef
- Name(path)-defining tags (which may have value without namepath or their
namepath can be expressed elsewhere on the block):
@event
, @callback
,
@class
, @constructor
, @constant
, @const
,
@function
, @func
, @method
, @interface
, @member
, @var
,
@mixin
, @namespace
- Name(path)-pointing tags requiring namepath:
@alias
, @augments
, @extends
, @lends
, @memberof
, @memberof!
, @mixes
, @this
- Name(path)-pointing tags (which may have value without namepath or their
namepath can be expressed elsewhere on the block):
@listens
, @fires
,
@emits
- Name(path)-pointing tags (multiple names in one):
@borrows
...with the following applying to the above sets:
- Expect tags in set 1-4 to have a valid namepath if present
- Prevent sets 2 and 4 from being empty by setting
allowEmptyNamepaths
to
false
as these tags might have some indicative value without a path
or may allow a name expressed elsewhere on the block (but sets 1 and 3 will
always fail if empty) - For the special case of set 5, i.e.,
@borrows <that namepath> as <this namepath>
,
check that both namepaths are present and valid and ensure there is an as
between them. In the case of <this namepath>
, it can be preceded by
one of the name path operators, #
, .
, or ~
. - For the special case of
@memberof
and @memberof!
(part of set 3), as
per the specification, they also
allow #
, .
, or ~
at the end (which is not allowed at the end of
normal paths).
Options
allowEmptyNamepaths
(default: true) - Set to false
to disallow
empty name paths with @callback
, @event
, @class
, @constructor
,
@constant
, @const
, @function
, @func
, @method
, @interface
,
@member
, @var
, @mixin
, @namespace
, @listens
, @fires
,
or @emits
(these might often be expected to have an accompanying
name path, though they have some indicative value without one; these
may also allow names to be defined in another manner elsewhere in
the block)checkSeesForNamepaths
(default: false) - Set this to true
to insist
that @see
only use name paths (the tag is normally permitted to
allow other text)
| |
---|
Context | everywhere |
Tags | For name only unless otherwise stated: alias , augments , borrows , callback , class (for name and type), constant (for name and type), enum (for type), event , external , fires , function , implements (for type), interface , lends , listens , member (for name and type), memberof , memberof! , mixes , mixin , module (for name and type), name , namespace (for name and type), param (for name and type), property (for name and type), returns (for type), this , throws (for type), type (for type), typedef (for name and type), yields (for type) |
Aliases | extends , constructor , const , host , emits , func , method , var , arg , argument , prop , return , exception , yield |
Closure-only | For type only: package , private , protected , public , static |
Options | allowEmptyNamepaths , checkSeesForNamepaths |
The following patterns are considered problems:
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function foo() {}
function quux() {
}
function quux() {
}
function quux() {
}
The following patterns are not considered problems:
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}
function quux() {
}