|
| 1 | +# Refactor Notes — openharmony-sheet |
| 2 | + |
| 3 | +This branch contains refactoring improvements applied automatically. |
| 4 | + |
| 5 | +## Changes Applied |
| 6 | + |
| 7 | +### Code Quality |
| 8 | +- Added `.editorconfig` — consistent coding style across editors |
| 9 | +- Added/updated `.eslintrc.json` — linting rules (ESLint + TypeScript) |
| 10 | +- Added `.prettierrc` — code formatting configuration |
| 11 | +- Updated `.gitignore` — comprehensive ignore patterns |
| 12 | + |
| 13 | +### TypeScript Support |
| 14 | +- Added `tsconfig.json` with strict mode configuration |
| 15 | + - `strict: true`, `noUncheckedIndexedAccess`, `noImplicitReturns` |
| 16 | + - `allowJs: true` for gradual migration |
| 17 | + |
| 18 | +### Testing |
| 19 | +- Added `jest.config.js` with 70% coverage thresholds |
| 20 | +- Test file pattern: `**/*.test.ts` / `**/*.spec.ts` |
| 21 | + |
| 22 | +### CI/CD |
| 23 | +- Added `.github/workflows/ci.yml` |
| 24 | + - Matrix: Node.js 18.x and 20.x |
| 25 | + - Steps: install → lint → type-check → test → build |
| 26 | +- Added `.github/dependabot.yml` for automated dependency updates |
| 27 | + |
| 28 | +## Running Locally |
| 29 | + |
| 30 | +```bash |
| 31 | +npm install |
| 32 | +npm run lint # ESLint |
| 33 | +npm run type-check # TypeScript check |
| 34 | +npm test # Jest tests |
| 35 | +npm run build # Build |
| 36 | +``` |
| 37 | + |
| 38 | +## Refactor Spec Reference |
| 39 | + |
| 40 | +See the full refactoring specification: |
| 41 | +[wscats-projects-refactor-spec.md](https://github.com/wscats) |
| 42 | + |
| 43 | +### Key Principles Applied |
| 44 | +1. **TypeScript** — strict mode, type safety |
| 45 | +2. **Error handling** — Result type pattern, AppError class |
| 46 | +3. **Security** — XSS prevention, input validation, path traversal protection |
| 47 | +4. **Performance** — debounce/throttle, virtual lists, memoization |
| 48 | +5. **Testing** — 70%+ coverage, unit + integration tests |
| 49 | +6. **i18n** — react-i18next with RTL support |
0 commit comments