Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule for ordering reference links #140

Closed
nschonni opened this issue Sep 30, 2020 · 4 comments
Closed

Rule for ordering reference links #140

nschonni opened this issue Sep 30, 2020 · 4 comments

Comments

@nschonni
Copy link
Member

This is more style over function, but got the idea from @aduh95 in #139

Basic premise would be to flag:

Lorem impsom [Link A][], [Link B][]

[Link B]: http://example.com/bar
[Link A]: http://example.com/foo

Would flag that the Link A reference is before the Link B reference in the bottom.

Reasoning is, some pages the reference section gets quite large, and an alphabetical list is easier to visually parse when looking for one to update.

@aduh95
Copy link
Contributor

aduh95 commented Sep 30, 2020

Something like this has been implemented in node core in nodejs/node#35244. However, the checkLinks.js script doesn't check documentation files (but instead, all the other markdown files that are not cover make lint-md).

If nodejs/node#35191 lands, that would change, enforcing de facto the ordering of references for the docs, so I'm not sure it's worth investing time making a lint rule on top of it.

@nschonni
Copy link
Member Author

@aduh95 interesting, thanks! It would be interesting to find/write a remark-lint rule though, because then other repos that use this preset could take advantage as well

@Trott
Copy link
Member

Trott commented Jun 30, 2021

Is this fixed by #188 or are they different things?

@aduh95
Copy link
Contributor

aduh95 commented Jun 30, 2021

Yes, #188 do enforce ordering of reference links, and would typically flag the example in the OP as invalid.
Closing, @nschonni please reopen if you meant something else.

@aduh95 aduh95 closed this as completed Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants