Skip to content

chore: lint code blocks in docs with ESLint#42113

Merged
VerteDinde merged 1 commit intomainfrom
chore/eslint-code-blocks
May 29, 2025
Merged

chore: lint code blocks in docs with ESLint#42113
VerteDinde merged 1 commit intomainfrom
chore/eslint-code-blocks

Conversation

@dsanders11
Copy link
Member

@dsanders11 dsanders11 commented May 10, 2024

Description of Change

Main motivation at the moment is to run unicorn/prefer-node-protocol over the code blocks, but it may also catch some other errors as well.

cc @electron/docs

Checklist

  • PR description included and stakeholders cc'd

Release Notes

Notes: none

@electron-cation electron-cation bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels May 10, 2024
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 925a227 to f448ad2 Compare June 26, 2024 01:27
@dsanders11 dsanders11 marked this pull request as ready for review June 26, 2024 02:50
@dsanders11 dsanders11 marked this pull request as draft June 26, 2024 02:52
@electron-cation electron-cation bot added new-pr 🌱 PR opened recently and removed new-pr 🌱 PR opened recently labels Jun 26, 2024
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 3a0ce70 to 469c00e Compare August 13, 2024 21:11
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch 2 times, most recently from 6539312 to 9ad8bc7 Compare October 4, 2024 23:05
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 9ad8bc7 to 210f1a4 Compare October 21, 2024 21:55
@dsanders11 dsanders11 marked this pull request as ready for review October 21, 2024 23:41
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 210f1a4 to 502940b Compare November 12, 2024 22:17
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 502940b to a306f00 Compare May 27, 2025 07:54
Comment on lines +13 to +33
"@typescript-eslint/no-unused-vars": "off",
"indent": "off",
"no-undef": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"semi": "off",
"unicorn/prefer-node-protocol": "error"
Copy link
Member

Choose a reason for hiding this comment

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

should we extends: standard as shorthand here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added that and dropped a couple of these rules (semi: off and indent: off) by excluding a couple more blocks from specific ESLint rules. The rest of these are actually the inverse of what they'd be in standard, specifically turning off unused/undefined checking because a lot of our code blocks are fragments which trip those rules, and that's fine for docs.

@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch 2 times, most recently from ba5bc0b to 0661b7b Compare May 28, 2025 05:03
@dsanders11 dsanders11 force-pushed the chore/eslint-code-blocks branch from 0661b7b to 390fb12 Compare May 28, 2025 21:36
@VerteDinde VerteDinde merged commit 0d70389 into main May 29, 2025
100 of 101 checks passed
@VerteDinde VerteDinde deleted the chore/eslint-code-blocks branch May 29, 2025 19:45
@release-clerk
Copy link

release-clerk bot commented May 29, 2025

No Release Notes

kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants