This is the Effect App library itory, focusing on functional programming patterns and effect systems in TypeScript, wrapping and extending the Effect library.
- The git base branch is
main - Use
pnpmas the package manager
- Zero Tolerance for Errors: All automated checks must pass
- No
as any/as unknowncasts: These are never acceptable fixes. Understand the actual types and fix the root cause. If a type mismatch exists, find the correct v4 API, update the type signatures, or restructure the code. - Clarity over Cleverness: Choose clear, maintainable solutions
- Conciseness: Keep code and any wording concise and to the point. Sacrifice grammar for the sake of concision.
- Reduce comments: Avoid comments unless absolutely required to explain unusual or complex logic. Comments in jsdocs are acceptable.
- Look for effect sources inside
repos/effect-v4 - Never import local
reposfiles: Always use the latest online (pre-release) versions of packages instead.reposis just for reference, also includes examples, tests, and migration documentation. - Never webfetch from the
effect-v3andeffect-v4repos: just use the locally included underrepos
- Run
pnpm lint-fix(available inside each package) after editing files
- Run type checking:
pnpm check(available inside each package- If type checking continues to fail, run
pnpm cleanto clear caches, then re-runpnpm check
- If type checking continues to fail, run
- Run
pnpm eslint fix ./src/<file.ts>inside the package root after editing files - Run type checking:
pnpm checkinside the package root after editing files- If type checking continues to fail, run
pnpm cleanto clear caches, then re-runpnpm tsc ./src/<file.ts>
- If type checking continues to fail, run
Always look at existing code in the repository to learn and follow established patterns before writing new code.
Do not worry about getting code formatting perfect while writing. Use pnpm lint-fix
to automatically format code according to the project's style guidelines.
Instead of writing:
const fn = (param: string) =>
Effect.gen(function*() {
// ...
})Prefer:
const fn = Effect.fnUntraced(function*(param: string) {
// ...
})Prefer the class syntax when working with Context.Service. For example:
import { Context } from "effect-app"
class MyService extends Context.Service<MyService, {
readonly doSomething: (input: string) => number
}>()("MyService") {}Avoid .length > 0 or .length === 0 or !.length or !!.length checks, use Array.isArrayNonEmpty for type narrowing by default.
All pull requests must include a changeset. You can create changesets in the
.changeset/ directory.
The have the following format:
---
"package-name": patch | minor | major
---
A description of the change.