Skip to content

Commit d953982

Browse files
chore: lint html.
1 parent fd194fe commit d953982

6 files changed

Lines changed: 274 additions & 3 deletions

File tree

eslint.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import playwright from 'eslint-plugin-playwright'
22
import tsParser from '@typescript-eslint/parser'
3+
import htmlPlugin from '@html-eslint/eslint-plugin'
34

45
const playwrightConfig = playwright.configs['flat/recommended']
6+
const htmlRecommendedConfig = htmlPlugin.configs['flat/recommended']
57

68
export default [
79
{
@@ -28,4 +30,32 @@ export default [
2830
...playwrightConfig,
2931
files: ['playwright/**/*.{ts,tsx,js,jsx}'],
3032
},
33+
{
34+
...htmlRecommendedConfig,
35+
files: ['src/**/*.html'],
36+
},
37+
{
38+
files: ['src/**/*.html'],
39+
plugins: {
40+
'@html-eslint': htmlPlugin,
41+
},
42+
rules: {
43+
// Formatting is delegated to Prettier; keep html-eslint focused on semantics and a11y.
44+
'@html-eslint/indent': 'off',
45+
'@html-eslint/attrs-newline': 'off',
46+
'@html-eslint/element-newline': 'off',
47+
'@html-eslint/no-extra-spacing-attrs': 'off',
48+
'@html-eslint/require-closing-tags': 'off',
49+
'@html-eslint/use-baseline': 'off',
50+
'@html-eslint/require-input-label': 'error',
51+
'@html-eslint/require-button-type': 'error',
52+
'@html-eslint/no-accesskey-attrs': 'error',
53+
'@html-eslint/no-positive-tabindex': 'error',
54+
'@html-eslint/no-invalid-role': 'error',
55+
'@html-eslint/no-redundant-role': 'error',
56+
'@html-eslint/no-abstract-roles': 'error',
57+
'@html-eslint/no-aria-hidden-body': 'error',
58+
'@html-eslint/no-aria-hidden-on-focusable': 'error',
59+
},
60+
},
3161
]

package-lock.json

Lines changed: 216 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"realtime",
99
"browser",
1010
"development",
11+
"ide",
1112
"jsx",
1213
"css",
1314
"importmap",
@@ -34,7 +35,7 @@
3435
"build:importmap-mode": "KNIGHTED_PRIMARY_CDN=importMap npm run build",
3536
"preview": "npm run build && http-server dist -a localhost -p 8081 -c-1 -o index.html",
3637
"check-types": "tsc -p tsconfig.json",
37-
"lint:playwright": "eslint playwright playwright.config.ts",
38+
"lint:playwright": "eslint playwright playwright.config.ts src/index.html",
3839
"test:e2e": "npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test",
3940
"test:e2e:dev": "playwright test",
4041
"test:e2e:headed": "npm run build && PLAYWRIGHT_WEB_SERVER_MODE=preview PLAYWRIGHT_PORT=8081 playwright test --headed",
@@ -43,6 +44,8 @@
4344
"lint": "oxlint src scripts && npm run lint:playwright"
4445
},
4546
"devDependencies": {
47+
"@html-eslint/eslint-plugin": "^0.58.1",
48+
"@html-eslint/parser": "^0.58.1",
4649
"@playwright/test": "^1.58.2",
4750
"@types/node": "^25.5.0",
4851
"@typescript-eslint/parser": "^8.57.1",

playwright/app.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ test('deleting saved GitHub token requires confirmation modal', async ({ page })
256256
await expect(page.locator('#clear-confirm-copy')).toHaveText(
257257
'This action removes the token from browser storage. You can add another token at any time.',
258258
)
259+
await expect(dialog.getByRole('button', { name: 'Remove' })).toBeVisible()
259260

260261
await dialog.getByRole('button', { name: 'Cancel' }).click()
261262
await expect(dialog).not.toHaveAttribute('open', '')
@@ -264,7 +265,7 @@ test('deleting saved GitHub token requires confirmation modal', async ({ page })
264265

265266
await tokenDelete.click()
266267
await expect(dialog).toHaveAttribute('open', '')
267-
await dialog.getByRole('button', { name: 'Clear' }).click()
268+
await dialog.getByRole('button', { name: 'Remove' }).click()
268269
await expect(dialog).not.toHaveAttribute('open', '')
269270

270271
await expect(page.locator('#status')).toHaveText('GitHub token removed')

0 commit comments

Comments
 (0)