Skip to content

Commit

Permalink
Merge pull request #648 from acs3ss/dependabot/npm_and_yarn/vue/eslin…
Browse files Browse the repository at this point in the history
…t-config-typescript-14.1.3

Bump @vue/eslint-config-typescript from 14.0.0 to 14.1.3
  • Loading branch information
winstliu authored Oct 28, 2024
2 parents c8cfa95 + 7241404 commit dfff99f
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 29 deletions.
13 changes: 11 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
export default [
...pluginVue.configs["flat/recommended"],
...vueTsEslintConfig({
// TODO: Change to "strictTypeChecked" when https://github.com/vuejs/eslint-config-typescript/issues/85 is fixed.
extends: ["strict"],
extends: ["strictTypeChecked"],
}),
{
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.vue"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/multi-word-component-names": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
allowBoolean: true,
},
],
},
},
{
files: ["tests/**/*.test.ts"],
rules: {
// .to.be.empty, .to.be.true, etc. are valid Vitest assertions.
"@typescript-eslint/no-unused-expressions": "off",
// Complains about { rerender } in tests, which is okay.
"@typescript-eslint/unbound-method": "off",
},
},
eslintPluginPrettierRecommended,
Expand Down
27 changes: 13 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@playwright/test": "^1.48.1",
"@testing-library/vue": "^8.1.0",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-typescript": "^14.0.0",
"@vue/eslint-config-typescript": "^14.1.3",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ReloadPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { needRefresh, updateServiceWorker } = useRegisterSW({
// Check every hour for updates (which if found will then show the reload prompt)
setInterval(
() => {
registration.update();
void registration.update();
},
60 * 60 * 1000,
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/CardPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const emit = defineEmits<{
// Use selected as a "proxy" since props.value is readonly
const selected = computed({
get: () => props.value,
set: (newValue) => emit("select", newValue),
set: (newValue) => {
emit("select", newValue);
},
});
const getRandomSuit = () => suits[Math.floor(Math.random() * suits.length)];
Expand Down
3 changes: 2 additions & 1 deletion src/components/Hand.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const emit = defineEmits<{
handUpdated: [card: Card];
}>();
const updateHand = (id: number, value: number) =>
const updateHand = (id: number, value: number) => {
emit("handUpdated", { id, value });
};
</script>
14 changes: 7 additions & 7 deletions src/operation.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export interface Operation {
operate(a: number, b: number): number;
toString(a: unknown, b: unknown): string;
toString(a: number | string, b: number | string): string;
}

export const Add: Operation = {
operate(a: number, b: number): number {
return a + b;
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `${a} + ${b}`;
},
};
Expand All @@ -18,7 +18,7 @@ export const Subtract: Operation = {
return a - b;
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `${a} - ${b}`;
},
};
Expand All @@ -28,7 +28,7 @@ export const Multiply: Operation = {
return a * b;
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `${a} * ${b}`;
},
};
Expand All @@ -38,7 +38,7 @@ export const Divide: Operation = {
return a / b;
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `${a} / ${b}`;
},
};
Expand All @@ -48,7 +48,7 @@ export const Exponent: Operation = {
return a ** b;
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `${a} ^ ${b}`;
},
};
Expand All @@ -58,7 +58,7 @@ export const Log: Operation = {
return Math.log(b) / Math.log(a);
},

toString(a: unknown, b: unknown): string {
toString(a: number | string, b: number | string): string {
return `log_${a}(${b})`;
},
};
2 changes: 1 addition & 1 deletion src/solver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function print(solutions: Solution[]): string[] {
const left = `(${operations[0].toString(solution[1], solution[2])})`;
const right = `(${operations[1].toString(left, solution[3])})`;
outputs.push(operations[2].toString(solution[0], right));
} else if (parentheses === 4) {
} else {
// a (b (c d))
const left = `(${operations[0].toString(solution[2], solution[3])})`;
const right = `(${operations[1].toString(solution[1], left)})`;
Expand Down
2 changes: 1 addition & 1 deletion tests/component/CardPicker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("CardPicker", () => {
screen.getByTestId("card");
});

test("Renders a random card on load", async () => {
test("Renders a random card on load", () => {
render(CardPicker, { props });
const card = screen.getByTestId("card");

Expand Down

0 comments on commit dfff99f

Please sign in to comment.