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

add markdown linting using remark #2181

Merged
merged 10 commits into from
Apr 13, 2020
Merged

add markdown linting using remark #2181

merged 10 commits into from
Apr 13, 2020

Conversation

goto-bus-stop
Copy link
Contributor

Lints our readmes, blog posts, and docs. The settings are derived from remark-preset-lint-recommended which only checks for actual mistakes like missing [url][references], and things that are not supported by all parsers. I disabled the rules around list item indentation because we don't follow them anywhere and that massive diff isn't really worth it. One other possibly controversial thing it requires is adding <> around literal URLs (visit <https://uppy.io> instead of visit https://uppy.io). I didn't know that was a thing but I quite like it and it doesn't require that many changes to comply.

The main benefits for us are that it checks that url references and url definitions match. I also wanted this to check for links to headings #getFile-id, which often include function signatures in our docs, and the heading anchor changes if the signature changes. There's a plugin that does that but it slugifies slightly differently from hexo so I haven't added it yet.

This uses a new internal package remark-lint-uppy so all the remark dependencies are grouped and we have a place to document it if we ever need to.

I wasn't sure what to name the folder—I put it in private/remark-lint-uppy for now, but we could also just stick it in packages/remark-lint-uppy, lerna won't publish it anyway if we keep the "private": true in package.json. Thoughts/preferences?

Copy link
Member

@kvz kvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(visit <https://uppy.io> instead of visit https://uppy.io). I didn't know that was a thing but I quite like it and it doesn't require that many changes to comply.

^-- i don't always add URLs as is, but when i do I <> wrap them when i intend auto-hyperlinking; so not controversial in my mind at least :)

No strong opinions on the other things, this looks very fine to me!

@arturi
Copy link
Contributor

arturi commented Apr 13, 2020

Looks very good! I like the <http://url> thing!

I wasn't sure what to name the folder—I put it in private/remark-lint-uppy for now, but we could also just stick it in packages/remark-lint-uppy, lerna won't publish it anyway if we keep the "private": true in package.json. Thoughts/preferences?

I think I’d prefer to only keep actual uppy packages in packages, as to not confuse ourselves and contributors, and this is website-related.

@goto-bus-stop goto-bus-stop merged commit 7bf390a into master Apr 13, 2020
@delete-merged-branch delete-merged-branch bot deleted the markdown-lint branch April 13, 2020 07:48
HeavenFox pushed a commit to docsend/uppy that referenced this pull request Jun 27, 2023
* build: add markdown linting

* build: support markdown front matter

* build: fail remark lint on warnings

* Fix markdown lint warnings

* changelog: fix markdown errors, allow literal URLs

* ci: add markdown lint step

* website: regenerate contributing.md

* build: properly ignore vendor and built files from remark-lint

* build: add private packages to lerna config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants