File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -5447,6 +5447,15 @@ function quux (foo) {
5447
5447
}
5448
5448
// Settings: {"jsdoc":{"mode":"typescript","preferredTypes":{"Object":"object"}}}
5449
5449
// Message: Invalid JSDoc @param "foo" type "Object"; prefer: "object".
5450
+
5451
+ /**
5452
+ * @param {object.<string>} foo
5453
+ */
5454
+ function quux (foo ) {
5455
+
5456
+ }
5457
+ // Settings: {"jsdoc":{"mode":"typescript","preferredTypes":{"object.<>":"Object"}}}
5458
+ // Message: Invalid JSDoc @param "foo" type "object"; prefer: "Object".
5450
5459
````
5451
5460
5452
5461
The following patterns are not considered problems:
@@ -5734,6 +5743,14 @@ function b () {}
5734
5743
function quux (foo ) {
5735
5744
5736
5745
}
5746
+
5747
+ /**
5748
+ * @param {Object.<string>} foo
5749
+ */
5750
+ function quux (foo ) {
5751
+
5752
+ }
5753
+ // Settings: {"jsdoc":{"mode":"typescript"}}
5737
5754
````
5738
5755
5739
5756
Original file line number Diff line number Diff line change @@ -2161,6 +2161,38 @@ export default {
2161
2161
} ,
2162
2162
} ,
2163
2163
} ,
2164
+ {
2165
+ code : `
2166
+ /**
2167
+ * @param {object.<string>} foo
2168
+ */
2169
+ function quux (foo) {
2170
+
2171
+ }
2172
+ ` ,
2173
+ errors : [
2174
+ {
2175
+ line : 3 ,
2176
+ message : 'Invalid JSDoc @param "foo" type "object"; prefer: "Object".' ,
2177
+ } ,
2178
+ ] ,
2179
+ output : `
2180
+ /**
2181
+ * @param {Object.<string>} foo
2182
+ */
2183
+ function quux (foo) {
2184
+
2185
+ }
2186
+ ` ,
2187
+ settings : {
2188
+ jsdoc : {
2189
+ mode : 'typescript' ,
2190
+ preferredTypes : {
2191
+ 'object.<>' : 'Object' ,
2192
+ } ,
2193
+ } ,
2194
+ } ,
2195
+ } ,
2164
2196
] ,
2165
2197
valid : [
2166
2198
{
@@ -2757,5 +2789,20 @@ export default {
2757
2789
}
2758
2790
` ,
2759
2791
} ,
2792
+ {
2793
+ code : `
2794
+ /**
2795
+ * @param {Object.<string>} foo
2796
+ */
2797
+ function quux (foo) {
2798
+
2799
+ }
2800
+ ` ,
2801
+ settings : {
2802
+ jsdoc : {
2803
+ mode : 'typescript' ,
2804
+ } ,
2805
+ } ,
2806
+ } ,
2760
2807
] ,
2761
2808
} ;
You can’t perform that action at this time.
0 commit comments