@cspell/cspell-json-reporter 9.0.2 → 9.1.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.
Files changed (2) hide show
  1. package/dist/esm/index.js +15 -1
  2. package/package.json +3 -3
package/dist/esm/index.js CHANGED
@@ -10,13 +10,26 @@ const noopReporter = () => undefined;
10
10
  const STDOUT = 'stdout';
11
11
  const STDERR = 'stderr';
12
12
  const _console = console;
13
+ function cleanIssue(issue) {
14
+ // Remove properties that are not needed in the output.
15
+ const { hasPreferredSuggestions, hasSimpleSuggestions, context, ...rest } = issue;
16
+ const cleaned = rest;
17
+ if (hasPreferredSuggestions) {
18
+ cleaned.hasPreferredSuggestions = hasPreferredSuggestions;
19
+ }
20
+ if (hasSimpleSuggestions) {
21
+ cleaned.hasSimpleSuggestions = hasSimpleSuggestions;
22
+ }
23
+ cleaned.context = context || issue.line;
24
+ return cleaned;
25
+ }
13
26
  export function getReporter(settings, cliOptions) {
14
27
  const useSettings = normalizeSettings(settings);
15
28
  const reportData = { issues: [], info: [], debug: [], error: [], progress: [] };
16
29
  const console = cliOptions?.console ?? _console;
17
30
  return {
18
31
  issue: (issue) => {
19
- reportData.issues.push(issue);
32
+ reportData.issues.push(cleanIssue(issue));
20
33
  },
21
34
  info: (message, msgType) => {
22
35
  if (msgType === MessageTypes.Debug && !useSettings.debug) {
@@ -59,6 +72,7 @@ export function getReporter(settings, cliOptions) {
59
72
  await mkdirp(path.dirname(outFilePath));
60
73
  return fs.writeFile(outFilePath, jsonData);
61
74
  },
75
+ features: undefined,
62
76
  };
63
77
  }
64
78
  function normalizeSettings(settings) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cspell/cspell-json-reporter",
3
- "version": "9.0.2",
3
+ "version": "9.1.0",
4
4
  "description": "JSON reporter for CSpell",
5
5
  "author": "Jason Dent",
6
6
  "license": "MIT",
@@ -47,10 +47,10 @@
47
47
  "watch": "tsc -b . -w -f"
48
48
  },
49
49
  "dependencies": {
50
- "@cspell/cspell-types": "9.0.2"
50
+ "@cspell/cspell-types": "9.1.0"
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=20"
54
54
  },
55
- "gitHead": "39dbd9ab9b8943a023d9eda7f65f81e822f939b5"
55
+ "gitHead": "a7ed42a31debbc86faa4a4ac2c686bdffe5b26b6"
56
56
  }