File tree 2 files changed +18
-5
lines changed 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,14 @@ test('lintComments', function() {
28
28
{ message : 'Missing or invalid tag name' }
29
29
] ) ;
30
30
31
+ expect (
32
+ evaluate ( function ( ) {
33
+ /**
34
+ * @param {Object } foo.bar
35
+ */
36
+ } ) . errors
37
+ ) . toEqual ( [ { message : 'Parent of foo.bar not found' } ] ) ;
38
+
31
39
expect (
32
40
evaluate ( function ( ) {
33
41
/**
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ var VFile = require('vfile');
4
4
import { walk } from './walk' ;
5
5
import vfileSort from 'vfile-sort' ;
6
6
import reporter from 'vfile-reporter' ;
7
+ import nest from './nest' ;
7
8
8
9
var CANONICAL = {
9
10
String : 'string' ,
@@ -27,11 +28,8 @@ function lintComments(comment: Comment) {
27
28
function nameInvariant ( name ) {
28
29
if ( name && typeof CANONICAL [ name ] === 'string' ) {
29
30
comment . errors . push ( {
30
- message : 'type ' +
31
- name +
32
- ' found, ' +
33
- CANONICAL [ name ] +
34
- ' is standard' ,
31
+ message :
32
+ 'type ' + name + ' found, ' + CANONICAL [ name ] + ' is standard' ,
35
33
commentLineNumber : tag . lineNumber
36
34
} ) ;
37
35
}
@@ -60,6 +58,13 @@ function lintComments(comment: Comment) {
60
58
checkCanonical ( tag . type ) ;
61
59
}
62
60
} ) ;
61
+
62
+ try {
63
+ nest ( comment ) ;
64
+ } catch ( error ) {
65
+ comment . errors . push ( { message : error . message } ) ;
66
+ }
67
+
63
68
return comment ;
64
69
}
65
70
You can’t perform that action at this time.
0 commit comments