Browse Source

ci: integrate react-doctor for PR health checks

Add react-doctor CI workflow to automatically scan PRs for React
anti-patterns and code health issues. Configure advisory mode (failOn:
none) with project-specific ignore rules for mock, auto-generated, and
non-component directories.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
pull/11777/head
afc163 5 months ago
parent
commit
75ab20c276
  1. 18
      .github/workflows/react-doctor.yml
  2. 2
      package.json
  3. 18
      react-doctor.config.json

18
.github/workflows/react-doctor.yml

@ -0,0 +1,18 @@
name: 🏥 React Doctor
on: push
permissions:
contents: read
pull-requests: write
jobs:
react-doctor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: millionco/react-doctor@main
continue-on-error: true
with:
diff: true
github-token: ${{ secrets.GITHUB_TOKEN }}

2
package.json

@ -27,6 +27,7 @@
"test": "jest",
"test:coverage": "jest --coverage",
"test:update": "jest -u",
"doctor": "react-doctor .",
"tsc": "tsc --noEmit"
},
"browserslist": [
@ -73,6 +74,7 @@
"@umijs/max-plugin-openapi": "^2.0.3",
"@umijs/request-record": "^1.1.4",
"cross-env": "^10.1.0",
"react-doctor": "^0.1.2",
"express": "^5.2.1",
"geojson": "^0.5.0",
"gh-pages": "^6.3.0",

18
react-doctor.config.json

@ -0,0 +1,18 @@
{
"ignore": {
"files": [
"mock/**",
"src/services/**",
"scripts/**",
"cloudflare-worker/**",
"src/.umi/**",
"src/.umi-production/**",
"src/.umi-test/**",
"**/*.md",
"**/*.less",
"**/*.css"
]
},
"failOn": "none",
"adoptExistingLintConfig": true
}
Loading…
Cancel
Save