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

Run Prettier on JS code fences, part 4 #20723

Merged
merged 3 commits into from
Sep 22, 2022
Merged

Conversation

OnkarRuikar
Copy link
Contributor

Adding #20713

The PR focuses only on JS code fences.

Idea is to gradually prettify all the JS code fences before the full automation.

@OnkarRuikar OnkarRuikar requested a review from a team as a code owner September 14, 2022 15:08
@OnkarRuikar OnkarRuikar requested review from sideshowbarker and removed request for a team September 14, 2022 15:08
@github-actions github-actions bot added the Content:WebAPI Web API docs label Sep 14, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 14, 2022

Preview URLs

Flaws

Note! 86 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/AudioWorkletGlobalScope
Title: AudioWorkletGlobalScope
Flaw count: 6

  • macros:
    • /en-US/docs/Web/API/AudioWorkletGlobalScope/currentFrame does not exist
    • /en-US/docs/Web/API/AudioWorkletGlobalScope/currentTime does not exist
    • /en-US/docs/Web/API/AudioWorkletGlobalScope/sampleRate does not exist
  • bad_bcd_links:
    • no explanation!
    • no explanation!
    • no explanation!

URL: /en-US/docs/Web/API/CookieStoreManager
Title: CookieStoreManager
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/ServiceWorkerRegistration/cookies does not exist

URL: /en-US/docs/Web/API/ContentIndex/delete
Title: ContentIndex.delete()
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/Content__Index_API does not exist

URL: /en-US/docs/Web/API/CookieStore/set
Title: CookieStore.set()
Flaw count: 1

  • macros:
    • /en-US/docs/Glossary/serialize redirects to /en-US/docs/Glossary/Serialization

URL: /en-US/docs/Web/API/CanvasRenderingContext2D/wordSpacing
Title: CanvasRenderingContext2D.wordSpacing
Flaw count: 1

  • broken_links:
    • Can't resolve https://developer.mozilla.org/en-US/docs/Web/CSS/word-spacing

URL: /en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
Title: CanvasRenderingContext2D.globalCompositeOperation
Flaw count: 1

  • macros:
    • The fourth to sixth parameters of 'EmbedLiveSample' are deprecated

URL: /en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit
Title: CanvasRenderingContext2D.miterLimit
Flaw count: 1

  • macros:
    • The fourth to sixth parameters of 'EmbedLiveSample' are deprecated

URL: /en-US/docs/Web/API/ContactAddress
Title: ContactAddress
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/ContactManager/getProperties does not exist

URL: /en-US/docs/Web/API/Constraint_validation
Title: Constraint validation API
Flaw count: 3

  • macros:
    • /en-US/docs/Web/API/ValidityState/customError does not exist
    • /en-US/docs/Web/API/ValidityState/valid does not exist
    • /en-US/docs/Web/API/ValidityState/valueMissing does not exist

URL: /en-US/docs/Web/API/CookieChangeEvent
Title: CookieChangeEvent
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/CookieStore/onchange redirects to /en-US/docs/Web/API/CookieStore/change_event

URL: /en-US/docs/Web/API/ContactsManager/select
Title: ContactsManager.select()
Flaw count: 1

  • macros:
    • /en-US/docs/Web/JavaScript/Reference/ContactsManager/getProperties does not exist

URL: /en-US/docs/Web/API/AudioWorkletProcessor/process
Title: AudioWorkletProcessor.process()
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.AudioWorkletProcessor.process

External URLs

URL: /en-US/docs/Web/API/ClipboardItem/types
Title: ClipboardItem.types


URL: /en-US/docs/Web/API/ClipboardItem/getType
Title: ClipboardItem.getType()


URL: /en-US/docs/Web/API/ClipboardItem/presentationStyle
Title: ClipboardItem.presentationStyle

(this comment was updated 2022-09-22 03:27:35.712064)

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

This is so nice.

I had a couple of comments about https://developer.mozilla.org/en-US/docs/Web/API/Client/frameType and https://developer.mozilla.org/en-US/docs/Web/API/Client/id where there isn't a real example - we should either add something or remove the whole Examples section.

And it looks as if you have Prettier adding trailing commas? which I thought we were not doing.

@teoli2003
Copy link
Contributor

And it looks as if you have Prettier adding trailing commas? which I thought we were not doing.

By default, Prettier adds trailing commas everywhere it is correct in ES5. Here it is an object, so it is valid ES5 syntax, and Prettier adds it. It doesn't add (by default) commas to a list of function parameters: see https://prettier.io/docs/en/options.html#trailing-commas This looks ok (or I have misunderstood the not-activated option).

@wbamberg
Copy link
Collaborator

And it looks as if you have Prettier adding trailing commas? which I thought we were not doing.

By default, Prettier adds trailing commas everywhere it is correct in ES5. Here it is an object, so it is valid ES5 syntax, and Prettier adds it. It doesn't add (by default) commas to a list of function parameters: see https://prettier.io/docs/en/options.html#trailing-commas This looks ok (or I have misunderstood the not-activated option).

OK, fair enough.

@OnkarRuikar
Copy link
Contributor Author

Perhaps just remove the whole Examples section here?

So may I remove empty sections in the upcoming PRs? Keeping them will require js-nolint tag and will add extra maintenance.

@wbamberg
Copy link
Collaborator

Perhaps just remove the whole Examples section here?

So may I remove empty sections in the upcoming PRs? Keeping them will require js-nolint tag and will add extra maintenance.

Yeah, it would be much better to have examples, but I don't see any value to readers in having empty examples.

@OnkarRuikar
Copy link
Contributor Author

The PR focuses only on JS code fences.

Idea is to gradually prettify all the JS code fences before the full automation.
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thank you for this @OnkarRuikar , it is so great.

@wbamberg wbamberg merged commit 3a8ddea into mdn:main Sep 22, 2022
@OnkarRuikar OnkarRuikar deleted the js-code-lint4 branch September 23, 2022 02:07
himanshugarg pushed a commit to himanshugarg/content that referenced this pull request Sep 27, 2022
* Run Prettier on JS code fences, part 4

The PR focuses only on JS code fences.

Idea is to gradually prettify all the JS code fences before the full automation.

* remove an empty section

* remove the empty section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants