Add remark-validate-relative-links plugin#1474
Conversation
Part of - https://github.com/webpro/remark-preset-webpro - https://github.com/webpro/mdxlint-preset-webpro Has already been quite useful in two projects: - release-it/release-it@6e6dd4b - webpro-nl/knip@a8d0bfd Signed-off-by: Lars Kappert <lars@webpro.nl>
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1474 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 138 138
=========================================
Hits 138 138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| — turn bolds, italics, and code into UTF 8 special characters | ||
| * 🟢 [`remark-validate-links`](https://github.com/remarkjs/remark-validate-links) | ||
| — check links to headings and files | ||
| * 🟢 [`remark-validate-relative-links`](https://github.com/webpro/remark-validate-relative-links) |
There was a problem hiding this comment.
I'm not sure I understand this plugin from the readme, it looks like it does the same thing as https://github.com/remarkjs/remark-validate-links ?
ALso this doesn't appear to have types? Or be published to npm? Or have a CI/CD job testing it. All are things we look for in something to recommend to the community
There was a problem hiding this comment.
Good points!
So, I started out by using remark-validate-links. But wanted to include/validate only relative links. With "skipPathPatterns": ["^/"] I noticed it resolves everything to absolute paths so the result is that all links are excluded (there isn't really a way around this, right?). Also was looking for something simpler without the "did you mean.." output (auto-completion in the editor is enough for me). So it's very similar indeed but the difference is that it validates only relative links. No frills.
The plugin is published at https://www.npmjs.com/package/remark-validate-relative-links. There's some basic types, the plugin does not take options (yet?).
I'll add some tests right away.
|
I have some tips.
|
|
Thanks a bunch for the tips, much appreciated. Applied most of it and released v1. |
|
Initial checklist
Description of changes
Part of
Has already been quite useful in two projects: