Skip to content

Commit 8f26f3c

Browse files
d0x2fclaude
andauthored
chore: address code quality items Q1-Q4 from IMPROVEMENTS.md (#211)
* chore: address code quality items Q1–Q4 from IMPROVEMENTS.md - Q1: merge prettier.config.yaml into .prettierrc so the prettier CLI enforces single quotes and other style rules (previously silently ignored). Reformat 58 files to match the unified config. - Q2: remove dead manualChunks rule for moment.js (moment was removed in 500d6ff). - Q3: fix German translation for error.card_delete (said "Boards", should be "Karte"). - Q4: fix Spanish translation for error.card_delete (said "tablero", should be "tarjeta"). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: remove Code Quality section from IMPROVEMENTS.md Q1–Q4 were addressed in this PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f334698 commit 8f26f3c

64 files changed

Lines changed: 1720 additions & 1809 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"singleQuote": true,
5+
"trailingComma": "es5",
26
"plugins": ["prettier-plugin-svelte"],
37
"overrides": [
48
{
59
"files": "*.svelte",
6-
"options": {
7-
"parser": "svelte"
8-
}
10+
"options": { "parser": "svelte" }
911
}
1012
]
1113
}

IMPROVEMENTS.md

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -247,84 +247,6 @@ Callers (e.g. the CSV export in `Menu.svelte`) cannot tell whether `"?"` is the
247247
248248
---
249249
250-
## Code Quality
251-
252-
### Q1 — Conflicting Prettier configs (`.prettierrc` + `prettier.config.yaml`)
253-
254-
**Severity: Medium**
255-
256-
Both files exist in the repo root. Prettier's config search order means `.prettierrc` takes precedence and `prettier.config.yaml` is silently ignored. The YAML file contains the actual formatting rules (`singleQuote: true`, `semi: true`, `trailingComma: "es5"`, `tabWidth: 2`); the `.prettierrc` only has the plugin and Svelte parser override. This means Prettier CLI doesn't enforce single quotes or other style rules — they're only caught by ESLint's prettier plugin.
257-
258-
**Fix:** Merge the YAML's rules into `.prettierrc` and delete `prettier.config.yaml`:
259-
260-
```json
261-
{
262-
"tabWidth": 2,
263-
"semi": true,
264-
"singleQuote": true,
265-
"trailingComma": "es5",
266-
"plugins": ["prettier-plugin-svelte"],
267-
"overrides": [
268-
{
269-
"files": "*.svelte",
270-
"options": { "parser": "svelte" }
271-
}
272-
]
273-
}
274-
```
275-
276-
---
277-
278-
### Q2 — Dead `moment` chunk in vite config (`vite.config.js:2022`)
279-
280-
**Severity: Low**
281-
282-
```js
283-
if (id.includes("moment")) {
284-
return "moment";
285-
}
286-
```
287-
288-
`moment.js` was removed in commit `500d6ff` (replaced with `Intl.RelativeTimeFormat`). This chunk rule never matches anything and should be deleted.
289-
290-
---
291-
292-
### Q3 — Wrong German translation for `error.card_delete` (`src/lang/de.json:21`)
293-
294-
**Severity: Low**
295-
296-
```json
297-
"error.card_delete": "Fehler beim Entfernen des Boards!"
298-
```
299-
300-
Says "Board" but should say "Karte" (card). The English source is "Card deletion failed!".
301-
302-
**Fix:**
303-
304-
```json
305-
"error.card_delete": "Fehler beim Entfernen der Karte!"
306-
```
307-
308-
---
309-
310-
### Q4 — Wrong Spanish translation for `error.card_delete` (`src/lang/es.json:21`)
311-
312-
**Severity: Low**
313-
314-
```json
315-
"error.card_delete": "¡Error al eliminar el tablero!"
316-
```
317-
318-
Says "tablero" (board) but should say "tarjeta" (card).
319-
320-
**Fix:**
321-
322-
```json
323-
"error.card_delete": "¡Error al eliminar la tarjeta!"
324-
```
325-
326-
---
327-
328250
## CI/CD
329251
330252
### C1 — Outdated GitHub Actions versions (`.github/workflows/CICD.yml:14, 47`)

cypress/e2e/BoardTable.cy.js

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
/// <reference types="cypress" />
22

3-
context("BoardTable", () => {
4-
context("With no existing boards", () => {
5-
it("does not show the board list table", () => {
6-
cy.login("owner");
7-
cy.visit("/");
8-
cy.get("[data-name=board-list-button]").should("not.exist");
9-
cy.get("[data-name=board-table]").should("not.exist");
3+
context('BoardTable', () => {
4+
context('With no existing boards', () => {
5+
it('does not show the board list table', () => {
6+
cy.login('owner');
7+
cy.visit('/');
8+
cy.get('[data-name=board-list-button]').should('not.exist');
9+
cy.get('[data-name=board-table]').should('not.exist');
1010
});
1111
});
1212

13-
context("With an existing board", () => {
13+
context('With an existing board', () => {
1414
before(() => {
15-
cy.login("owner");
16-
cy.visit("/");
17-
cy.get("[data-name=board-name-input]").type("Test Board Name");
18-
cy.get("[data-name=create-button]").click();
19-
cy.get("[data-name=rank]").should("exist");
20-
cy.visit("/");
21-
cy.get("[data-name=board-list-button]").click();
15+
cy.login('owner');
16+
cy.visit('/');
17+
cy.get('[data-name=board-name-input]').type('Test Board Name');
18+
cy.get('[data-name=create-button]').click();
19+
cy.get('[data-name=rank]').should('exist');
20+
cy.visit('/');
21+
cy.get('[data-name=board-list-button]').click();
2222
});
2323

24-
context("As the owner", () => {
25-
it("has a row for the board including the delete button", () => {
26-
cy.get("[data-name=board-table]").should("exist");
27-
cy.get("[data-name=board-row]").should("have.length", 1);
28-
cy.get("[data-name=board-row]")
24+
context('As the owner', () => {
25+
it('has a row for the board including the delete button', () => {
26+
cy.get('[data-name=board-table]').should('exist');
27+
cy.get('[data-name=board-row]').should('have.length', 1);
28+
cy.get('[data-name=board-row]')
2929
.first()
30-
.find("[data-name=delete-button]")
31-
.should("exist");
30+
.find('[data-name=delete-button]')
31+
.should('exist');
3232
});
3333
});
3434

35-
context("As a participant", () => {
35+
context('As a participant', () => {
3636
let boardId;
3737
before(() => {
38-
cy.login("owner");
39-
cy.visit("/");
38+
cy.login('owner');
39+
cy.visit('/');
4040
// Find the board id
41-
cy.get("[data-name=board-list-button]").click();
42-
cy.get("[data-name=board-row]")
41+
cy.get('[data-name=board-list-button]').click();
42+
cy.get('[data-name=board-row]')
4343
.first()
44-
.invoke("attr", "data-board-id")
44+
.invoke('attr', 'data-board-id')
4545
.then((v) => {
4646
boardId = v;
4747

4848
// Visit the board and come back to give access to the participant
49-
cy.login("participant");
49+
cy.login('participant');
5050
cy.visit(`/${boardId}`);
51-
cy.get("[data-name=rank]").should("exist");
51+
cy.get('[data-name=rank]').should('exist');
5252
cy.reload();
53-
cy.visit("/");
54-
cy.get("[data-name=board-list-button]").click();
53+
cy.visit('/');
54+
cy.get('[data-name=board-list-button]').click();
5555
});
5656
});
5757

58-
it("shows a row for the board without the delete button", () => {
59-
cy.get("[data-name=board-table]").should("exist");
60-
cy.get("[data-name=board-row]").should("have.length", 1);
61-
cy.get("[data-name=board-row]")
58+
it('shows a row for the board without the delete button', () => {
59+
cy.get('[data-name=board-table]').should('exist');
60+
cy.get('[data-name=board-row]').should('have.length', 1);
61+
cy.get('[data-name=board-row]')
6262
.first()
63-
.should("have.attr", "data-board-id", boardId);
64-
cy.get("[data-name=board-row]")
63+
.should('have.attr', 'data-board-id', boardId);
64+
cy.get('[data-name=board-row]')
6565
.first()
66-
.find("[data-name=delete-button]")
67-
.should("not.exist");
66+
.find('[data-name=delete-button]')
67+
.should('not.exist');
6868
});
6969
});
7070

71-
context("Deleting a board", () => {
71+
context('Deleting a board', () => {
7272
before(() => {
73-
cy.login("owner");
74-
cy.visit("/");
75-
cy.get("[data-name=board-list-button]").click();
73+
cy.login('owner');
74+
cy.visit('/');
75+
cy.get('[data-name=board-list-button]').click();
7676
});
7777

78-
it("removes the board from the list after the owner confirms deletion", () => {
79-
cy.get("[data-name=board-row]")
78+
it('removes the board from the list after the owner confirms deletion', () => {
79+
cy.get('[data-name=board-row]')
8080
.first()
81-
.find("[data-name=delete-button]")
81+
.find('[data-name=delete-button]')
8282
.click();
83-
cy.get("[data-name=delete-confirm-button]").click();
84-
cy.get("[data-name=board-row]").should("have.length", 0);
85-
cy.get("[data-name=board-table]").should("not.exist");
83+
cy.get('[data-name=delete-confirm-button]').click();
84+
cy.get('[data-name=board-row]').should('have.length', 0);
85+
cy.get('[data-name=board-table]').should('not.exist');
8686
});
8787
});
8888

0 commit comments

Comments
 (0)