typescript-eslint / typescript-eslint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript
https://typescript-eslint.io
Other
15.12k stars 2.71k forks source link

Use markdown linting instead of Jest for validating .md docs #4366

Open JoshuaKGoldberg opened 2 years ago

JoshuaKGoldberg commented 2 years ago

Right now, packages/eslint-plugin/docs.test.ts is what validates rule docs are set up properly. I think it'd give a better dev experience to have whatever linter we use for markdown validate inline rather than waiting for a separate CI job / CLI task.

Blocked on #3223, presumably, in case we do end up switching to remark-lint / eslint-plugin-mdx.

bradzacher commented 2 years ago

The reason we set it up as a jest test was because it was super easy to script it up by using a markdown parser and we needed to load all of the rule files as well as the markdown files.

The issue with doing this in a Linter is that you need to have the latest disk contents each lint run. In the IDE this can be clunky because lint runs are so frequent.. so you need to build some watch and cache system. (This is a problem eslint-plugin-import had to solve).

It's definitely doable! But it's just a lot harder than slapping together a jest test!

An ESLint rule with a fixer would be much better though.