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

test(linter): ensure rule docs have valid syntax #4644

Merged

Conversation

DonIsaac
Copy link
Collaborator

@DonIsaac DonIsaac commented Aug 5, 2024

Adds tests for rule documentation by

  1. Compiling doc markdown into HTML, which ensures docs use valid markdown syntax
  2. Converts the generated HTML into JSX and parses the results with the parser, ensuring the generated HTML is valid

Has the added benefit of adding a lot of JSX test cases to the parser. I've also fixed all violations for these tests in this PR.

Copy link

graphite-app bot commented Aug 5, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Collaborator Author

DonIsaac commented Aug 5, 2024

Copy link

codspeed-hq bot commented Aug 5, 2024

CodSpeed Performance Report

Merging #4644 will not alter performance

Comparing don/08-04-test_linter_ensure_rule_docs_are_valid_markdown (8f2a566) with main (b3c3125)

Summary

✅ 29 untouched benchmarks

@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from 4c3c1d2 to 118821e Compare August 5, 2024 04:05
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 7c41199 to 654ee5e Compare August 5, 2024 04:05
@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from 118821e to 90fe51f Compare August 5, 2024 04:31
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 654ee5e to 3d74cce Compare August 5, 2024 04:31
@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from 90fe51f to a4131cc Compare August 5, 2024 15:29
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch 2 times, most recently from c19042d to 376954f Compare August 5, 2024 17:25
@DonIsaac DonIsaac changed the title test(linter): ensure rule docs are valid markdown test(linter): ensure rule docs have valid syntax Aug 5, 2024
@DonIsaac DonIsaac requested a review from Boshen August 5, 2024 17:27
@DonIsaac DonIsaac marked this pull request as ready for review August 5, 2024 17:27
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch 2 times, most recently from d55dab0 to 6803de2 Compare August 5, 2024 19:23
@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from a4131cc to ab59cff Compare August 5, 2024 19:23
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 6803de2 to be1445a Compare August 5, 2024 19:24
@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from ab59cff to c34beee Compare August 6, 2024 22:47
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from be1445a to d787b05 Compare August 6, 2024 22:47
@DonIsaac DonIsaac force-pushed the don/08-04-feat_website_auto-generate_rule_docs_pages branch from c34beee to 2fe39dd Compare August 9, 2024 19:59
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from d787b05 to 957bea4 Compare August 9, 2024 20:00
@Boshen Boshen changed the base branch from don/08-04-feat_website_auto-generate_rule_docs_pages to graphite-base/4644 August 10, 2024 00:13
@Boshen Boshen force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 957bea4 to 5028db4 Compare August 10, 2024 00:17
@Boshen Boshen changed the base branch from graphite-base/4644 to main August 10, 2024 00:18
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch 3 times, most recently from 68b4468 to c49cc99 Compare August 10, 2024 03:43
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 22f1f4e to 2afa0cf Compare August 10, 2024 04:56
@DonIsaac DonIsaac added the 0-merge Merge with Graphite Merge Queue label Aug 10, 2024
Copy link

graphite-app bot commented Aug 10, 2024

Merge activity

  • Aug 10, 12:56 AM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 10, 1:02 AM EDT: DonIsaac added this pull request to the Graphite merge queue.
  • Aug 10, 1:07 AM EDT: DonIsaac merged this pull request with the Graphite merge queue.

@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 2afa0cf to 5d6d035 Compare August 10, 2024 05:00
Adds tests for rule documentation by
1. Compiling doc markdown into HTML, which ensures docs use valid markdown syntax
2. Converts the generated HTML into JSX and parses the results with the parser, ensuring the generated HTML is valid

Has the added benefit of adding a lot of JSX test cases to the parser. I've also fixed all violations for these tests in this PR.
@DonIsaac DonIsaac force-pushed the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch from 5d6d035 to 8f2a566 Compare August 10, 2024 05:03
@graphite-app graphite-app bot merged commit 8f2a566 into main Aug 10, 2024
24 checks passed
@graphite-app graphite-app bot deleted the don/08-04-test_linter_ensure_rule_docs_are_valid_markdown branch August 10, 2024 05:07
@oxc-bot oxc-bot mentioned this pull request Aug 12, 2024
Boshen added a commit that referenced this pull request Aug 12, 2024
## [0.7.1] - 2024-08-12

### Features

- 3d40528 linter: Add fix emoji to rules table and doc pages (#4715)
(DonIsaac)
- d2734f3 linter: Start fixer for no-unused-vars (#4718) (DonIsaac)
- 070ae53 linter: Add fixer for unicorn prefer-string-replace-all
(#4801) (camc314)
- b3c3125 linter: Overhaul unicorn/no-useless-spread (#4791) (DonIsaac)
- 5992b75 linter: Implement `eslint-plugin-promise/no-return-in-finally,
prefer-await-to-then` rule (#4318) (Jelle van der Waa)
- b259f47 linter: Add fixer for unicorn/no-length-as-slice-end (#4780)
(heygsc)
- abd83fa linter: Add fixer for jsx_ally/no_aria_hidden_on_focusable
(#4772) (heygsc)
- b20e335 linter: Add fixer for eslint/no-eq-null (#4758) (heygsc)
- 2f6c3b9 linter: Add fixer for eslint/no-compare-neg-zero (#4748)
(heygsc)
- eaddc8f linter: Add fixer for eslint/func_names (#4714) (DonIsaac)
- 80557a9 linter: Add fixer for eslint/for-direction (#4679) (heygsc)
- c3c5766 linter/eslint-plugin-promise: Implement valid-params (#4598)
(Jelle van der Waa)
- c509a21 linter/eslint-plugin-vitest: Implement prefer-to-be-falsy
(#4770) (dalaoshu)
- 41f861f linter/eslint-plugin-vitest: Implement prefer-to-be-truthy
(#4755) (dalaoshu)
- cc922f4 vscode: Provide config's schema to oxlint config files (#4826)
(Don Isaac)
- f629514 website: Auto-generate rule docs pages (#4640) (DonIsaac)

### Bug Fixes

- b22ed45 linter: Improve prefer_namespace_keyword rule (#4751) (Burlin)
- db68a6c linter: Fixer for eslint/for-direction (#4727) (heygsc)
- 6273994 linter: Block in eslint/no_cond_assign (#4721) (heygsc)
- b9d6aa5 linter: Fix false positives in no-confusing-non-null-assertion
(#4665) (Renée)
- cbf08d2 linter: Skip no-multi-str on jsx attributes (#4666) (heygsc)
- a6f9f96 linter: No unused errors should be warnings (Boshen)
- 7345bc9 linter/func-names: Handle ts accessibility when reporting
missing names (#4713) (DonIsaac)

### Performance

- d191823 linter: Optmize allocations in jest fn parsing (#4787) (lucab)
- e3abdfa linter: Reduce String allocations and clones (#4673)
(DonIsaac)

### Documentation

- 4b7dfd6 linter: Correct docs for no-unused-vars (#4716) (Don Isaac)

### Refactor

- 096ac7b linter: Clean up jsx-a11y/anchor-is-valid (#4831) (DonIsaac)
- 15a0fd4 linter: Use Option to reduce nested level in
`eslint/getter-return` (#4814) (IWANABETHATGUY)
- 63f274c linter: Simplify NoObjCalls resolution logic (#4765) (lucab)
- 6708680 linter: Replace Windows-style line breaks with Unix-style in
test fixture (#4768) (overlookmotel)
- e285903 linter: Clean up eslint/func_names (#4710) (DonIsaac)

### Testing

- 8f2a566 linter: Ensure rule docs have valid syntax (#4644) (DonIsaac)
- 4dd29db linter: Add fixer test for unicorn/no-zero-fractions (#4783)
(heygsc)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants