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

Markdown support #49

Open
RDambrosio016 opened this issue Oct 14, 2020 · 0 comments
Open

Markdown support #49

RDambrosio016 opened this issue Oct 14, 2020 · 0 comments
Labels
E-medium Fixing/implementing this issue is moderately hard and you may need some prior experience E-mentor T-CLI This issue primarily relates to the CLI (rslint_cli) T-Runner This issue primary relates to the lint runner, rslint_core

Comments

@RDambrosio016
Copy link
Collaborator

This is a pretty easy but useful feature, being able to lint markdown files. Implementing this should be quite easy, simply use a regex like

\`\`\`(?:js|javascript)\n([\s\S]*?)\n\`\`\`

Then add a variant to JsFileKind for markdown. Then you can extract each code block using the regex and the first capture group. Then run rules as you would using the src of each group and the same file id. And finally merge the results from each code block run by offsetting the range of each label by the offset of the block. There might be some wonky handling for non-Ok lint runs but overall it should be pretty easy.

@RDambrosio016 RDambrosio016 added T-Runner This issue primary relates to the lint runner, rslint_core T-CLI This issue primarily relates to the CLI (rslint_cli) E-mentor E-medium Fixing/implementing this issue is moderately hard and you may need some prior experience labels Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-medium Fixing/implementing this issue is moderately hard and you may need some prior experience E-mentor T-CLI This issue primarily relates to the CLI (rslint_cli) T-Runner This issue primary relates to the lint runner, rslint_core
Projects
None yet
Development

No branches or pull requests

1 participant