Frakto Code Engine is the missing link between your tools and your editor.
A universal formatter & linter runner for Visual Studio Code that imposes nothing and enables everything. It pipes your editor’s content through any external process — formatter, linter, or custom script — and applies the output instantly, right back into the file.
Run Prettier, ESLint, your own shell magic — even all at once.
No restrictions. No hardcoded integrations. No opinions. Just you, your stack, and full control over how your code gets cleaned, checked, and styled.
It’s the kind of tool power users dream of: Modular. Powerful. Unopinionated.
- Open Visual Studio Code.
- Go to the Extensions panel (or press
Ctrl+Shift+X
/Cmd+Shift+X
). - Search for Frakto Code Engine.
- Click Install.
Once installed, the extension will automatically activate for supported languages when editing files.
Frakto Code Engine does not include any built-in formatter or linter. Instead, it acts as a secure bridge between VS Code and an external script defined by you.
Set the path to your custom script in the VS Code settings:
"frakto.execFile": "/path/to/your/script/index.js"
Your script can be written in any language and must accept JSON input via stdin
, returning a valid JSON response via stdout
.
Frakto will send the following structured object:
interface RequestPayload {
mode: 'format' | 'lint' | 'both';
trigger: 'onStart' | 'onOpen' | 'onChange' | 'onRunDiagnostic' | 'onFormat';
language: string;
content: string;
linterStandard: string | null;
fileName: string;
filePath: string;
fileEncoding: string;
fileIsUntitled: boolean;
fileIsDirty: boolean;
workspacePath?: string;
maxBuffer: number;
vscodeVersion: string;
timestamp: number;
}
This payload is sent as a stringified JSON via the following environment variable:
env: {
...process.env,
FRAKTO_PAYLOAD: JSON.stringify(payload)
}
Your script must return a valid JSON with this structure:
interface ResponsePayload {
formatted: string | null;
diagnostics: DiagnosticPayload[] | null;
debug?: any;
}
interface DiagnosticPayload {
line: number;
column: number;
endLine?: number;
endColumn?: number;
type: 'ERROR' | 'WARNING' | 'INFO';
message: string;
source: string;
code: string;
}
If the returned object does not match this structure, Frakto will throw an error and ignore the result.
This architecture allows you to create your own powerful code engine, with full control over formatting, linting, and diagnostics—without touching the extension code.
Here's a basic example in Node.js:
#!/usr/bin/env node
const payload = JSON.parse(process.env.FRAKTO_PAYLOAD || '{}');
const result = {
formatted: payload.content.toUpperCase(),
diagnostics: null,
debug: { note: 'Transformed to uppercase' }
};
process.stdout.write(JSON.stringify(result));
For a complete example of an external script implementation, you can check out or use frakto-coding-standards, the official companion tool designed to work seamlessly with this extension.
Once the external script is properly configured, VS Code will communicate with it by sending a structured payload via the FRAKTO_PAYLOAD environment variable. This payload contains detailed information about the active document and editor state.
The response from the external script will be handled as follows:
-
formatted
If present, this is used to format the active document when theFormat Document
command is executed. -
diagnostics
These are used to run lint-style diagnostics on the code. Diagnostics are triggered:- after formatting a document,
- when VSCode opens with documents already open,
- when a document is opened,
- when a document is edited,
- when running the command
Frakto: Run a diagnostic on the current file
.
-
debug
Any value returned here will be sent to the VS Code developer console usingconsole.log()
. This is useful for debugging and development, and is printed on every extension event.
Contributions are welcome and encouraged. If you'd like to help improve this plugin, please open a pull request or issue.
Make sure to follow our contributing guidelines before submitting any changes.
MIT License — Copyright © 2025 Frakto
This project is maintained with love and dedication. If you find it helpful, please consider: