File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -525,17 +525,15 @@ function warn(landmarks, reference) {
525525 let ruleId
526526
527527 if ( hash ) {
528- reason = 'Link to unknown heading'
528+ reason = 'Cannot find heading for `#' + hash + '` '
529529 ruleId = constants . headingRuleId
530530
531531 if ( base && path . join ( base , filePath ) !== absolute ) {
532532 reason += ' in `' + filePath + '`'
533533 ruleId = constants . headingInFileRuleId
534534 }
535-
536- reason += ': `' + hash + '`'
537535 } else {
538- reason = 'Link to unknown file: `' + filePath + '`'
536+ reason = 'Cannot find file `' + filePath + '`'
539537 ruleId = constants . fileRuleId
540538 }
541539
@@ -569,17 +567,18 @@ function warn(landmarks, reference) {
569567 } )
570568
571569 if ( suggestion ) {
572- reason += '. Did you mean `' + suggestion + '`'
570+ reason += '; did you mean `' + suggestion + '`'
573571 }
574572
575573 let index = - 1
576574
577575 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+ } )
583582 message . url = 'https://github.com/remarkjs/remark-validate-links#readme'
584583 }
585584}
Original file line number Diff line number Diff line change 6363 "c8" : " ^8.0.0" ,
6464 "prettier" : " ^3.0.0" ,
6565 "remark" : " ^15.0.0" ,
66- "remark-cli" : " ^11 .0.0" ,
66+ "remark-cli" : " ^12 .0.0" ,
6767 "remark-preset-wooorm" : " ^9.0.0" ,
6868 "strip-ansi" : " ^7.0.0" ,
6969 "to-vfile" : " ^8.0.0" ,
7474 },
7575 "scripts" : {
7676 "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" ,
7879 "prepack" : " npm run build && npm run format" ,
7980 "test" : " npm run build && npm run format && npm run test-coverage" ,
8081 "test-api" : " node --conditions development test/index.js" ,
112113 ],
113114 "prettier" : true ,
114115 "rules" : {
115- "unicorn/prefer-logical-operator-over-ternary" : " off"
116+ "unicorn/prefer-logical-operator-over-ternary" : " off" ,
117+ "unicorn/prefer-string-replace-all" : " off"
116118 }
117119 }
118120}
You can’t perform that action at this time.
0 commit comments