cspell 10.0.0 → 10.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.
@@ -0,0 +1,403 @@
1
+ import "cspell-lib";
2
+ import { CSpellReporter, CSpellSettings, CacheFormat, CacheStrategy, ReporterConfiguration, RunResult } from "@cspell/cspell-types";
3
+ import { GlobMatcher } from "cspell-glob";
4
+ import "cspell-io";
5
+ //#region src/util/cache/CacheOptions.d.ts
6
+ interface CacheOptions {
7
+ /**
8
+ * The version of `cspell` that made the cache entry.
9
+ * Cache entries must match the `major.minor` version.
10
+ */
11
+ version: string;
12
+ /**
13
+ * Store the info about processed files in order to only operate on the changed ones.
14
+ */
15
+ cache?: boolean;
16
+ /**
17
+ * Path to the cache location. Can be a file or a directory.
18
+ * If none specified .cspellcache will be used.
19
+ * The file will be created in the directory where the cspell command is executed.
20
+ */
21
+ cacheLocation?: string;
22
+ /**
23
+ * Strategy to use for detecting changed files, default: metadata
24
+ */
25
+ cacheStrategy?: CacheStrategy;
26
+ /**
27
+ * Resets the cache
28
+ */
29
+ cacheReset?: boolean;
30
+ /**
31
+ * Format of the cache file.
32
+ * - `legacy` - use absolute paths in the cache file
33
+ * - `universal` - use a sharable format.
34
+ * @default 'legacy'
35
+ */
36
+ cacheFormat?: CacheFormat;
37
+ }
38
+ //#endregion
39
+ //#region src/reporters/LintFileResult.d.ts
40
+ type FinalizedReporter = Required<CSpellReporter>;
41
+ //#endregion
42
+ //#region src/options.d.ts
43
+ interface LinterOptions extends Omit<BaseOptions, "config">, Omit<CacheOptions, "version">, ReporterConfiguration {
44
+ /**
45
+ * Display verbose information
46
+ */
47
+ verbose?: boolean;
48
+ /**
49
+ * Level of verbosity (higher number = more verbose).
50
+ */
51
+ verboseLevel?: number;
52
+ /**
53
+ * Show extensive output.
54
+ */
55
+ debug?: boolean;
56
+ /**
57
+ * a globs to exclude files from being checked.
58
+ */
59
+ exclude?: string[] | string;
60
+ /**
61
+ * Only report the words, no line numbers or file names.
62
+ */
63
+ wordsOnly?: boolean;
64
+ /**
65
+ * unique errors per file only.
66
+ */
67
+ unique?: boolean;
68
+ /**
69
+ * root directory, defaults to `cwd`
70
+ */
71
+ root?: string;
72
+ /**
73
+ * Determine if files / directories starting with `.` should be part
74
+ * of the glob search.
75
+ * @default false
76
+ */
77
+ dot?: boolean;
78
+ /**
79
+ * Show part of a line where an issue is found.
80
+ * - if true, it will show the default number of characters on either side.
81
+ * - if a number, the number of characters to show on either side of the issue.
82
+ */
83
+ showContext?: boolean | number;
84
+ /**
85
+ * Show suggestions for spelling errors.
86
+ */
87
+ showSuggestions?: boolean;
88
+ /**
89
+ * Enable filtering out files matching globs found in `.gitignore` files.
90
+ */
91
+ gitignore?: boolean;
92
+ /**
93
+ * Stop searching for a `.gitignore`s when a root is reached.
94
+ */
95
+ gitignoreRoot?: string | string[];
96
+ /**
97
+ * List of files that contains the paths to files to be spell checked.
98
+ * The files in the lists will be filtered against the glob patterns.
99
+ * - an entry of `stdin` means to read the file list from **`stdin`**
100
+ * The resulting files are filtered against the `files` globs found in the configuration.
101
+ */
102
+ fileList?: string[] | undefined;
103
+ /**
104
+ * List of file paths to spell check. These can be relative or absolute
105
+ * paths, but not Globs. Relative paths are relative to {@link LinterOptions.root}.
106
+ * The files are combined with the file paths read from {@link LinterOptions.fileList}.
107
+ * These files are filtered against the `files` globs found in the configuration.
108
+ */
109
+ files?: string[] | undefined;
110
+ /**
111
+ * Alias of {@link LinterOptions.files}.
112
+ */
113
+ file?: string[] | undefined;
114
+ /**
115
+ * Use the `files` configuration to filter the files found.
116
+ */
117
+ filterFiles?: boolean | undefined;
118
+ /**
119
+ * Files must be found and processed otherwise it is considered an error.
120
+ */
121
+ mustFindFiles?: boolean;
122
+ /**
123
+ * List of dictionary names to use.
124
+ */
125
+ dictionary?: string[] | undefined;
126
+ /**
127
+ * List of dictionary names to disable.
128
+ */
129
+ disableDictionary?: string[] | undefined;
130
+ /**
131
+ * Stop processing and exit if an issue or error is found.
132
+ */
133
+ failFast?: boolean;
134
+ /**
135
+ * Keep going even if an error is found.
136
+ */
137
+ continueOnError?: boolean;
138
+ /**
139
+ * Optional list of reporters to use, overriding any specified in the
140
+ * configuration.
141
+ */
142
+ reporter?: string[];
143
+ /**
144
+ * Load and parse documents, but do not spell check.
145
+ */
146
+ skipValidation?: boolean;
147
+ /**
148
+ * Path to configuration file.
149
+ */
150
+ config?: string | CSpellConfigFile;
151
+ /**
152
+ * Specify the maximum file size to be checked.
153
+ * The value can include a units suffix: `KB`, `MB`, `B`, `GB`.
154
+ * The numeric value can include a decimal.
155
+ * Example: 1.5MB
156
+ */
157
+ maxFileSize?: string | undefined;
158
+ }
159
+ interface TraceOptions extends BaseOptions {
160
+ /**
161
+ * Use stdin for the input.
162
+ */
163
+ stdin?: boolean;
164
+ /**
165
+ * Enable the `allowCompoundWords` option.
166
+ */
167
+ allowCompoundWords?: boolean;
168
+ /**
169
+ * Ignore case and accents when searching for words.
170
+ */
171
+ ignoreCase?: boolean;
172
+ /**
173
+ * Show all dictionaries, not just the ones that contain the words or are enabled.
174
+ */
175
+ all?: boolean;
176
+ /**
177
+ * Show only dictionaries that contain the words.
178
+ * If `all` is set, this option is ignored.
179
+ */
180
+ onlyFound?: boolean;
181
+ /**
182
+ * Names of dictionaries to use.
183
+ */
184
+ dictionary?: string[] | undefined;
185
+ /**
186
+ * Configure how to display the dictionary path.
187
+ */
188
+ dictionaryPath?: "hide" | "long" | "short" | "full";
189
+ }
190
+ interface SuggestionOptions extends BaseOptions {
191
+ /**
192
+ * Strict case and accent checking
193
+ * @default true
194
+ */
195
+ strict?: boolean;
196
+ /**
197
+ * List of dictionaries to use. If specified, only that list of dictionaries will be used.
198
+ */
199
+ dictionaries?: string[] | undefined;
200
+ /**
201
+ * The number of suggestions to make.
202
+ * @default 8
203
+ */
204
+ numSuggestions?: number;
205
+ /**
206
+ * Max number of changes / edits to the word to get to a suggestion matching suggestion.
207
+ * @default 4
208
+ */
209
+ numChanges?: number;
210
+ /**
211
+ * If multiple suggestions have the same edit / change "cost", then included them even if
212
+ * it causes more than `numSuggestions` to be returned.
213
+ * @default true
214
+ */
215
+ includeTies?: boolean;
216
+ /**
217
+ * Use stdin for the input
218
+ */
219
+ useStdin?: boolean | undefined;
220
+ /**
221
+ * Use REPL interface for making suggestions.
222
+ */
223
+ repl?: boolean;
224
+ }
225
+ interface DictionariesOptions {
226
+ /**
227
+ * Path to configuration file.
228
+ */
229
+ config?: string;
230
+ /**
231
+ * Load the default configuration
232
+ * @default true
233
+ */
234
+ defaultConfiguration?: boolean;
235
+ /**
236
+ * Use color in the output.
237
+ * `true` to force color, `false` to turn off color.
238
+ * `undefined` to use color if the output is a TTY.
239
+ */
240
+ color?: boolean | undefined;
241
+ /**
242
+ * Show enabled:
243
+ * - `true` to show only enabled dictionaries.
244
+ * - `false` to show only disabled dictionaries.
245
+ * - `undefined` to show all dictionaries.
246
+ */
247
+ enabled?: boolean | undefined;
248
+ /**
249
+ * The locale to use when listing dictionaries.
250
+ */
251
+ locale?: string;
252
+ /**
253
+ * The file type to use when listing dictionaries.
254
+ */
255
+ fileType?: string;
256
+ /**
257
+ * show the language locales supported by the dictionary.
258
+ */
259
+ showLocales?: boolean;
260
+ /**
261
+ * show the file types supported by the dictionary.
262
+ */
263
+ showFileTypes?: boolean;
264
+ /**
265
+ * Dhow the location of the dictionary.
266
+ */
267
+ showLocation?: boolean;
268
+ pathFormat?: "hide" | "short" | "long" | "full";
269
+ }
270
+ interface LegacyOptions {
271
+ local?: string;
272
+ }
273
+ interface BaseOptions {
274
+ /**
275
+ * Path to configuration file.
276
+ */
277
+ config?: string;
278
+ /**
279
+ * Programming Language ID.
280
+ */
281
+ languageId?: string;
282
+ /**
283
+ * Locale to use.
284
+ */
285
+ locale?: string;
286
+ /**
287
+ * Load the default configuration
288
+ * @default true
289
+ */
290
+ defaultConfiguration?: boolean;
291
+ /**
292
+ * Check In-Document CSpell directives for correctness.
293
+ */
294
+ validateDirectives?: boolean;
295
+ /**
296
+ * Return an exit code if there are issues found.
297
+ * @default true
298
+ */
299
+ exitCode?: boolean;
300
+ /**
301
+ * Execution flags.
302
+ * Used primarily for releasing experimental features.
303
+ * Flags are of the form key:value
304
+ */
305
+ flag?: string[];
306
+ /**
307
+ * Use color in the output.
308
+ * `true` to force color, `false` to turn off color.
309
+ * `undefined` to use color if the output is a TTY.
310
+ */
311
+ color?: boolean | undefined;
312
+ }
313
+ interface LinterCliOptions extends LinterOptions {
314
+ /**
315
+ * Show legacy output
316
+ */
317
+ legacy?: boolean;
318
+ /**
319
+ * Show summary at the end
320
+ */
321
+ summary?: boolean;
322
+ /**
323
+ * Show issues
324
+ */
325
+ issues?: boolean;
326
+ /**
327
+ * Run in silent mode.
328
+ * @default false
329
+ */
330
+ silent?: boolean;
331
+ /**
332
+ * Show progress
333
+ */
334
+ progress?: boolean;
335
+ /**
336
+ * issues are shown with a relative path to the root or `cwd`
337
+ */
338
+ relative?: boolean;
339
+ /**
340
+ * Files must be found or cli will exit with an error.
341
+ */
342
+ mustFindFiles?: boolean;
343
+ /**
344
+ * Generate a summary report of issues.
345
+ */
346
+ issuesSummaryReport?: boolean;
347
+ /**
348
+ * Generate a summary report of performance.
349
+ */
350
+ showPerfSummary?: boolean;
351
+ /**
352
+ * Set the template to use when reporting issues.
353
+ *
354
+ * The template is a string that can contain the following placeholders:
355
+ * - `$filename` - the file name
356
+ * - `$col` - the column number
357
+ * - `$row` - the row number
358
+ * - `$text` - the word that is misspelled
359
+ * - `$message` - the issues message: "unknown word", "word is misspelled", etc.
360
+ * - `$messageColored` - the issues message with color based upon the message type.
361
+ * - `$uri` - the URI of the file
362
+ * - `$suggestions` - suggestions for the misspelled word (if requested)
363
+ * - `$quickFix` - possible quick fixes for the misspelled word.
364
+ * - `$contextFull` - the full context of the misspelled word.
365
+ * - `$contextLeft` - the context to the left of the misspelled word.
366
+ * - `$contextRight` - the context to the right of the misspelled word.
367
+ *
368
+ * Color is supported using the following template pattern:
369
+ * - `{<style[.style]> <text>}` - where `<style>` is a style name and `<text>` is the text to style.
370
+ *
371
+ * Styles
372
+ * - `bold`, `italic`, `underline`, `strikethrough`, `dim`, `inverse`
373
+ * - `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
374
+ *
375
+ * Example:
376
+ * @example "{green $filename}:{yellow $row}:{yellow $col} $message {red $text} $quickFix {dim $suggestions}"
377
+ * @since 8.12.0
378
+ */
379
+ issueTemplate?: string;
380
+ /**
381
+ * Prevents searching for local configuration files
382
+ *
383
+ * When `--no-config-search` is passed on the command line, this will be `true`.
384
+ * If the flag is not passed, it defaults to `false`.
385
+ */
386
+ configSearch?: boolean;
387
+ /**
388
+ * Directory paths at which CSpell should stop searching for configuration files.
389
+ *
390
+ * These are set via one or more `--stop-config-search-at <dir>` CLI options.
391
+ * If no flags are passed, this will be `undefined`.
392
+ */
393
+ stopConfigSearchAt?: string[];
394
+ report?: ReportChoices | undefined;
395
+ }
396
+ type ReportChoices = "all" | "simple" | "typos" | "flagged";
397
+ interface CSpellConfigFile {
398
+ url: URL;
399
+ settings: CSpellSettings;
400
+ }
401
+ //#endregion
402
+ export { SuggestionOptions as a, LinterCliOptions as i, DictionariesOptions as n, TraceOptions as o, LegacyOptions as r, FinalizedReporter as s, BaseOptions as t };
403
+ //# sourceMappingURL=options-CG62AIq-.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "bin": {
@@ -86,36 +86,36 @@
86
86
  },
87
87
  "homepage": "https://cspell.org/",
88
88
  "dependencies": {
89
- "@cspell/cspell-json-reporter": "10.0.0",
90
- "@cspell/cspell-performance-monitor": "10.0.0",
91
- "@cspell/cspell-pipe": "10.0.0",
92
- "@cspell/cspell-types": "10.0.0",
93
- "@cspell/cspell-worker": "10.0.0",
94
- "@cspell/dynamic-import": "10.0.0",
95
- "@cspell/url": "10.0.0",
96
- "ansi-regex": "^6.2.2",
97
- "chalk": "^5.6.2",
89
+ "@cspell/cspell-json-reporter": "10.1.0",
90
+ "@cspell/cspell-performance-monitor": "10.1.0",
91
+ "@cspell/cspell-pipe": "10.1.0",
92
+ "@cspell/cspell-types": "10.1.0",
93
+ "@cspell/cspell-worker": "10.1.0",
94
+ "@cspell/dynamic-import": "10.1.0",
95
+ "@cspell/url": "10.1.0",
96
+ "ansi-regex": "^6.3.0",
97
+ "chalk": "^6.0.0",
98
98
  "chalk-template": "^1.1.2",
99
- "commander": "^14.0.3",
100
- "cspell-config-lib": "10.0.0",
101
- "cspell-dictionary": "10.0.0",
102
- "cspell-gitignore": "10.0.0",
103
- "cspell-glob": "10.0.0",
104
- "cspell-io": "10.0.0",
105
- "cspell-lib": "10.0.0",
99
+ "commander": "^15.0.0",
100
+ "cspell-config-lib": "10.1.0",
101
+ "cspell-dictionary": "10.1.0",
102
+ "cspell-gitignore": "10.1.0",
103
+ "cspell-glob": "10.1.0",
104
+ "cspell-io": "10.1.0",
105
+ "cspell-lib": "10.1.0",
106
106
  "fast-json-stable-stringify": "^2.1.0",
107
- "flatted": "^3.4.2",
108
- "semver": "^7.7.4",
109
- "tinyglobby": "^0.2.15"
107
+ "flatted": "^3.4.4",
108
+ "semver": "^7.8.5",
109
+ "tinyglobby": "^0.2.17"
110
110
  },
111
111
  "engines": {
112
112
  "node": ">=22.18.0"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@types/micromatch": "^4.0.10",
116
- "@types/semver": "^7.7.1",
116
+ "@types/semver": "^7.8.0",
117
117
  "micromatch": "^4.0.8",
118
118
  "minimatch": "^9.0.9"
119
119
  },
120
- "gitHead": "6ddfd576b6bb554a7cb8dba1ab053a0b6ff8021f"
120
+ "gitHead": "401518c5e37c06fb406aedadb3fc7a1c27eca8e6"
121
121
  }