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 2.8.8 to 3.0.3 #344

Merged
merged 6 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
1,013 changes: 882 additions & 131 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.17.0",
"jsdom": "^22.1.0",
"playwright": "^1.37.1",
"prettier": "^2.8.8",
"prettier": "^3.0.2",
"sass": "^1.66.1",
"typescript": "^5.1.6",
"vite": "^4.4.9",
Expand Down
10 changes: 5 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ if (process.env.NODE_ENV === "production") {
defaultExtractor(content) {
const contentWithoutStyleBlocks = content.replace(
/<style[^]+?<\/style>/gi,
""
"",
);

const classes = Array.from(
contentWithoutStyleBlocks.matchAll(/class="([^"]+?)"/g)
contentWithoutStyleBlocks.matchAll(/class="([^"]+?)"/g),
).map((match) => match[1]);
const styles = classes.flatMap((styles) => styles.split(" "));

const ids = Array.from(
contentWithoutStyleBlocks.matchAll(/id="([^"]+?)"/g)
contentWithoutStyleBlocks.matchAll(/id="([^"]+?)"/g),
).map((match) => match[1]);

const tags = Array.from(
contentWithoutStyleBlocks.matchAll(/<(\w[\w-]*?)[^\w-]/g)
contentWithoutStyleBlocks.matchAll(/<(\w[\w-]*?)[^\w-]/g),
).map((match) => match[1]);

return styles.concat(ids).concat(tags);
Expand All @@ -32,7 +32,7 @@ if (process.env.NODE_ENV === "production") {
/^router-link(|-exact)-active$/,
/data-v-.*/,
],
})
}),
);
}

Expand Down
9 changes: 6 additions & 3 deletions src/ReloadPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const { needRefresh, updateServiceWorker } = useRegisterSW({
onRegisteredSW(url, registration) {
if (registration) {
// Check every hour for updates (which if found will then show the reload prompt)
setInterval(() => {
registration.update();
}, 60 * 60 * 1000);
setInterval(
() => {
registration.update();
},
60 * 60 * 1000,
);
}
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ const rankText = computed(() => {
});

const suitText = computed(
() => props.suit[0].toUpperCase() + props.suit.slice(1)
() => props.suit[0].toUpperCase() + props.suit.slice(1),
);

const getX = (index: number, rotated: boolean): number => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Solutions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const toggleSolutions = () => (showSolutions.value = !showSolutions.value);
// Re-hide solutions if the cards change.
watch(
() => props.solutions,
() => (showSolutions.value = false)
() => (showSolutions.value = false),
);
</script>

Expand Down
4 changes: 2 additions & 2 deletions tests/component/Solutions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
};

const solutionsRegex = new RegExp(
props.solutions.join("|").replace(/[*+()]/g, "\\$&")
props.solutions.join("|").replace(/[*+()]/g, "\\$&"),
Fixed Show fixed Hide fixed
);

afterEach(() => {
Expand All @@ -33,7 +33,7 @@
});
await fireEvent.click(showSolutionsButton);
expect(screen.getAllByText(solutionsRegex)).toHaveLength(
props.solutions.length
props.solutions.length,
);

const hideSolutionsButton = screen.getByRole("button", {
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/App.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from "@playwright/test";

Check failure on line 1 in tests/e2e/App.test.ts

View workflow job for this annotation

GitHub Actions / ci

[chromium] › App.test.ts:31:3 › Functionality › Updates card when asked

1) [chromium] › App.test.ts:31:3 › Functionality › Updates card when asked ─────────────────────── Test timeout of 30000ms exceeded.

Check failure on line 1 in tests/e2e/App.test.ts

View workflow job for this annotation

GitHub Actions / ci

[chromium] › App.test.ts:31:3 › Functionality › Updates card when asked

1) [chromium] › App.test.ts:31:3 › Functionality › Updates card when asked ─────────────────────── Pending operations: - locator.selectOption at tests/e2e/App.test.ts:42:18

import AxeBuilder from "@axe-core/playwright";

Expand Down Expand Up @@ -39,7 +39,7 @@

const select = page.getByLabel("Card 1");
const currentValue = await select.inputValue();
await select.selectOption({ value: `${(Number(currentValue) + 1) % 13}` });

Check failure on line 42 in tests/e2e/App.test.ts

View workflow job for this annotation

GitHub Actions / ci

[chromium] › App.test.ts:31:3 › Functionality › Updates card when asked

1) [chromium] › App.test.ts:31:3 › Functionality › Updates card when asked ─────────────────────── Error: locator.selectOption: Target closed =========================== logs =========================== waiting for getByLabel('Card 1') locator resolved to <select id="card0" required="" name="card0" data-v-b1512…>…</select> selecting specified option(s) did not find some options - waiting... ============================================================ 40 | const select = page.getByLabel("Card 1"); 41 | const currentValue = await select.inputValue(); > 42 | await select.selectOption({ value: `${(Number(currentValue) + 1) % 13}` }); | ^ 43 | 44 | const newTitle = await page 45 | .getByTestId("card") at /home/runner/work/24-card-game-solver/24-card-game-solver/tests/e2e/App.test.ts:42:18

const newTitle = await page
.getByTestId("card")
Expand Down Expand Up @@ -80,7 +80,7 @@
const button = page.getByRole("button", { name: "Show solutions" });
test.fail(
(await button.getAttribute("disabled")) !== null,
"No solutions after 5 tries"
"No solutions after 5 tries",
);

const selects = await page.getByLabel("Card ").all();
Expand All @@ -95,7 +95,7 @@

const solutions = await page.locator("pre").all();
const texts = await Promise.all(
solutions.map((solution) => solution.innerText())
solutions.map((solution) => solution.innerText()),
);
for (const text of texts) {
const numbers = text
Expand Down Expand Up @@ -123,7 +123,7 @@
const button = page.getByRole("button", { name: "Show solutions" });
test.fail(
(await button.getAttribute("disabled")) !== null,
"No solutions after 5 tries"
"No solutions after 5 tries",
);

await button.click();
Expand Down Expand Up @@ -162,7 +162,7 @@
test("Solutions are accessible", async ({ page }, { project }) => {
test.skip(
process.env.CI !== undefined && project.name === "Mobile Safari",
"Times out in mobile Safari on CI"
"Times out in mobile Safari on CI",
);

await page.goto("/");
Expand All @@ -179,7 +179,7 @@
const button = page.getByRole("button", { name: "Show solutions" });
test.fail(
(await button.getAttribute("disabled")) !== null,
"No solutions after 5 tries"
"No solutions after 5 tries",
);
await button.click();

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/operation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Operations", () => {

test("Joins strings with -", () => {
expect(Subtract.toString("(2 + 1)", "(3 * 4)")).toBe(
"(2 + 1) - (3 * 4)"
"(2 + 1) - (3 * 4)",
);
});
});
Expand All @@ -55,7 +55,7 @@ describe("Operations", () => {

test("Joins strings with *", () => {
expect(Multiply.toString("(2 - 1)", "(3 / 4)")).toBe(
"(2 - 1) * (3 / 4)"
"(2 - 1) * (3 / 4)",
);
});
});
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("Operations", () => {

test("Joins strings with ^", () => {
expect(Exponent.toString("(2 - 1)", "(3 * 4)")).toBe(
"(2 - 1) ^ (3 * 4)"
"(2 - 1) ^ (3 * 4)",
);
});
});
Expand Down
Loading