Skip to content

Conversation

@irjudson
Copy link
Member

Updated repo with code guidelines, test gates, etc.

Based on @harperfast/template-open-source repository:
- Add eslint.config.js using @harperdb/code-guidelines
- Add prettier.config.js using @harperdb/code-guidelines
- Configure ignores for dist/, node_modules/, coverage/, ext/, examples/
- Add custom rule to allow unused vars prefixed with underscore
- Auto-format all source files with prettier (tabs vs spaces)
- Fix unused variable warnings in bin/cli.js and test files

Linting status:
- Down from 400+ issues to 10 remaining (8 errors, 2 warnings)
- All formatting issues resolved
- Remaining issues are intentional unused variables in legacy code
  (will be addressed separately)

Commands available:
- npm run lint - Run ESLint
- npm run format:check - Check formatting
- npm run format:write - Auto-format code
- Add husky for git hooks
- Add pre-commit hook that runs lint and tests
- Add GitHub Actions workflow (ci.yml) with:
  * Lint job
  * Test job (Node 20 and 22)
  * Format check job
  * Runs on push to main/develop and all PRs
- Fix all remaining lint errors:
  * Remove unused global declarations
  * Fix == to === comparison
  * Prefix intentionally unused vars with underscore

Result: Clean lint (0 errors, 0 warnings), all tests passing

This ensures:
- Commits are validated locally before push
- PRs must pass lint + tests before merge
- Multi-version Node.js compatibility verified
Quote glob pattern in test script to ensure it works across all
environments (local, CI/CD). Node's --test flag requires quoted
globs to work correctly in GitHub Actions runners.
Replace glob pattern with explicit list of test files. Node's --test
flag doesn't consistently expand globs across environments. Explicitly
listing test files ensures compatibility with all CI/CD runners.
@irjudson irjudson merged commit 58d2234 into main Nov 13, 2025
4 checks passed
@irjudson irjudson deleted the ci-mods branch November 13, 2025 13:18
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.

2 participants