feat: enhance code quality with type hints and automated JS/TS formatting - #463
feat: enhance code quality with type hints and automated JS/TS formatting#463nhatlong90 wants to merge 2 commits into
Conversation
- Added type hints to python search engine for better developer experience - Formatted all JS/TS code with Prettier - Added Prettier linting to GitHub Actions CI
clark-cant
left a comment
There was a problem hiding this comment.
Request changes
Important — reproducible lint gate: .github/workflows/lint.yml installs prettier globally without a version, while this branch does not add a repository-owned Prettier dependency, lockfile entry, or configuration. The check can therefore change with whatever release npm serves on a future runner, and contributors cannot reproduce the exact formatter/version locally. Please add and pin Prettier in the appropriate workspace manifest/lockfile, commit the intended config (or explicitly preserve documented existing config), and run that local command from CI. The formatting-only changes should then be regenerated/verified with that pinned version.
Mandatory gates: duplicate/prior work: clear for #463 (closed #114 is broader historical type-safety work); project standards: repository toolchain inspected, no checked-in Prettier setup found; strategic necessity: clear DX/consistency value, but the new CI gate must be deterministic.
Risk: medium — 26 files / +906 -569 are primarily formatting, yet the new nondeterministic CI policy affects every future JS/TS change.
What this PR does? This PR safely applies the remaining improvements we planned without causing any massive breaking changes to the Python codebase: 1. Type Hints: Added Python type hints to the main engine functions (\search.py\ & \core.py) to improve developer experience and autocompletion for contributors. 2. Prettier Formatting: Formatted all .js\ and .ts\ files across the repo (especially in \cli\ and \gallery) using Prettier to ensure consistent code styles. 3. Lint CI Workflow: Added a .github/workflows/lint.yml\ action that runs \prettier --check\ to ensure future PRs maintain this clean JavaScript/TypeScript formatting. Note: I held off on adding Ruff/Flake8 for Python to avoid a massive 400+ file diff that might be hard for you to review at once.