46 lines
1.3 KiB
Markdown
46 lines
1.3 KiB
Markdown
# Layer 1
|
|
|
|
First layer of the deep import chain. Each layer contributes substantive
|
|
content so the chain is not trivially dismissable as "all short stubs".
|
|
|
|
## Section A
|
|
|
|
Coding conventions for the fictitious project that exists solely to
|
|
exercise the TOK scanner's import-depth detection logic.
|
|
|
|
- Prefer async/await over raw Promises.
|
|
- Annotate return types even when TypeScript can infer them.
|
|
- Keep functions under 40 lines where practical.
|
|
- Use `readonly` generously on types.
|
|
- Dependency-inject side effects at module boundaries.
|
|
- Validate inputs at system boundaries only.
|
|
|
|
## Section B
|
|
|
|
Error handling patterns:
|
|
|
|
- Subclass `Error` with typed messages.
|
|
- Never swallow errors silently.
|
|
- Prefer `Result<T, E>` return types in business logic.
|
|
- Log at boundaries, never inside pure functions.
|
|
|
|
## Section C
|
|
|
|
Testing patterns:
|
|
|
|
- Test fixtures live under `tests/fixtures/{name}/`.
|
|
- Each fixture has a single shape it exercises.
|
|
- Use `describe(...)` + `it(...)` from `node:test`.
|
|
- Prefer table-driven tests for permutations.
|
|
- Keep test setup idempotent.
|
|
|
|
## Section D
|
|
|
|
CI/CD conventions:
|
|
|
|
- Conventional Commits for every commit.
|
|
- PR-free single-branch workflow on Forgejo.
|
|
- Lint and typecheck on every push.
|
|
- Release tags follow `{plugin}-v{semver}`.
|
|
|
|
@layer2.md
|