cspell 8.13.0 → 8.13.2

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,5 +1,5 @@
1
1
  import assert from 'node:assert';
2
- import { format } from 'node:util';
2
+ import { formatWithOptions } from 'node:util';
3
3
  import { toFileDirURL, toFilePathOrHref, toFileURL, urlRelative } from '@cspell/url';
4
4
  import { Chalk } from 'chalk';
5
5
  import { makeTemplate } from 'chalk-template';
@@ -23,7 +23,7 @@ assert(!console);
23
23
  * @param reportedIssuesCollection - optional collection to store reported issues.
24
24
  * @returns issueEmitter function
25
25
  */
26
- function genIssueEmitter(io, template, uniqueIssues, reportedIssuesCollection) {
26
+ function genIssueEmitter(stdIO, errIO, template, uniqueIssues, reportedIssuesCollection) {
27
27
  const uniqueFilter = uniqueIssues ? uniqueFilterFnGenerator((issue) => issue.text) : () => true;
28
28
  const defaultWidth = 10;
29
29
  let maxWidth = defaultWidth;
@@ -36,9 +36,9 @@ function genIssueEmitter(io, template, uniqueIssues, reportedIssuesCollection) {
36
36
  uri = issue.uri;
37
37
  }
38
38
  maxWidth = Math.max(maxWidth * 0.999, issue.text.length, 10);
39
- const issueText = formatIssue(io, template, issue, Math.ceil(maxWidth));
40
- reportedIssuesCollection?.push(issueText);
41
- io.writeLine(issueText);
39
+ const issueText = formatIssue(stdIO, template, issue, Math.ceil(maxWidth));
40
+ reportedIssuesCollection?.push(formatIssue(errIO, template, issue, Math.ceil(maxWidth)));
41
+ stdIO.writeLine(issueText);
42
42
  };
43
43
  }
44
44
  function nullEmitter() {
@@ -157,13 +157,18 @@ export function getReporter(options, config) {
157
157
  fn(r);
158
158
  };
159
159
  }
160
- const issuesCollection = showProgress ? [] : undefined;
160
+ /*
161
+ * Turn off repeated issues see https://github.com/streetsidesoftware/cspell/pull/6058
162
+ * We might want to add a CLI option later to turn this back on.
163
+ */
164
+ const repeatIssues = false;
165
+ const issuesCollection = showProgress && repeatIssues ? [] : undefined;
161
166
  const errorCollection = [];
162
167
  function errorEmitter(message, error) {
163
168
  if (isSpellingDictionaryLoadError(error)) {
164
169
  error = error.cause;
165
170
  }
166
- const errorText = format(stderr.chalk.red(message), error.toString());
171
+ const errorText = formatWithOptions({ colors: stderr.stream.hasColors?.() }, stderr.chalk.red(message), error.toString());
167
172
  errorCollection?.push(errorText);
168
173
  consoleError(errorText);
169
174
  }
@@ -238,7 +243,9 @@ export function getReporter(options, config) {
238
243
  }
239
244
  }
240
245
  return {
241
- issue: relativeIssue(silent || !issues ? nullEmitter : genIssueEmitter(stdio, issueTemplate, uniqueIssues, issuesCollection)),
246
+ issue: relativeIssue(silent || !issues
247
+ ? nullEmitter
248
+ : genIssueEmitter(stdio, stderr, issueTemplate, uniqueIssues, issuesCollection)),
242
249
  error: silent ? nullEmitter : errorEmitter,
243
250
  info: infoEmitter,
244
251
  debug: emitters.Debug,
@@ -1,4 +1,4 @@
1
- import { format as utilFormat } from 'node:util';
1
+ import { formatWithOptions } from 'node:util';
2
2
  class ImplChannel {
3
3
  stream;
4
4
  constructor(stream) {
@@ -7,7 +7,7 @@ class ImplChannel {
7
7
  write = (msg) => this.stream.write(msg);
8
8
  writeLine = (msg) => this.write(msg + '\n');
9
9
  clearLine = (dir, callback) => this.stream.clearLine?.(dir, callback) ?? false;
10
- printLine = (...params) => this.writeLine((params.length && utilFormat(...params)) || '');
10
+ printLine = (...params) => this.writeLine((params.length && formatWithOptions({ colors: this.stream.hasColors?.() }, ...params)) || '');
11
11
  getColorLevel = () => getColorLevel(this.stream);
12
12
  }
13
13
  class Console {
@@ -283,7 +283,7 @@ export async function runLint(cfg) {
283
283
  }
284
284
  async function run() {
285
285
  if (cfg.options.root) {
286
- setEnvironmentVariable(ENV_CSPELL_GLOB_ROOT, cfg.options.root);
286
+ setEnvironmentVariable(ENV_CSPELL_GLOB_ROOT, cfg.root);
287
287
  }
288
288
  const configInfo = await readConfig(cfg.configFile, cfg.root);
289
289
  if (cfg.options.defaultConfiguration !== undefined) {
@@ -1,6 +1,6 @@
1
1
  export { pkgDir } from './dirname.js';
2
2
  export declare const name = "cspell";
3
- export declare const version = "8.13.0";
3
+ export declare const version = "8.13.2";
4
4
  export declare const engines: {
5
5
  node: string;
6
6
  };
@@ -1,7 +1,7 @@
1
1
  // This file is generated by tools/patch-version.mjs
2
2
  export { pkgDir } from './dirname.js';
3
3
  export const name = 'cspell';
4
- export const version = '8.13.0';
4
+ export const version = '8.13.2';
5
5
  export const engines = { node: '>=18' };
6
6
  export const npmPackage = { name, version, engines };
7
7
  //# sourceMappingURL=pkgInfo.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "8.13.0",
3
+ "version": "8.13.2",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "bin": {
@@ -82,19 +82,19 @@
82
82
  },
83
83
  "homepage": "https://streetsidesoftware.github.io/cspell/",
84
84
  "dependencies": {
85
- "@cspell/cspell-json-reporter": "8.13.0",
86
- "@cspell/cspell-pipe": "8.13.0",
87
- "@cspell/cspell-types": "8.13.0",
88
- "@cspell/dynamic-import": "8.13.0",
89
- "@cspell/url": "8.13.0",
85
+ "@cspell/cspell-json-reporter": "8.13.2",
86
+ "@cspell/cspell-pipe": "8.13.2",
87
+ "@cspell/cspell-types": "8.13.2",
88
+ "@cspell/dynamic-import": "8.13.2",
89
+ "@cspell/url": "8.13.2",
90
90
  "chalk": "^5.3.0",
91
91
  "chalk-template": "^1.1.0",
92
92
  "commander": "^12.1.0",
93
- "cspell-dictionary": "8.13.0",
94
- "cspell-gitignore": "8.13.0",
95
- "cspell-glob": "8.13.0",
96
- "cspell-io": "8.13.0",
97
- "cspell-lib": "8.13.0",
93
+ "cspell-dictionary": "8.13.2",
94
+ "cspell-gitignore": "8.13.2",
95
+ "cspell-glob": "8.13.2",
96
+ "cspell-io": "8.13.2",
97
+ "cspell-lib": "8.13.2",
98
98
  "fast-glob": "^3.3.2",
99
99
  "fast-json-stable-stringify": "^2.1.0",
100
100
  "file-entry-cache": "^9.0.0",
@@ -113,5 +113,5 @@
113
113
  "micromatch": "^4.0.7",
114
114
  "minimatch": "^9.0.5"
115
115
  },
116
- "gitHead": "2fd3fb430cc96a8a50543f57d96b288219a11923"
116
+ "gitHead": "5c9aaf8829991e7d6d37355acb9b9685088bba14"
117
117
  }