Skip to content

Commit ad9af24

Browse files
committed
fix(check-tag-names): add record and undocumented tags in Closure source to Closure tags; fixes #306
Also removes mistaken use of anchor in documentation URL (minor), indicates Closure synonyms; and gives URL for source of undocumented `modifies`
1 parent 5b0ba6c commit ad9af24

File tree

3 files changed

+66
-6
lines changed

3 files changed

+66
-6
lines changed

.README/rules/check-tag-names.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ memberof
4747
memberof!
4848
mixes
4949
mixin
50-
modifies (Currently undocumented but in source)
5150
module
5251
name
5352
namespace
@@ -76,6 +75,8 @@ version
7675
yields
7776
```
7877

78+
`modifies` is also supported (see [source](https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594)) but is undocumented.
79+
7980
The following synonyms are also recognized:
8081

8182
```
@@ -108,12 +109,12 @@ one may also use the following:
108109
template
109110
```
110111

111-
And for [Closure](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#nosideeffects-modifies-thisarguments),
112+
And for [Closure](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler),
112113
when `settings.jsdoc.mode` is set to `closure`, one may use the following (in
113114
addition to the jsdoc and TypeScript tags):
114115

115116
```
116-
define
117+
define (synonym of `const` per jsdoc source)
117118
dict
118119
export
119120
externs
@@ -128,11 +129,29 @@ nosideeffects
128129
polymer
129130
polymerBehavior
130131
preserve
132+
record (synonym of `interface` per jsdoc source)
131133
struct
132134
suppress
133135
unrestricted
134136
```
135137

138+
...and these undocumented tags which are only in [source](https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java):
139+
140+
```
141+
closurePrimitive
142+
customElement
143+
expose
144+
hidden
145+
idGenerator
146+
meaning
147+
mixinClass
148+
mixinFunction
149+
ngInject
150+
owner
151+
typeSummary
152+
wizaction
153+
```
154+
136155
Note that the tags indicated as replacements in `settings.jsdoc.tagNamePreference` will automatically be considered as valid.
137156

138157
#### Options

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,6 @@ memberof
14511451
memberof!
14521452
mixes
14531453
mixin
1454-
modifies (Currently undocumented but in source)
14551454
module
14561455
name
14571456
namespace
@@ -1480,6 +1479,8 @@ version
14801479
yields
14811480
```
14821481

1482+
`modifies` is also supported (see [source](https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js#L594)) but is undocumented.
1483+
14831484
The following synonyms are also recognized:
14841485

14851486
```
@@ -1512,12 +1513,12 @@ one may also use the following:
15121513
template
15131514
```
15141515

1515-
And for [Closure](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#nosideeffects-modifies-thisarguments),
1516+
And for [Closure](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler),
15161517
when `settings.jsdoc.mode` is set to `closure`, one may use the following (in
15171518
addition to the jsdoc and TypeScript tags):
15181519

15191520
```
1520-
define
1521+
define (synonym of `const` per jsdoc source)
15211522
dict
15221523
export
15231524
externs
@@ -1532,11 +1533,29 @@ nosideeffects
15321533
polymer
15331534
polymerBehavior
15341535
preserve
1536+
record (synonym of `interface` per jsdoc source)
15351537
struct
15361538
suppress
15371539
unrestricted
15381540
```
15391541

1542+
...and these undocumented tags which are only in [source](https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java):
1543+
1544+
```
1545+
closurePrimitive
1546+
customElement
1547+
expose
1548+
hidden
1549+
idGenerator
1550+
meaning
1551+
mixinClass
1552+
mixinFunction
1553+
ngInject
1554+
owner
1555+
typeSummary
1556+
wizaction
1557+
```
1558+
15401559
Note that the tags indicated as replacements in `settings.jsdoc.tagNamePreference` will automatically be considered as valid.
15411560

15421561
<a name="eslint-plugin-jsdoc-rules-check-tag-names-options-2"></a>

src/tagNames.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,26 @@ const typeScriptTags = {
122122
template: [],
123123
};
124124

125+
const undocumentedClosureTags = {
126+
// These are in Closure source but not in jsdoc source nor in the Closure
127+
// docs: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/parsing/Annotation.java
128+
closurePrimitive: [],
129+
customElement: [],
130+
expose: [],
131+
hidden: [],
132+
idGenerator: [],
133+
meaning: [],
134+
mixinClass: [],
135+
mixinFunction: [],
136+
ngInject: [],
137+
owner: [],
138+
typeSummary: [],
139+
wizaction: [],
140+
};
141+
125142
const closureTags = {
126143
...typeScriptTags,
144+
...undocumentedClosureTags,
127145

128146
// From https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler
129147
// These are all recognized in https://github.com/jsdoc/jsdoc/blob/master/packages/jsdoc/lib/jsdoc/tag/dictionary/definitions.js
@@ -151,6 +169,10 @@ const closureTags = {
151169
polymer: [],
152170
polymerBehavior: [],
153171
preserve: [],
172+
173+
// Defined as a synonym of `interface` in jsdoc `definitions.js`
174+
record: [],
175+
154176
struct: [],
155177
suppress: [],
156178

0 commit comments

Comments
 (0)