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

Bump prettier from 3.0.3 to 3.1.0 #30241

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
});

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!`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
});

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;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved

$: {
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;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved

$: {
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;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
```

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`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
});
```

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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
});
```

Expand Down
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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
}
};
});
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,
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
);

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)`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
}
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)`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
}
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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
}
```

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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
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>`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
```

## Specifications
Expand Down
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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
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}`;
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -7,7 +7,7 @@ browser-compat: javascript.operators.exponentiation

{{jsSidebar("Operators")}}

The **exponentiation (`**`)** operator returns the result of raising the first operand to the power of the second operand. It is equivalent to {{jsxref("Math.pow()")}}, except it also accepts [BigInts](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) as operands.
The **exponentiation (`**`)\*\* operator returns the result of raising the first operand to the power of the second operand. It is equivalent to {{jsxref("Math.pow()")}}, except it also accepts [BigInts](/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) as operands.

{{EmbedInteractiveExample("pages/js/expressions-exponentiation.html")}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ browser-compat: javascript.operators.exponentiation_assignment

{{jsSidebar("Operators")}}

The **exponentiation assignment (`**=`)** operator performs [exponentiation](/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation) on the two operands and assigns the result to the left operand.
The **exponentiation assignment (`**=`)\*\* operator performs [exponentiation](/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation) on the two operands and assigns the result to the left operand.

{{EmbedInteractiveExample("pages/js/expressions-exponentiation-assignment.html")}}

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`),
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
),
).then((modules) => modules.forEach((module) => module.load()));
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ if (!(mycar instanceof Car)) {

This is really different from:

```js example-bad
```js-nolint example-bad
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";
teoli2003 marked this conversation as resolved.
Show resolved Hide resolved
```

With a template literal but without nesting, you could do this:
Expand Down
Loading
Loading