Enforce local and CI quality gates

This commit is contained in:
morluto 2026-07-12 10:57:48 +08:00
parent 03072e0ea7
commit 8f035abb3a
4 changed files with 24 additions and 11 deletions

View File

@ -53,7 +53,7 @@ jobs:
node-version: 22
cache: npm
- run: npm ci
- run: npm run knip
- run: npm run lint:dead
duplicates:
name: Duplicate Code (jscpd)
@ -89,7 +89,7 @@ jobs:
node-version: 22
cache: npm
- run: npm ci
- run: npm test -- --reporter=verbose --reporter=junit --outputFile.junit=test-results.xml
- run: npm run test:coverage -- --reporter=verbose --reporter=junit --outputFile.junit=test-results.xml
- uses: actions/upload-artifact@v4
if: always()
with:

View File

@ -1 +1,2 @@
npx oxlint --fix
npx lint-staged
npm run typecheck

View File

@ -22,6 +22,18 @@ npm run verify:package
npm pack --dry-run
```
`npm install` prepares the Husky pre-commit hook. Commits format and lint staged
files with lint-staged, then typecheck the complete project. The normal test and
CI coverage runs enforce the thresholds in `vitest.config.ts`; `npm run
lint:dead` rejects unused files, exports, and dependencies.
Set `REA_LOG_LEVEL` to `trace`, `debug`, `info`, `warn`, `error`, `fatal`, or
`silent` to control structured JSON diagnostics. MCP mode defaults to `info` and
always writes logs to stderr so the stdio protocol remains intact. One-shot CLI
logging is opt-in and writes to stdout when a level is configured, preserving
machine-readable command output by default. Request arguments, bridge
authentication tokens, and environment data are redacted.
Changes that claim real Hopper behavior must also be tested against two distinct binaries:
```bash

View File

@ -15,15 +15,15 @@
"ignore": ["dist/**", "docs/**", ".codex/**", ".devin/**"],
"ignoreDependencies": [],
"rules": {
"files": "warn",
"dependencies": "warn",
"devDependencies": "warn",
"files": "error",
"dependencies": "error",
"devDependencies": "error",
"unlisted": "error",
"exports": "warn",
"nsExports": "warn",
"types": "warn",
"nsTypes": "warn",
"enumMembers": "warn",
"exports": "error",
"nsExports": "error",
"types": "error",
"nsTypes": "error",
"enumMembers": "error",
"duplicates": "error"
}
}