Skip to content

chore: add linting, formatting, and CI quality gates#8

Merged
cesarnml merged 3 commits intomainfrom
codex/add-code-quality-ci
Mar 28, 2026
Merged

chore: add linting, formatting, and CI quality gates#8
cesarnml merged 3 commits intomainfrom
codex/add-code-quality-ci

Conversation

@cesarnml
Copy link
Copy Markdown
Owner

@cesarnml cesarnml commented Mar 28, 2026

Summary
Add ESLint, Prettier, and jsx-a11y with repo-level scripts and configuration.
Add a GitHub Actions quality workflow for formatting, linting, tests, and build, with concurrency cancellation for superseded runs.
Protect main with the required quality status check and strict up-to-date enforcement.

Details
Introduce flat-config ESLint with TypeScript, React Hooks, React Refresh, and accessibility rules.
Add Prettier config and ignore rules, including excluding pnpm-lock.yaml from formatter churn.
Apply the initial formatting pass across the repo and fix follow-on lint, type-safety, and accessibility issues needed to keep the new gate green.
Refresh README command docs and CI guidance to match the enforced workflow.

Validation
pnpm format:check
pnpm lint
pnpm test:run
pnpm build
pnpm check

Add ESLint, Prettier, and jsx-a11y with cached local lint commands.
Add GitHub Actions quality checks and protect main with the required quality status.
Apply the initial formatting pass and fix lint and accessibility issues to keep check green.
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
thai-script-pro Ready Ready Preview, Comment Mar 28, 2026 5:49am

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Add ESLint, Prettier, and GitHub Actions CI quality gates with codebase formatting

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add ESLint flat-config with TypeScript, React, JSX accessibility, and React Hooks support
• Add Prettier code formatter with project-wide configuration and ignore rules
• Create GitHub Actions CI workflow for automated quality checks (formatting, linting, tests, build)
• Add npm scripts for code quality: format, format:check, lint, lint:fix, and check
• Apply initial formatting pass across entire codebase to comply with new quality gates
• Fix accessibility issues including removal of redundant role="region" attribute
• Update README with documentation for new quality commands and CI/branch protection requirements
• Add VSCode extension recommendations for ESLint and Prettier
• Configure branch protection with required quality status checks and strict up-to-date enforcement
• Exclude pnpm-lock.yaml from formatter to prevent unnecessary churn
Diagram
flowchart LR
  A["ESLint Config<br/>eslint.config.js"] --> B["Code Quality<br/>Enforcement"]
  C["Prettier Config<br/>.prettierrc.json"] --> B
  D["Ignore Rules<br/>.prettierignore"] --> B
  B --> E["GitHub Actions<br/>CI Workflow"]
  E --> F["Quality Checks<br/>format/lint/test/build"]
  F --> G["Branch Protection<br/>on main"]
  H["Codebase<br/>Formatting Pass"] --> B
  I["npm Scripts<br/>package.json"] --> B
Loading

Grey Divider

File Changes

Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Mar 28, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Remediation recommended

1. ESLint lints build artifacts 🐞 Bug ⚙ Maintainability
Description
eslint.config.js does not ignore generated directories like .tsbuild or .cache, so pnpm lint can
start linting emitted TypeScript outputs (e.g., .tsbuild/node) and cache files, leading to
unexpected lint errors after a build.
This is especially likely because the config targets all **/*.{js,jsx,ts,tsx} and the build emits
into .tsbuild.
Code

eslint.config.js[R11-21]

+    ignores: [
+      'dist/**',
+      'coverage/**',
+      'node_modules/**',
+      'playwright-report/**',
+      'test-results/**',
+    ],
+  },
+  {
+    files: ['**/*.{js,jsx,ts,tsx}'],
+    extends: [js.configs.recommended, ...tseslint.configs.recommended],
Evidence
ESLint’s ignore list omits .tsbuild/.cache, while the TS build is configured to emit into
.tsbuild/node; the lint script runs eslint . (so generated files under the repo root are
eligible to be linted) and the ESLint config applies to all JS/TS files.

eslint.config.js[9-21]
tsconfig.node.json[1-13]
.gitignore[41-45]
package.json[7-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`pnpm lint` can lint generated build/cache artifacts because ESLint ignores do not include `.tsbuild/**` (TS build output) or `.cache/**` (ESLint cache location).

### Issue Context
- TypeScript build emits into `.tsbuild/node`.
- Lint runs `eslint .` and the ESLint config applies to `**/*.{js,jsx,ts,tsx}`.

### Fix Focus Areas
- eslint.config.js[10-18]

### Proposed fix
Add these entries to the top-level `ignores` list:
- `.tsbuild/**`
- `.cache/**`
(Optionally also ignore other generated dirs used by your toolchain if any.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Prettier formats build artifacts 🐞 Bug ➹ Performance
Description
.prettierignore does not exclude .tsbuild or .cache, so pnpm format / pnpm format:check may
traverse and (re)format generated build outputs and caches, increasing runtime and potentially
causing spurious formatting failures after builds.
This is inconsistent with the repo already treating these directories as generated via .gitignore.
Code

.prettierignore[R1-6]

+dist
+coverage
+node_modules
+pnpm-lock.yaml
+playwright-report
+test-results
Evidence
Prettier is run against the entire repo (prettier --write . / --check .), but .prettierignore
does not exclude .tsbuild (TS build output) or .cache (tool caches). Since TS build outputs into
.tsbuild/node, these files are likely to exist and be unnecessarily processed by Prettier.

.prettierignore[1-6]
tsconfig.node.json[1-13]
.gitignore[41-45]
package.json[7-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Prettier runs across the repo but `.prettierignore` does not exclude generated build/cache directories (`.tsbuild`, `.cache`), so formatting/checking can waste time or fail on generated files.

### Issue Context
- TypeScript build outputs to `.tsbuild/node`.
- `.gitignore` already treats `.tsbuild` and `.cache` as generated.

### Fix Focus Areas
- .prettierignore[1-6]

### Proposed fix
Append the following lines to `.prettierignore`:
- `.tsbuild`
- `.cache`
(Use `**` variants if you prefer, but directory entries are sufficient.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@cesarnml cesarnml merged commit 86dfae5 into main Mar 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant