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

chore: add incorrect and correct in all rule docs #16031

Closed

Conversation

harish-sethuraman
Copy link
Member

@harish-sethuraman harish-sethuraman commented Jun 21, 2022

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

Add correct and incorrect to all code snippets

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Ran regex to add correct and incorrect to all files at once

find

\*\*correct\*\*(.*)\n*(```.*(\n|.)*?```)

replace with

**correct**$1

::: correct
$2 
:::

we basically group the text after the **correct** until the line end \n and that is $1. The $2 is the code snippet wrapped within ```. Same works well with the text in correct as well

If you see one empty line after the ``` closing it is because of the new line addition after ::: correct or ::: incorrect but in file it is not going to be there

In case if you were wondering what would happen to the markdowns already with correct and incorrect values. The regex wouldn't match it so no adding correct and incorrect wrapper for those snippets :)

@eslint-github-bot eslint-github-bot bot added triage An ESLint team member will look at this issue soon chore This change is not user-facing labels Jun 21, 2022
@netlify
Copy link

netlify bot commented Jun 21, 2022

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit a992702
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/62b147e88d145c00081b7287
😎 Deploy Preview https://deploy-preview-16031--docs-eslint.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 site settings.

@mdjermanovic
Copy link
Member

This is solving the same issue as #16021?

@harish-sethuraman
Copy link
Member Author

Hey 👋🏻 Seems like yes but that has less addition may be something was missed in the manual effort? When I raised the PR there were only 30 file changes and it had been 3 days #16013 (comment) no response for my comment either. Came across an easy way to replace all occurrences without missing any of them so sent a PR.

@mdjermanovic
Copy link
Member

I merged #16021 because it was submitted first, but thanks for working on this!

@harish-sethuraman
Copy link
Member Author

No Probs 😛

@harish-sethuraman harish-sethuraman deleted the add-valid-invalid branch June 22, 2022 04:37
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Dec 20, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing triage An ESLint team member will look at this issue soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants