Skip to content

Commit 4c56afd

Browse files
committed
fix(build): upgrade to ES2022 and add precommit test hooks
- Update tsconfig target and lib to ES2022 to support Array.at() - Fix E2E test to use correct empty state text ("Backlog bankruptcy!") - Add E2E test runner to lint-staged for changed spec files - Add TypeScript check to lint-staged for changed source files
1 parent 647126d commit 4c56afd

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

.lintstagedrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
'*.{ts,tsx}': ['eslint --fix', 'prettier --write'],
3+
'*.css': ['stylelint --fix', 'prettier --write'],
4+
'*.{json,md}': ['prettier --write'],
5+
// Run changed E2E tests (chromium only for speed, CI runs all browsers)
6+
'tests/integration/**/*.spec.ts': (files) => `npx playwright test --project=chromium ${files.join(' ')}`,
7+
// Run tsc on whole project when any source file changes (not per-file)
8+
'src/**/*.{ts,tsx}': () => 'npx tsc --noEmit',
9+
}

.lintstagedrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/hooks/use-focus-trap.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ export function useFocusTrap(ref: RefObject<HTMLElement | null>, enabled: boolea
5454
if (focusable.length === 0) return
5555

5656
const firstElement = focusable[0]
57-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
58-
const lastElement: HTMLElement | undefined = focusable.at(-1)
57+
const lastElement = focusable.at(-1)
5958
if (!firstElement || !lastElement) return
6059

6160
if (event.shiftKey) {

tests/integration/filter-flow.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ test.describe('Filter Flow', () => {
245245
// All columns should be empty (show empty state message)
246246
const backlogSection = page.getByRole('region', { name: 'Backlog section' })
247247
await expect(backlogSection).toBeVisible()
248-
// Should show empty state text in at least one column
249-
await expect(backlogSection.getByText('No bugs here!')).toBeVisible()
248+
// Should show empty state text in backlog column
249+
await expect(backlogSection.getByText('Backlog bankruptcy!')).toBeVisible()
250250
})
251251

252252
test('should clear filters and reload', async ({ page }) => {

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2022",
44
"useDefineForClassFields": true,
5-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
5+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
66
"module": "ESNext",
77
"skipLibCheck": true,
88

0 commit comments

Comments
 (0)