Skip to content

Commit 397a3bb

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 7beadb6 commit 397a3bb

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
@@ -1427,7 +1427,6 @@ memberof
14271427
memberof!
14281428
mixes
14291429
mixin
1430-
modifies (Currently undocumented but in source)
14311430
module
14321431
name
14331432
namespace
@@ -1456,6 +1455,8 @@ version
14561455
yields
14571456
```
14581457

1458+
`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.
1459+
14591460
The following synonyms are also recognized:
14601461

14611462
```
@@ -1488,12 +1489,12 @@ one may also use the following:
14881489
template
14891490
```
14901491

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

14951496
```
1496-
define
1497+
define (synonym of `const` per jsdoc source)
14971498
dict
14981499
export
14991500
externs
@@ -1508,11 +1509,29 @@ nosideeffects
15081509
polymer
15091510
polymerBehavior
15101511
preserve
1512+
record (synonym of `interface` per jsdoc source)
15111513
struct
15121514
suppress
15131515
unrestricted
15141516
```
15151517

1518+
...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):
1519+
1520+
```
1521+
closurePrimitive
1522+
customElement
1523+
expose
1524+
hidden
1525+
idGenerator
1526+
meaning
1527+
mixinClass
1528+
mixinFunction
1529+
ngInject
1530+
owner
1531+
typeSummary
1532+
wizaction
1533+
```
1534+
15161535
Note that the tags indicated as replacements in `settings.jsdoc.tagNamePreference` will automatically be considered as valid.
15171536

15181537
<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)