diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6dc584f5..377732ee 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -72,6 +72,11 @@ jobs: run: | pnpm test -- --watch=false + - name: run lint + working-directory: apps/readest-app + run: | + pnpm lint + - name: build the web App if: matrix.config.platform == 'web' working-directory: apps/readest-app diff --git a/apps/readest-app/eslint.config.mjs b/apps/readest-app/eslint.config.mjs index df9db349..8cc926be 100644 --- a/apps/readest-app/eslint.config.mjs +++ b/apps/readest-app/eslint.config.mjs @@ -1,13 +1,25 @@ -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import js from "@eslint/js"; -import { FlatCompat } from "@eslint/eslintrc"; +import path from 'node:path'; +import js from '@eslint/js'; +import jsxA11y from 'eslint-plugin-jsx-a11y'; +import { fileURLToPath } from 'node:url'; +import { FlatCompat } from '@eslint/eslintrc'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, }); -export default [...compat.extends("next/core-web-vitals", "next/typescript")]; \ No newline at end of file + +export default [ + ...compat.extends('next/core-web-vitals', 'next/typescript'), + { + plugins: { + 'jsx-a11y': jsxA11y, + }, + rules: { + ...jsxA11y.configs.recommended.rules, + }, + }, +]; diff --git a/apps/readest-app/package.json b/apps/readest-app/package.json index 580f53b6..37ef85ec 100644 --- a/apps/readest-app/package.json +++ b/apps/readest-app/package.json @@ -125,6 +125,7 @@ "dotenv-cli": "^7.4.4", "eslint": "^9.16.0", "eslint-config-next": "15.0.3", + "eslint-plugin-jsx-a11y": "^6.10.2", "i18next-scanner": "^4.6.0", "jsdom": "^26.1.0", "mkdirp": "^3.0.1", diff --git a/apps/readest-app/src/app/layout.tsx b/apps/readest-app/src/app/layout.tsx index a5ab9dad..abbb8d8c 100644 --- a/apps/readest-app/src/app/layout.tsx +++ b/apps/readest-app/src/app/layout.tsx @@ -41,20 +41,9 @@ export const viewport = { export default function RootLayout({ children }: { children: React.ReactNode }) { return ( - + {title} -