Skip to content

Documentation: Use Remark as linter in text editors #159

Open
caseywatts wants to merge 7 commits into
decaporg:mainfrom
caseywatts:cw/document-linters
Open

Documentation: Use Remark as linter in text editors #159
caseywatts wants to merge 7 commits into
decaporg:mainfrom
caseywatts:cw/document-linters

Conversation

@caseywatts
Copy link
Copy Markdown
Contributor

Add documentation for how to set up remark as a linter.

Addresses decaporg/decap-cms#7781

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for decap-www ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 0f3c5f2
🔍 Latest deploy log https://app.netlify.com/projects/decap-www/deploys/69fcd070ddc772000859f6ad
😎 Deploy Preview https://deploy-preview-159--decap-www.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@caseywatts
Copy link
Copy Markdown
Contributor Author

One question I had -- is there a way currently to redirect the old URL to this one?

Normally I would do that, but I don't see that feature here.
(maybe I'm missing it, or maybe this site doesn't have that feature set up)

Copy link
Copy Markdown
Member

@martinjagodic martinjagodic left a comment

Choose a reason for hiding this comment

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

LGTM, but let's wait for @yanthomasdev to give the final approval, he is the docs master.

Comment thread content/docs/editor-tooling.md
Co-authored-by: Martin Jagodic <jagodicmartin1@gmail.com>
Copy link
Copy Markdown
Contributor

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

Thanks @caseywatts, appreciate the contribution! I added a few comments regarding wording and the recommendation.

Comment thread content/docs/editor-tooling.md Outdated
Comment on lines +15 to +18
To set this up, you will need to install and set up both of these npm packages in your project:

- remark: https://remark.js.org/
- remark-frontmatter: https://github.com/remarkjs/remark-frontmatter
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess most of the time people will want to use remark-lint with remark-cli instead of the core remark? I know you can use it programatically through the remark API in a JS file, but we should focus on the easier path for people. What do you think about rewriting this part a bit so it leads users to using remark-lint instead? https://github.com/remarkjs/remark-lint#example-check-markdown-on-the-cli?

I think remark-lint will not mess with frontmatter, so maybe remark-frontmatter isn't even necessary? I haven't tested, if you could check this that would be great.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think you're right that people will likely use remark-cli instead of remark directly! That's what my team is doing, too. I can update that, no problem.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On my project we did initially try to do it without remark-frontmatter and I wasn't able to get it working without that. The CLI interface scans each entire file, and it's not aware of the frontmatter enough to know how to skip it without that plugin.

In our Decap situation it behaves differently, because the markdown widget (which runs remark) is only manipulating the markdown body section of the markdown file. The Decap markdown widget is not aware of the frontmatter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One thing I noticed on the remark-lint page is that it suggests a bunch of plugins:

npm install remark-cli remark-preset-lint-consistent remark-preset-lint-recommended remark-lint-list-item-indent --save-dev

Since we want to make sure people are getting set up with the same configuration as the Decap markdown widget, maybe we could align these. Either:

  1. Update the markdown widget to use this set of plugins (more in line with their current guidance, but it's a change we'd have to understand better & communicate out next version release)
  2. Or suggest NOT using the plugins, and write a bit more configuration & notes here on this help page.

Which approach do you think would be better? (or do you have another idea?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll say 2 should be easier, if you could bring a bit of what you did in your project as quite of a quick set up for remark linting would be great!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great -- I added the setup from my project as an example here 👏

Comment thread content/docs/editor-tooling.md Outdated
caseywatts and others added 2 commits May 5, 2026 13:58
Comment thread content/docs/editor-tooling.md Outdated
Comment thread content/docs/editor-tooling.md Outdated
caseywatts and others added 3 commits May 7, 2026 13:45
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

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

LGTM!

@martinjagodic martinjagodic added the pending feature release Marks docs PRs that are waiting for a PR on the main repo label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending feature release Marks docs PRs that are waiting for a PR on the main repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants