@cspell/cspell-json-reporter 8.11.0 → 8.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,9 @@
1
1
  import type { CSpellReporter, ReporterConfiguration } from '@cspell/cspell-types';
2
2
  import type { CSpellJSONReporterSettings } from './CSpellJSONReporterSettings.js';
3
- export declare function getReporter(settings: unknown | CSpellJSONReporterSettings, cliOptions?: ReporterConfiguration): Required<CSpellReporter>;
3
+ type ReporterConsole = Pick<Console, 'log' | 'warn' | 'error'>;
4
+ export interface CSpellJSONReporterConfiguration extends ReporterConfiguration {
5
+ console?: ReporterConsole;
6
+ }
7
+ export declare function getReporter(settings: unknown | CSpellJSONReporterSettings, cliOptions?: CSpellJSONReporterConfiguration): Required<CSpellReporter>;
8
+ export {};
4
9
  //# sourceMappingURL=index.d.ts.map
package/dist/esm/index.js CHANGED
@@ -9,9 +9,11 @@ function mkdirp(p) {
9
9
  const noopReporter = () => undefined;
10
10
  const STDOUT = 'stdout';
11
11
  const STDERR = 'stderr';
12
+ const _console = console;
12
13
  export function getReporter(settings, cliOptions) {
13
14
  const useSettings = normalizeSettings(settings);
14
15
  const reportData = { issues: [], info: [], debug: [], error: [], progress: [] };
16
+ const console = cliOptions?.console ?? _console;
15
17
  return {
16
18
  issue: (issue) => {
17
19
  reportData.issues.push(issue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cspell/cspell-json-reporter",
3
- "version": "8.11.0",
3
+ "version": "8.13.0",
4
4
  "description": "JSON reporter for CSpell",
5
5
  "author": "Jason Dent",
6
6
  "license": "MIT",
@@ -46,10 +46,10 @@
46
46
  "watch": "tsc -b . -w -f"
47
47
  },
48
48
  "dependencies": {
49
- "@cspell/cspell-types": "8.11.0"
49
+ "@cspell/cspell-types": "8.13.0"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=18"
53
53
  },
54
- "gitHead": "2b85b2b458b1117870a4f0aee18fb45ce991848d"
54
+ "gitHead": "2fd3fb430cc96a8a50543f57d96b288219a11923"
55
55
  }