Integrating with VS Code
Get syntax highlighting and enhanced developer experience with the ArkType VS Code extension
#ArkType VS Code Extension
The ArkType VS Code extension provides syntax highlighting and inline error summaries for ArkType definitions, making your development experience with ArkEnv much more pleasant.
Install ArkType VS Code Extension
Get syntax highlighting and inline error summaries for ArkType functions
#Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "ArkType"
- Install the extension by arktypeio
#Getting Syntax Highlighting
To get syntax highlighting for your ArkEnv schemas, use the default import and name it arkenv
:
import arkenv from 'arkenv';
const env = arkenv({
PORT: "number.port",
NODE_ENV: "'development' | 'production' | 'test'",
});
#Example with Syntax Highlighting
#Benefits
When you use the default import (import arkenv from 'arkenv'
) and have the ArkType extension installed, you get:
- Syntax highlighting for ArkType definitions in your schema
- Inline error summaries via ErrorLens integration
- Better developer experience with visual feedback
#Alternative Import Styles
You can also use named imports, though you won't get syntax highlighting:
import { createEnv } from 'arkenv';
const env = createEnv({
PORT: "number.port",
NODE_ENV: "'development' | 'production' | 'test'",
});
#Migration Guide
If you're currently using named imports and want to switch to default imports for better VS Code support:
#Before
import { createEnv } from 'arkenv';
const env = createEnv({
PORT: "number.port",
});
#After
import arkenv from 'arkenv';
const env = arkenv({
PORT: "number.port",
});
The functionality is identical - only the import style changes!
#Best Practices
- Use default import if you're using VS Code and want enhanced syntax highlighting
- Use named import if you prefer explicit imports or are using other editors
- Be consistent within your project - choose one style and stick with it
- Install the ArkType extension for the best development experience