@cspell/cspell-json-reporter
CSpell reporter with JSON output
Installation
Install it as a development package in the repository that will use it.
npm install -SD @cspell/cspell-json-reporter
Usage
Using Command Line
cspell . --reporter @cspell/cspell-json-reporter
Using CSpell Configuration
Add this to cspell.yaml
:
reporters: [['@cspell/cspell-json-reporter', { outFile: 'out.json' }]]
or cspell.json
{
"reporters": [["@cspell/cspell-json-reporter", { "outFile": "out.json" }]]
}
Output file format
@cspell/cspell-json-reporter
emits a JSON file with the following fields:
issues
- found spelling issues
result
- CSpell linting results
error
- CSell error messages
progress
- file linting progress messages if settings.progress
is enabled
info
- CSpell execution logs if settings.verbose
is enabled
debug
- CSpell debug logs if settings.debug
is enabled
JSON Output Definition
import type {
ErrorLike,
Issue,
MessageType,
ProgressFileComplete,
ProgressItem,
RunResult
} from '@cspell/cspell-types';
export type CSpellJSONReporterOutput = {
issues: Array<Issue>;
info?: Array<{ message: string; msgType: MessageType }>;
debug?: Array<{ message: string }>;
error?: Array<{ message: string; error: ErrorLike }>;
progress?: Array<ProgressItem | ProgressFileComplete>;
result: RunResult;
};
Settings
Possible settings:
outFile
(default: stdout) - path for JSON file to emit
verbose
(default: false) - enable saving of execution logs
debug
(default: false) - enable saving of debug logs
progress
(default: false) - enable saving of file progress logs
Reporter Settings
export type CSpellJSONReporterSettings = {
outFile?: string;
verbose?: boolean;
debug?: boolean;
progress?: boolean;
};
v9.2.1 (2025-08-31)
Dictionary Updates
<details>
<summary>fix: Workflow Bot -- Update Dictionaries (main) (<a href="https://github.com/streetsidesoftware/cspell/pull/7795">#7795</a>)</summary>