File tree 3 files changed +34
-0
lines changed
3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -6177,6 +6177,12 @@ function quux () {
6177
6177
}
6178
6178
// Message: @abstract should be empty.
6179
6179
6180
+ /**
6181
+ * @interface extra text
6182
+ */
6183
+ // Settings: {" jsdoc" :{" mode" :" closure" }}
6184
+ // Message: @interface should be empty.
6185
+
6180
6186
class Test {
6181
6187
/**
6182
6188
* @abstract extra text
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ const emptyIfNotClosure = new Set([
19
19
'inheritdoc' ,
20
20
] ) ;
21
21
22
+ const emptyIfClosure = new Set ( [
23
+ 'interface' ,
24
+ ] ) ;
25
+
22
26
export default iterateJsdoc ( ( {
23
27
settings,
24
28
jsdoc,
@@ -33,6 +37,7 @@ export default iterateJsdoc(({
33
37
} ) => {
34
38
return tag === tagName ;
35
39
} ) ||
40
+ settings . mode === 'closure' && emptyIfClosure . has ( tagName ) ||
36
41
settings . mode !== 'closure' && emptyIfNotClosure . has ( tagName ) ;
37
42
} ) ;
38
43
for ( const tag of emptyTags ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,29 @@ export default {
24
24
}
25
25
` ,
26
26
} ,
27
+ {
28
+ code : `
29
+ /**
30
+ * @interface extra text
31
+ */
32
+ ` ,
33
+ errors : [
34
+ {
35
+ line : 3 ,
36
+ message : '@interface should be empty.' ,
37
+ } ,
38
+ ] ,
39
+ output : `
40
+ /**
41
+ * @interface
42
+ */
43
+ ` ,
44
+ settings : {
45
+ jsdoc : {
46
+ mode : 'closure' ,
47
+ } ,
48
+ } ,
49
+ } ,
27
50
{
28
51
code : `
29
52
class Test {
You can’t perform that action at this time.
0 commit comments