Editor integration
Configure autocomplete, type inspection, and diagnostics in your editor.
To get the best experience with arkenv(), ArkEnv provides a few utilities
for integrating with your editor.
Syntax highlighting and inline type errors
The ArkType VS Code extension and JetBrains plugin highlight ArkType schema strings and surface inline type errors.
The extension highlights calls whose name contains ark. Keep the
default import name arkenv:
- import createEnv from "@arkenv/core";
+ import arkenv from "@arkenv/core";
- export const env = createEnv({
+ export const env = arkenv({
PORT: "number.port = 3000",
DEBUG: "boolean = false",
});ArkType only
Skip this section and ArkThemes if you validate with
@arkenv/standard. ArkType editor tools do not apply to Zod, Valibot, etc.
ArkThemes
ArkThemes is a VS Code (and Cursor) color theme that makes ArkType schema strings read like TypeScript, in light and dark modes.
Visit the VS Code Marketplace to install.
Autocomplete on env.*
TypeScript infers keys and types from the schema you pass to arkenv().
Import env in application code.
import { } from "./env";
.(`Server is running on port ${.}`);
Always use env.PORT rather than process.env.PORT to preserve typesafety.