Skip to content

Commit

Permalink
Run prettier locally that should fix all the errors
Browse files Browse the repository at this point in the history
  • Loading branch information
teoli2003 committed Nov 14, 2023
1 parent 548586f commit a31e3ea
Show file tree
Hide file tree
Showing 24 changed files with 20,693 additions and 1,566 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 @@ -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`),
),
).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
Loading

0 comments on commit a31e3ea

Please sign in to comment.