File tree 3 files changed +226
-191
lines changed
3 files changed +226
-191
lines changed Original file line number Diff line number Diff line change @@ -525,17 +525,15 @@ function warn(landmarks, reference) {
525
525
let ruleId
526
526
527
527
if ( hash ) {
528
- reason = 'Link to unknown heading'
528
+ reason = 'Cannot find heading for `#' + hash + '` '
529
529
ruleId = constants . headingRuleId
530
530
531
531
if ( base && path . join ( base , filePath ) !== absolute ) {
532
532
reason += ' in `' + filePath + '`'
533
533
ruleId = constants . headingInFileRuleId
534
534
}
535
-
536
- reason += ': `' + hash + '`'
537
535
} else {
538
- reason = 'Link to unknown file: `' + filePath + '`'
536
+ reason = 'Cannot find file `' + filePath + '`'
539
537
ruleId = constants . fileRuleId
540
538
}
541
539
@@ -569,17 +567,18 @@ function warn(landmarks, reference) {
569
567
} )
570
568
571
569
if ( suggestion ) {
572
- reason += '. Did you mean `' + suggestion + '`'
570
+ reason += '; did you mean `' + suggestion + '`'
573
571
}
574
572
575
573
let index = - 1
576
574
577
575
while ( ++ index < reference . nodes . length ) {
578
- const message = reference . file . message (
579
- reason ,
580
- reference . nodes [ index ] ,
581
- origin
582
- )
576
+ const node = reference . nodes [ index ]
577
+ const message = reference . file . message ( reason , {
578
+ place : node . position ,
579
+ source : origin ,
580
+ ruleId
581
+ } )
583
582
message . url = 'https://github.com/remarkjs/remark-validate-links#readme'
584
583
}
585
584
}
Original file line number Diff line number Diff line change 63
63
"c8" : " ^8.0.0" ,
64
64
"prettier" : " ^3.0.0" ,
65
65
"remark" : " ^15.0.0" ,
66
- "remark-cli" : " ^11 .0.0" ,
66
+ "remark-cli" : " ^12 .0.0" ,
67
67
"remark-preset-wooorm" : " ^9.0.0" ,
68
68
"strip-ansi" : " ^7.0.0" ,
69
69
"to-vfile" : " ^8.0.0" ,
74
74
},
75
75
"scripts" : {
76
76
"build" : " tsc --build --clean && tsc --build && type-coverage" ,
77
- "format" : " remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix" ,
77
+ "#" : " remark . --frail --output --quiet" ,
78
+ "format" : " prettier . --log-level warn --write && xo --fix" ,
78
79
"prepack" : " npm run build && npm run format" ,
79
80
"test" : " npm run build && npm run format && npm run test-coverage" ,
80
81
"test-api" : " node --conditions development test/index.js" ,
112
113
],
113
114
"prettier" : true ,
114
115
"rules" : {
115
- "unicorn/prefer-logical-operator-over-ternary" : " off"
116
+ "unicorn/prefer-logical-operator-over-ternary" : " off" ,
117
+ "unicorn/prefer-string-replace-all" : " off"
116
118
}
117
119
}
118
120
}
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments