Skip to content

Lint: use modern syntax, object shorthand/exponentiation/regex literal - #39657

Merged
Josh-Cena merged 1 commit into
mdn:mainfrom
Josh-Cena:fix-lint
May 27, 2025
Merged

Josh-Cena merged 1 commit into
mdn:mainfrom
Josh-Cena:fix-lint

Conversation

@Josh-Cena

Copy link
Copy Markdown
Member

Our style guide prescribes the use of modern syntax. This PR enforces the use of:

  • Object shorthand, including method syntax and a: a => a
  • Regex literals instead of new RegExp
  • Exponentiation ** instead of Math.pow

@Josh-Cena
Josh-Cena requested review from a team, bsmth, chrisdavidmills, rebloor and wbamberg and removed request for a team, chrisdavidmills, rebloor and wbamberg May 24, 2025 04:41
@github-actions github-actions Bot added the Content:WebExt WebExtensions docs label May 24, 2025
@Josh-Cena
Josh-Cena requested a review from a team May 24, 2025 04:41
@github-actions github-actions Bot added Content:WebAPI Web API docs Content:JS JavaScript docs Content:Learn Learning area docs (outside of one of the Learn:* subtags) Content:wasm WebAssembly docs labels May 24, 2025
@Josh-Cena
Josh-Cena requested review from willdurand and removed request for a team May 24, 2025 04:41
@github-actions github-actions Bot added the size/m [PR only] 51-500 LoC changed label May 24, 2025
@Josh-Cena
Josh-Cena removed the request for review from willdurand May 24, 2025 04:41
@github-actions

Copy link
Copy Markdown
Contributor
Preview URLs (62 pages)
Flaws (2)

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

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/apply
Title: handler.apply()
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/get
Title: handler.get()
Flaw count: 1

  • macros:
    • Macro produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

{
name: "HKDF",
salt: salt,
salt,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

key,
encoded,
);
return window.crypto.subtle.encrypt({ name: "AES-CBC", iv }, key, encoded);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bsmth bsmth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two comments to track updates in an example repo, but otherwise looking good, tnx 👍🏻


res.render("author_detail", {
title: "Author Detail",
author: author,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And I guess @hamishwillee might want to port this across, too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@Josh-Cena
Josh-Cena merged commit 2c0f972 into mdn:main May 27, 2025
@Josh-Cena
Josh-Cena deleted the fix-lint branch May 27, 2025 13:08
zachernuk pushed a commit to zachernuk/content that referenced this pull request Jun 4, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Content:JS JavaScript docs Content:Learn Learning area docs (outside of one of the Learn:* subtags) Content:wasm WebAssembly docs Content:WebAPI Web API docs Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants