| title | Set Up Your Effect Development Environment | ||||
|---|---|---|---|---|---|
| id | tooling-hello-world | ||||
| skillLevel | beginner | ||||
| applicationPatternId | tooling-and-debugging | ||||
| summary | Configure your editor and tools for the best Effect development experience. | ||||
| tags |
|
||||
| rule |
|
||||
| author | PaulJPhilp | ||||
| related |
|
||||
| lessonOrder | 2 |
Set up your development environment with the Effect extension and proper TypeScript configuration for the best experience.
A well-configured environment helps you:
- See types clearly - Effect types can be complex
- Get better autocomplete - Know what methods are available
- Catch errors early - TypeScript finds problems
- Navigate easily - Go to definitions, find references
# Using Bun (recommended)
bun add effect
# Or npm
npm install effect
# Or pnpm
pnpm add effectCreate or update tsconfig.json:
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"exactOptionalPropertyTypes": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}Install the Effect extension for VS Code:
- Open VS Code
- Go to Extensions (Cmd+Shift+X)
- Search for "Effect"
- Install the official Effect extension
The extension provides:
- Better type display (unwraps complex Effect types)
- Quick fixes and refactorings
- Inline error previews
- Go to definition for Effect functions
Add to .vscode/settings.json for better Effect experience:
{
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.inlayHints.functionLikeReturnTypes.enabled": true,
"typescript.inlayHints.parameterTypes.enabled": true,
"editor.formatOnSave": true
}Create a test file to verify everything works:
// src/hello.ts
import { Effect, Console } from "effect"
const program = Effect.gen(function* () {
yield* Console.log("Effect is working!")
return 42
})
// Hover over 'result' - should show: Effect<number, never, never>
const result = program
// Run it
Effect.runPromise(result).then(console.log)Run it:
bun src/hello.ts
# Output: Effect is working!
# Output: 42| Feature | How to Use |
|---|---|
| Hover for types | Hover over any variable |
| Go to definition | Cmd+Click on a function |
| Find references | Right-click → Find All References |
| Autocomplete | Type . after an Effect |
| Quick fix | Click lightbulb or Cmd+. |
Recommended structure for Effect projects:
my-project/
├── src/
│ ├── index.ts # Entry point
│ ├── services/ # Effect services
│ ├── errors/ # Tagged errors
│ └── utils/ # Helper functions
├── test/
│ └── *.test.ts # Tests
├── package.json
└── tsconfig.json
- Try the Getting Started patterns
- Install the Effect LSP for advanced features
- Explore the Effect documentation