Skip to content

Commit

Permalink
chore(deps): Bump Prettier to 3.1.0, content changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmth committed Nov 13, 2023
1 parent bc3b7f4 commit 50f0073
Show file tree
Hide file tree
Showing 22 changed files with 46 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down Expand Up @@ -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", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/batterymanager/chargingtime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
});
```

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/batterymanager/dischargingtime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
});
```

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/batterymanager/levelchange_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
};
});
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/document/createtreewalker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/htmlmarqueeelement/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _Inherits methods from its parent, {{DOMxRef("HTMLElement")}}._
height="200"
behavior="alternate"
style="border:solid">
<marquee behavior="alternate"> This text will bounce </marquee>
<marquee behavior="alternate">This text will bounce</marquee>
</marquee>
```

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/ink_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/keyboardevent/metakey/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}
```

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/response/json/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
})
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/rtcdatachannel/label/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ const dc = pc.createDataChannel("my channel");

//

document.getElementById(
"channel-name",
).innerHTML = `<span class='channelName'>${dc.label}</span>`;
document.getElementById("channel-name").innerHTML =
`<span class='channelName'>${dc.label}</span>`;
```

## Specifications
Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/webgl_api/by_example/hello_glsl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/html/element/marquee/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The **`<marquee>`** [HTML](/en-US/docs/Web/HTML) element is used to insert a scr
height="200"
behavior="alternate"
style="border:solid">
<marquee behavior="alternate"> This text will bounce </marquee>
<marquee behavior="alternate">This text will bounce</marquee>
</marquee>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 50f0073

Please sign in to comment.