From 50f00731f04c27fb85394ccd0507a6375c96b3cb Mon Sep 17 00:00:00 2001 From: Brian Thomas Smith Date: Mon, 13 Nov 2023 17:46:11 +0100 Subject: [PATCH] chore(deps): Bump Prettier to 3.1.0, content changes --- .../asynchronous/introducing_workers/index.md | 10 ++++------ .../svelte_typescript/index.md | 8 ++++---- .../svelte_variables_props/index.md | 4 ++-- .../en-us/web/api/batterymanager/chargingtime/index.md | 5 ++--- .../web/api/batterymanager/dischargingtime/index.md | 5 ++--- .../web/api/batterymanager/levelchange_event/index.md | 5 ++--- files/en-us/web/api/document/createtreewalker/index.md | 4 ++-- files/en-us/web/api/htmlmarqueeelement/index.md | 2 +- files/en-us/web/api/ink_api/index.md | 5 ++--- .../api/inkpresenter/updateinktrailstartpoint/index.md | 5 ++--- files/en-us/web/api/keyboardevent/metakey/index.md | 5 ++--- files/en-us/web/api/response/json/index.md | 5 ++--- files/en-us/web/api/rtcdatachannel/label/index.md | 5 ++--- .../web/api/webgl_api/by_example/hello_glsl/index.md | 5 ++--- .../by_example/hello_vertex_attributes/index.md | 5 ++--- .../webgl_api/by_example/textures_from_code/index.md | 5 ++--- files/en-us/web/html/element/marquee/index.md | 2 +- .../web/javascript/reference/operators/import/index.md | 4 ++-- .../javascript/reference/operators/instanceof/index.md | 2 +- .../javascript/reference/template_literals/index.md | 4 ++-- package.json | 2 +- yarn.lock | 8 ++++---- 22 files changed, 46 insertions(+), 59 deletions(-) diff --git a/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md b/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md index b443708dde1824d..e2469be876df7be 100644 --- a/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md +++ b/files/en-us/learn/javascript/asynchronous/introducing_workers/index.md @@ -77,9 +77,8 @@ function generatePrimes(quota) { document.querySelector("#generate").addEventListener("click", () => { const quota = document.querySelector("#quota").value; const primes = generatePrimes(quota); - document.querySelector( - "#output", - ).textContent = `Finished generating ${quota} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${quota} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { @@ -161,9 +160,8 @@ document.querySelector("#generate").addEventListener("click", () => { // update the output box with a message for the user, including the number of // primes that were generated, taken from the message data. worker.addEventListener("message", (message) => { - document.querySelector( - "#output", - ).textContent = `Finished generating ${message.data} primes!`; + document.querySelector("#output").textContent = + `Finished generating ${message.data} primes!`; }); document.querySelector("#reload").addEventListener("click", () => { diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index 24761c75898ec25..8cc67795b8cc1bb 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -445,8 +445,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { @@ -519,8 +519,8 @@ We will also use the `Filter` enum in the `Todos.svelte` component. filter === Filter.ACTIVE ? todos.filter((t) => !t.completed) : filter === Filter.COMPLETED - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; $: { if (filter === Filter.ALL) { diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md index b543e3ebf1cc435..18c90f274da7a51 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_variables_props/index.md @@ -392,8 +392,8 @@ Finally for this article, let's implement the ability to filter our to-dos by st filter === "active" ? todos.filter((t) => !t.completed) : filter === "completed" - ? todos.filter((t) => t.completed) - : todos; + ? todos.filter((t) => t.completed) + : todos; ``` We use the `filter` variable to control the active filter: _all_, _active_, or _completed_. Just assigning one of these values to the filter variable will activate the filter and update the list of to-dos. Let's see how to achieve this. diff --git a/files/en-us/web/api/batterymanager/chargingtime/index.md b/files/en-us/web/api/batterymanager/chargingtime/index.md index b24a29c0ca07081..4e913bef4d8b3f0 100644 --- a/files/en-us/web/api/batterymanager/chargingtime/index.md +++ b/files/en-us/web/api/batterymanager/chargingtime/index.md @@ -34,9 +34,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.chargingTime; - document.querySelector( - "#chargingTime", - ).textContent = `Time to fully charge the battery: ${time}s`; + document.querySelector("#chargingTime").textContent = + `Time to fully charge the battery: ${time}s`; }); ``` diff --git a/files/en-us/web/api/batterymanager/dischargingtime/index.md b/files/en-us/web/api/batterymanager/dischargingtime/index.md index 373b2a339d19e74..dc089410bbf11b9 100644 --- a/files/en-us/web/api/batterymanager/dischargingtime/index.md +++ b/files/en-us/web/api/batterymanager/dischargingtime/index.md @@ -33,9 +33,8 @@ A number. navigator.getBattery().then((battery) => { const time = battery.dischargingTime; - document.querySelector( - "#dischargingTime", - ).textContent = `Remaining time to fully discharge the battery: ${time}`; + document.querySelector("#dischargingTime").textContent = + `Remaining time to fully discharge the battery: ${time}`; }); ``` diff --git a/files/en-us/web/api/batterymanager/levelchange_event/index.md b/files/en-us/web/api/batterymanager/levelchange_event/index.md index c7b43a83c0badad..1ae9271c7302bd7 100644 --- a/files/en-us/web/api/batterymanager/levelchange_event/index.md +++ b/files/en-us/web/api/batterymanager/levelchange_event/index.md @@ -45,9 +45,8 @@ navigator.getBattery().then((battery) => { battery.chargingTime / 60 }`; } else { - document.querySelector( - "#stateBattery", - ).textContent = `Discharging time: ${battery.dischargingTime / 60}`; + document.querySelector("#stateBattery").textContent = + `Discharging time: ${battery.dischargingTime / 60}`; } }; }); diff --git a/files/en-us/web/api/document/createtreewalker/index.md b/files/en-us/web/api/document/createtreewalker/index.md index 367ced0f98e9115..cd201726d782654 100644 --- a/files/en-us/web/api/document/createtreewalker/index.md +++ b/files/en-us/web/api/document/createtreewalker/index.md @@ -158,8 +158,8 @@ const treeWalker = document.createTreeWalker( node.classList.contains("no-escape") ? NodeFilter.FILTER_REJECT : node.closest(".escape") - ? NodeFilter.FILTER_ACCEPT - : NodeFilter.FILTER_SKIP, + ? NodeFilter.FILTER_ACCEPT + : NodeFilter.FILTER_SKIP, ); while (treeWalker.nextNode()) { diff --git a/files/en-us/web/api/htmlmarqueeelement/index.md b/files/en-us/web/api/htmlmarqueeelement/index.md index 6da2a8f0bc0ac2e..8477e88b351df96 100644 --- a/files/en-us/web/api/htmlmarqueeelement/index.md +++ b/files/en-us/web/api/htmlmarqueeelement/index.md @@ -73,7 +73,7 @@ _Inherits methods from its parent, {{DOMxRef("HTMLElement")}}._ height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` diff --git a/files/en-us/web/api/ink_api/index.md b/files/en-us/web/api/ink_api/index.md index b380d56bd63ee6f..37de7c9be251a92 100644 --- a/files/en-us/web/api/ink_api/index.md +++ b/files/en-us/web/api/ink_api/index.md @@ -91,9 +91,8 @@ canvas.addEventListener("pointermove", async (evt) => { style = { color: `rgba(${r}, ${g}, ${b}, 1)`, diameter: 10 }; move_cnt = 0; - document.getElementById( - "div", - ).style.backgroundColor = `rgba(${r}, ${g}, ${b}, 0.6)`; + document.getElementById("div").style.backgroundColor = + `rgba(${r}, ${g}, ${b}, 0.6)`; } move_cnt += 1; await presenter.updateInkTrailStartPoint(evt, style); diff --git a/files/en-us/web/api/inkpresenter/updateinktrailstartpoint/index.md b/files/en-us/web/api/inkpresenter/updateinktrailstartpoint/index.md index 3e3f39f96c15883..957beae5ac5bd9b 100644 --- a/files/en-us/web/api/inkpresenter/updateinktrailstartpoint/index.md +++ b/files/en-us/web/api/inkpresenter/updateinktrailstartpoint/index.md @@ -97,9 +97,8 @@ canvas.addEventListener("pointermove", async (evt) => { style = { color: `rgba(${r}, ${g}, ${b}, 1)`, diameter: 10 }; move_cnt = 0; - document.getElementById( - "div", - ).style.backgroundColor = `rgba(${r}, ${g}, ${b}, 0.6)`; + document.getElementById("div").style.backgroundColor = + `rgba(${r}, ${g}, ${b}, 0.6)`; } move_cnt += 1; await presenter.updateInkTrailStartPoint(evt, style); diff --git a/files/en-us/web/api/keyboardevent/metakey/index.md b/files/en-us/web/api/keyboardevent/metakey/index.md index 6d3ca5fdea7dd78..5ac693fdb2aa54e 100644 --- a/files/en-us/web/api/keyboardevent/metakey/index.md +++ b/files/en-us/web/api/keyboardevent/metakey/index.md @@ -33,9 +33,8 @@ A boolean value. ```js function ismetaKey(e) { - document.querySelector( - "#output", - ).textContent = `metaKey pressed? ${e.metaKey}`; + document.querySelector("#output").textContent = + `metaKey pressed? ${e.metaKey}`; } ``` diff --git a/files/en-us/web/api/response/json/index.md b/files/en-us/web/api/response/json/index.md index d610ce0efe21c49..44312c06a19fb03 100644 --- a/files/en-us/web/api/response/json/index.md +++ b/files/en-us/web/api/response/json/index.md @@ -49,9 +49,8 @@ fetch(myRequest) listItem.appendChild(document.createElement("strong")).textContent = product.Name; listItem.append(` can be found in ${product.Location}. Cost: `); - listItem.appendChild( - document.createElement("strong"), - ).textContent = `£${product.Price}`; + listItem.appendChild(document.createElement("strong")).textContent = + `£${product.Price}`; myList.appendChild(listItem); } }) diff --git a/files/en-us/web/api/rtcdatachannel/label/index.md b/files/en-us/web/api/rtcdatachannel/label/index.md index ac15fa0f88bbf15..9dfe3a30da4982f 100644 --- a/files/en-us/web/api/rtcdatachannel/label/index.md +++ b/files/en-us/web/api/rtcdatachannel/label/index.md @@ -39,9 +39,8 @@ const dc = pc.createDataChannel("my channel"); // … -document.getElementById( - "channel-name", -).innerHTML = `${dc.label}`; +document.getElementById("channel-name").innerHTML = + `${dc.label}`; ``` ## Specifications diff --git a/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md b/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md index 1f4727563c3290e..0c53c0ae8fc83f3 100644 --- a/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md +++ b/files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md @@ -97,9 +97,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git a/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md b/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md index ad7acf5652a002f..b193e111de0eca1 100644 --- a/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md +++ b/files/en-us/web/api/webgl_api/by_example/hello_vertex_attributes/index.md @@ -102,9 +102,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } diff --git a/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md b/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md index bbdbe9992e1966b..4fe34fe6edb8f91 100644 --- a/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md +++ b/files/en-us/web/api/webgl_api/by_example/textures_from_code/index.md @@ -108,9 +108,8 @@ function setupWebGL(evt) { if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { const linkErrLog = gl.getProgramInfoLog(program); cleanup(); - document.querySelector( - "p", - ).textContent = `Shader program did not link successfully. Error log: ${linkErrLog}`; + document.querySelector("p").textContent = + `Shader program did not link successfully. Error log: ${linkErrLog}`; return; } initializeAttributes(); diff --git a/files/en-us/web/html/element/marquee/index.md b/files/en-us/web/html/element/marquee/index.md index 2c30f9cf9573be8..4fd0366f8848c1e 100644 --- a/files/en-us/web/html/element/marquee/index.md +++ b/files/en-us/web/html/element/marquee/index.md @@ -65,7 +65,7 @@ The **``** [HTML](/en-US/docs/Web/HTML) element is used to insert a scr height="200" behavior="alternate" style="border:solid"> - This text will bounce + This text will bounce ``` diff --git a/files/en-us/web/javascript/reference/operators/import/index.md b/files/en-us/web/javascript/reference/operators/import/index.md index 676f51b83a5a5be..993c995bbfbde83 100644 --- a/files/en-us/web/javascript/reference/operators/import/index.md +++ b/files/en-us/web/javascript/reference/operators/import/index.md @@ -163,8 +163,8 @@ Here, we load 10 modules, `/modules/module-0.js`, `/modules/module-1.js`, etc., ```js Promise.all( - Array.from({ length: 10 }).map((_, index) => - import(`/modules/module-${index}.js`), + Array.from({ length: 10 }).map( + (_, index) => import(`/modules/module-${index}.js`), ), ).then((modules) => modules.forEach((module) => module.load())); ``` diff --git a/files/en-us/web/javascript/reference/operators/instanceof/index.md b/files/en-us/web/javascript/reference/operators/instanceof/index.md index fda0c0bc42e8bf3..37c00498030b5b9 100644 --- a/files/en-us/web/javascript/reference/operators/instanceof/index.md +++ b/files/en-us/web/javascript/reference/operators/instanceof/index.md @@ -215,7 +215,7 @@ if (!(mycar instanceof Car)) { This is really different from: ```js example-bad -if (!mycar instanceof Car) { +if ((!mycar) instanceof Car) { // unreachable code } ``` diff --git a/files/en-us/web/javascript/reference/template_literals/index.md b/files/en-us/web/javascript/reference/template_literals/index.md index 6c57d8141ffb452..2c65696695e84a7 100644 --- a/files/en-us/web/javascript/reference/template_literals/index.md +++ b/files/en-us/web/javascript/reference/template_literals/index.md @@ -112,8 +112,8 @@ let classes = "header"; classes += isLargeScreen() ? "" : item.isCollapsed - ? " icon-expander" - : " icon-collapser"; + ? " icon-expander" + : " icon-collapser"; ``` With a template literal but without nesting, you could do this: diff --git a/package.json b/package.json index faba11d676d07ff..59eca90ced577b7 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "lint-staged": "15.1.0", "markdownlint-cli2": "0.10.0", "markdownlint-rule-search-replace": "1.2.0", - "prettier": "3.0.3" + "prettier": "3.1.0" }, "devDependencies": { "jest": "^29.7.0" diff --git a/yarn.lock b/yarn.lock index c66b02fb0719e14..cbdc56a372d2b29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6651,10 +6651,10 @@ prepend-http@^2.0.0: resolved "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" - integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== +prettier@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== pretty-format@^29.7.0: version "29.7.0"