- Home
- Skills
- Onekeyhq
- App Monorepo
- 1k Code Quality
1k-code-quality_skill
- TypeScript
2.3k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill onekeyhq/app-monorepo --skill 1k-code-quality- SKILL.md4.7 KB
Overview
This skill codifies TypeScript-focused code quality standards for a cross-platform crypto wallet project. It enforces linting, type checking, pre-commit hooks, comment conventions (English only), and development principles to keep the codebase consistent and safe. The rules are optimized for fast local checks and comprehensive CI validation.
How this skill works
The skill defines commands and workflows for staged linting and full-project checks: fast pre-commit checks run only on changed files, while CI runs exhaustive ESLint and TypeScript checks. It documents common lint fixes (unused variables, unused parameters, floating promises), comment and JSDoc conventions, and guidelines for single responsibility and avoiding over-abstraction. Spellcheck and checklist items guide contributors to pass pre-commit and code-quality gates.
When to use it
- Before committing code: run staged lint and staged type checks (fast feedback).
- During local development: apply quick lint fixes and follow comment conventions.
- On pull requests: ensure full lint and full tsc checks pass in CI.
- When adding new terms: consult and update the spellchecker skipwords file.
- When refactoring: follow single-responsibility and avoid unnecessary abstractions.
Best practices
- Run yarn lint:staged and yarn tsc:staged in pre-commit to catch issues early.
- Use void or await for promises; prefix unused variables or parameters with an underscore.
- Write all comments and JSDoc in English and avoid commented-out code in commits.
- Keep functions single-purpose and avoid creating helpers for one-off operations.
- Follow consistent naming and run spellcheck for technical terms before adding new words.
Example use cases
- Pre-commit hook ensures only staged files are linted and type-checked for quick commits.
- CI pipeline executes comprehensive lint and type checks to prevent regressions before merge.
- Fixing a floating-promise warning by adding await or void to satisfy linters.
- Refactoring a function into two single-responsibility functions to improve testability and readability.
- Adding a new blockchain term to the spellcheck skip list after team lead review.
FAQ
Run yarn lint:staged and yarn tsc:staged; use both if you want type-check coverage for staged changes.
When should I run the full lint or full type check?
Run yarn lint and yarn tsc:only in CI or before major merges; these commands perform full-project validation and are slower.
How should I handle an unused parameter or variable?
Prefix the name with an underscore (for example _unused) to indicate it is intentionally unused and satisfy linters.