cspell 9.1.3 → 9.2.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 (152) hide show
  1. package/README.md +29 -21
  2. package/bin.mjs +1 -1
  3. package/dist/esm/app.d.ts +19 -0
  4. package/dist/esm/app.js +1033 -0
  5. package/dist/esm/application-D8WjsMdV.d.ts +116 -0
  6. package/dist/esm/application-_MFvh02K.js +2761 -0
  7. package/dist/esm/application.d.ts +3 -0
  8. package/dist/esm/application.js +3 -0
  9. package/dist/esm/index.d.ts +55 -0
  10. package/dist/esm/index.js +5 -0
  11. package/dist/esm/options-ChaXtdFn.d.ts +387 -0
  12. package/package.json +28 -27
  13. package/dist/esm/app.d.mts +0 -5
  14. package/dist/esm/app.mjs +0 -34
  15. package/dist/esm/application.d.mts +0 -17
  16. package/dist/esm/application.mjs +0 -99
  17. package/dist/esm/cli-reporter.d.ts +0 -38
  18. package/dist/esm/cli-reporter.js +0 -386
  19. package/dist/esm/commandCheck.d.ts +0 -3
  20. package/dist/esm/commandCheck.js +0 -52
  21. package/dist/esm/commandConfig.d.ts +0 -3
  22. package/dist/esm/commandConfig.js +0 -18
  23. package/dist/esm/commandDictionaries.d.ts +0 -3
  24. package/dist/esm/commandDictionaries.js +0 -40
  25. package/dist/esm/commandHelpers.d.ts +0 -18
  26. package/dist/esm/commandHelpers.js +0 -30
  27. package/dist/esm/commandInit.d.ts +0 -3
  28. package/dist/esm/commandInit.js +0 -25
  29. package/dist/esm/commandLink.d.ts +0 -3
  30. package/dist/esm/commandLink.js +0 -48
  31. package/dist/esm/commandLint.d.ts +0 -3
  32. package/dist/esm/commandLint.js +0 -226
  33. package/dist/esm/commandSuggestion.d.ts +0 -3
  34. package/dist/esm/commandSuggestion.js +0 -61
  35. package/dist/esm/commandTrace.d.ts +0 -3
  36. package/dist/esm/commandTrace.js +0 -91
  37. package/dist/esm/config/adjustConfig.d.ts +0 -7
  38. package/dist/esm/config/adjustConfig.js +0 -137
  39. package/dist/esm/config/config.d.ts +0 -5
  40. package/dist/esm/config/config.js +0 -18
  41. package/dist/esm/config/configInit.d.ts +0 -3
  42. package/dist/esm/config/configInit.js +0 -104
  43. package/dist/esm/config/constants.d.ts +0 -17
  44. package/dist/esm/config/constants.js +0 -23
  45. package/dist/esm/config/index.d.ts +0 -3
  46. package/dist/esm/config/index.js +0 -2
  47. package/dist/esm/config/options.d.ts +0 -62
  48. package/dist/esm/config/options.js +0 -2
  49. package/dist/esm/config/updateConfig.d.ts +0 -3
  50. package/dist/esm/config/updateConfig.js +0 -2
  51. package/dist/esm/console.d.ts +0 -25
  52. package/dist/esm/console.js +0 -53
  53. package/dist/esm/dictionaries/index.d.ts +0 -3
  54. package/dist/esm/dictionaries/index.js +0 -2
  55. package/dist/esm/dictionaries/listDictionaries.d.ts +0 -33
  56. package/dist/esm/dictionaries/listDictionaries.js +0 -131
  57. package/dist/esm/dirname.d.ts +0 -2
  58. package/dist/esm/dirname.js +0 -13
  59. package/dist/esm/emitters/DictionaryPathFormat.d.ts +0 -3
  60. package/dist/esm/emitters/DictionaryPathFormat.js +0 -12
  61. package/dist/esm/emitters/dictionaryListEmitter.d.ts +0 -19
  62. package/dist/esm/emitters/dictionaryListEmitter.js +0 -82
  63. package/dist/esm/emitters/helpers.d.ts +0 -14
  64. package/dist/esm/emitters/helpers.js +0 -67
  65. package/dist/esm/emitters/suggestionsEmitter.d.ts +0 -13
  66. package/dist/esm/emitters/suggestionsEmitter.js +0 -79
  67. package/dist/esm/emitters/traceEmitter.d.ts +0 -19
  68. package/dist/esm/emitters/traceEmitter.js +0 -87
  69. package/dist/esm/environment.d.ts +0 -39
  70. package/dist/esm/environment.js +0 -30
  71. package/dist/esm/featureFlags/featureFlags.d.ts +0 -4
  72. package/dist/esm/featureFlags/featureFlags.js +0 -21
  73. package/dist/esm/featureFlags/index.d.ts +0 -2
  74. package/dist/esm/featureFlags/index.js +0 -2
  75. package/dist/esm/index.d.mts +0 -6
  76. package/dist/esm/index.mjs +0 -4
  77. package/dist/esm/link.d.ts +0 -8
  78. package/dist/esm/link.js +0 -39
  79. package/dist/esm/lint/LintRequest.d.ts +0 -26
  80. package/dist/esm/lint/LintRequest.js +0 -83
  81. package/dist/esm/lint/index.d.ts +0 -3
  82. package/dist/esm/lint/index.js +0 -3
  83. package/dist/esm/lint/lint.d.ts +0 -8
  84. package/dist/esm/lint/lint.js +0 -515
  85. package/dist/esm/models.d.ts +0 -15
  86. package/dist/esm/models.js +0 -2
  87. package/dist/esm/options.d.ts +0 -353
  88. package/dist/esm/options.js +0 -9
  89. package/dist/esm/pkgInfo.d.ts +0 -14
  90. package/dist/esm/pkgInfo.js +0 -7
  91. package/dist/esm/repl/index.d.ts +0 -18
  92. package/dist/esm/repl/index.js +0 -52
  93. package/dist/esm/util/InMemoryReporter.d.ts +0 -31
  94. package/dist/esm/util/InMemoryReporter.js +0 -49
  95. package/dist/esm/util/LintFileResult.d.ts +0 -14
  96. package/dist/esm/util/LintFileResult.js +0 -2
  97. package/dist/esm/util/async.d.ts +0 -3
  98. package/dist/esm/util/async.js +0 -4
  99. package/dist/esm/util/cache/CSpellLintResultCache.d.ts +0 -20
  100. package/dist/esm/util/cache/CSpellLintResultCache.js +0 -2
  101. package/dist/esm/util/cache/CacheOptions.d.ts +0 -34
  102. package/dist/esm/util/cache/CacheOptions.js +0 -2
  103. package/dist/esm/util/cache/DiskCache.d.ts +0 -63
  104. package/dist/esm/util/cache/DiskCache.js +0 -214
  105. package/dist/esm/util/cache/DummyCache.d.ts +0 -11
  106. package/dist/esm/util/cache/DummyCache.js +0 -18
  107. package/dist/esm/util/cache/ObjectCollection.d.ts +0 -17
  108. package/dist/esm/util/cache/ObjectCollection.js +0 -127
  109. package/dist/esm/util/cache/createCache.d.ts +0 -31
  110. package/dist/esm/util/cache/createCache.js +0 -69
  111. package/dist/esm/util/cache/file-entry-cache.d.mts +0 -4
  112. package/dist/esm/util/cache/file-entry-cache.mjs +0 -5
  113. package/dist/esm/util/cache/fileEntryCache.d.ts +0 -9
  114. package/dist/esm/util/cache/fileEntryCache.js +0 -79
  115. package/dist/esm/util/cache/index.d.ts +0 -4
  116. package/dist/esm/util/cache/index.js +0 -2
  117. package/dist/esm/util/canUseColor.d.ts +0 -2
  118. package/dist/esm/util/canUseColor.js +0 -10
  119. package/dist/esm/util/configFileHelper.d.ts +0 -15
  120. package/dist/esm/util/configFileHelper.js +0 -43
  121. package/dist/esm/util/constants.d.ts +0 -6
  122. package/dist/esm/util/constants.js +0 -6
  123. package/dist/esm/util/errors.d.ts +0 -24
  124. package/dist/esm/util/errors.js +0 -60
  125. package/dist/esm/util/extractContext.d.ts +0 -5
  126. package/dist/esm/util/extractContext.js +0 -75
  127. package/dist/esm/util/fileHelper.d.ts +0 -44
  128. package/dist/esm/util/fileHelper.js +0 -165
  129. package/dist/esm/util/glob.d.ts +0 -45
  130. package/dist/esm/util/glob.js +0 -147
  131. package/dist/esm/util/pad.d.ts +0 -45
  132. package/dist/esm/util/pad.js +0 -191
  133. package/dist/esm/util/prefetch.d.ts +0 -2
  134. package/dist/esm/util/prefetch.js +0 -15
  135. package/dist/esm/util/reporters.d.ts +0 -30
  136. package/dist/esm/util/reporters.js +0 -209
  137. package/dist/esm/util/stdin.d.ts +0 -2
  138. package/dist/esm/util/stdin.js +0 -5
  139. package/dist/esm/util/stdinUrl.d.ts +0 -9
  140. package/dist/esm/util/stdinUrl.js +0 -26
  141. package/dist/esm/util/table.d.ts +0 -41
  142. package/dist/esm/util/table.js +0 -115
  143. package/dist/esm/util/timer.d.ts +0 -4
  144. package/dist/esm/util/timer.js +0 -9
  145. package/dist/esm/util/types.d.ts +0 -7
  146. package/dist/esm/util/types.js +0 -5
  147. package/dist/esm/util/unindent.d.ts +0 -14
  148. package/dist/esm/util/unindent.js +0 -55
  149. package/dist/esm/util/util.d.ts +0 -14
  150. package/dist/esm/util/util.js +0 -30
  151. package/dist/esm/util/writeFile.d.ts +0 -3
  152. package/dist/esm/util/writeFile.js +0 -30
@@ -0,0 +1,3 @@
1
+ import "./options-ChaXtdFn.js";
2
+ import { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace } from "./application-D8WjsMdV.js";
3
+ export { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
@@ -0,0 +1,3 @@
1
+ import { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace } from "./application-_MFvh02K.js";
2
+
3
+ export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
@@ -0,0 +1,55 @@
1
+ import { BaseOptions, LinterCliOptions, TraceOptions } from "./options-ChaXtdFn.js";
2
+ import { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace } from "./application-D8WjsMdV.js";
3
+ import "chalk";
4
+ import { CSpellReporter, CSpellSettings, ReporterConfiguration, RunResult } from "@cspell/cspell-types";
5
+ import { WriteStream } from "node:tty";
6
+ export * from "@cspell/cspell-types";
7
+
8
+ //#region src/console.d.ts
9
+ type Log = (format?: any, ...params: any[]) => void;
10
+ type IOStream = NodeJS.WritableStream & Pick<WriteStream, "isTTY" | "rows" | "columns"> & Pick<Partial<WriteStream>, "hasColors" | "clearLine" | "getColorDepth">;
11
+ interface IConsole {
12
+ readonly log: Log;
13
+ readonly error: Log;
14
+ readonly info: Log;
15
+ readonly warn: Log;
16
+ readonly stderrChannel: Channel;
17
+ readonly stdoutChannel: Channel;
18
+ }
19
+ interface Channel {
20
+ stream: IOStream;
21
+ write: (msg: string) => void;
22
+ writeLine: (msg: string) => void;
23
+ clearLine: (dir: -1 | 0 | 1, callback?: () => void) => boolean;
24
+ printLine: (format?: any, ...params: any[]) => void;
25
+ getColorLevel: () => 0 | 1 | 2 | 3;
26
+ }
27
+ //#endregion
28
+ //#region src/models.d.ts
29
+ type ReporterConsole = IConsole;
30
+ interface CSpellReporterConfiguration extends Readonly<ReporterConfiguration>, Readonly<LinterCliOptions> {
31
+ /**
32
+ * The console to use for reporting.
33
+ * @since 8.11.1
34
+ */
35
+ readonly console?: ReporterConsole;
36
+ }
37
+ interface CSpellReporterModule {
38
+ getReporter: <T>(settings: T, config: CSpellReporterConfiguration) => CSpellReporter;
39
+ }
40
+ //#endregion
41
+ //#region src/util/reporters.d.ts
42
+ type FinalizedReporter = Required<CSpellReporter>;
43
+ /**
44
+ * Loads reporter modules configured in cspell config file
45
+ */
46
+
47
+ //#endregion
48
+ //#region src/cli-reporter.d.ts
49
+ interface ReporterOptions extends Pick<LinterCliOptions, "color" | "debug" | "issues" | "issuesSummaryReport" | "legacy" | "progress" | "relative" | "root" | "showContext" | "showPerfSummary" | "showSuggestions" | "silent" | "summary" | "verbose" | "wordsOnly"> {
50
+ fileGlobs: string[];
51
+ }
52
+ declare function getReporter(options: ReporterOptions, config?: CSpellReporterConfiguration): FinalizedReporter;
53
+ //#endregion
54
+ export { AppError, type BaseOptions, type LinterCliOptions as CSpellApplicationOptions, type CSpellReporterConfiguration, type CSpellReporterModule, CheckTextResult, IncludeExcludeFlag, type TraceOptions, TraceResult, checkText, createInit, getReporter as getDefaultReporter, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { IncludeExcludeFlag, checkText, createInit, getReporter, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace } from "./application-_MFvh02K.js";
2
+
3
+ export * from "@cspell/cspell-types"
4
+
5
+ export { IncludeExcludeFlag, checkText, createInit, getReporter as getDefaultReporter, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
@@ -0,0 +1,387 @@
1
+ import { CSpellSettings, CacheFormat, CacheStrategy, ReporterConfiguration } from "@cspell/cspell-types";
2
+
3
+ //#region src/util/cache/CacheOptions.d.ts
4
+ interface CacheOptions {
5
+ /**
6
+ * The version of `cspell` that made the cache entry.
7
+ * Cache entries must match the `major.minor` version.
8
+ */
9
+ version: string;
10
+ /**
11
+ * Store the info about processed files in order to only operate on the changed ones.
12
+ */
13
+ cache?: boolean;
14
+ /**
15
+ * Path to the cache location. Can be a file or a directory.
16
+ * If none specified .cspellcache will be used.
17
+ * The file will be created in the directory where the cspell command is executed.
18
+ */
19
+ cacheLocation?: string;
20
+ /**
21
+ * Strategy to use for detecting changed files, default: metadata
22
+ */
23
+ cacheStrategy?: CacheStrategy;
24
+ /**
25
+ * Resets the cache
26
+ */
27
+ cacheReset?: boolean;
28
+ /**
29
+ * Format of the cache file.
30
+ * - `legacy` - use absolute paths in the cache file
31
+ * - `universal` - use a sharable format.
32
+ * @default 'legacy'
33
+ */
34
+ cacheFormat?: CacheFormat;
35
+ }
36
+ //#endregion
37
+ //#region src/options.d.ts
38
+ interface LinterOptions extends Omit<BaseOptions, "config">, Omit<CacheOptions, "version">, ReporterConfiguration {
39
+ /**
40
+ * Display verbose information
41
+ */
42
+ verbose?: boolean;
43
+ /**
44
+ * Show extensive output.
45
+ */
46
+ debug?: boolean;
47
+ /**
48
+ * a globs to exclude files from being checked.
49
+ */
50
+ exclude?: string[] | string;
51
+ /**
52
+ * Only report the words, no line numbers or file names.
53
+ */
54
+ wordsOnly?: boolean;
55
+ /**
56
+ * unique errors per file only.
57
+ */
58
+ unique?: boolean;
59
+ /**
60
+ * root directory, defaults to `cwd`
61
+ */
62
+ root?: string;
63
+ /**
64
+ * Determine if files / directories starting with `.` should be part
65
+ * of the glob search.
66
+ * @default false
67
+ */
68
+ dot?: boolean;
69
+ /**
70
+ * Show part of a line where an issue is found.
71
+ * - if true, it will show the default number of characters on either side.
72
+ * - if a number, the number of characters to show on either side of the issue.
73
+ */
74
+ showContext?: boolean | number;
75
+ /**
76
+ * Show suggestions for spelling errors.
77
+ */
78
+ showSuggestions?: boolean;
79
+ /**
80
+ * Enable filtering out files matching globs found in `.gitignore` files.
81
+ */
82
+ gitignore?: boolean;
83
+ /**
84
+ * Stop searching for a `.gitignore`s when a root is reached.
85
+ */
86
+ gitignoreRoot?: string | string[];
87
+ /**
88
+ * List of files that contains the paths to files to be spell checked.
89
+ * The files in the lists will be filtered against the glob patterns.
90
+ * - an entry of `stdin` means to read the file list from **`stdin`**
91
+ * The resulting files are filtered against the `files` globs found in the configuration.
92
+ */
93
+ fileList?: string[] | undefined;
94
+ /**
95
+ * List of file paths to spell check. These can be relative or absolute
96
+ * paths, but not Globs. Relative paths are relative to {@link LinterOptions.root}.
97
+ * The files are combined with the file paths read from {@link LinterOptions.fileList}.
98
+ * These files are filtered against the `files` globs found in the configuration.
99
+ */
100
+ files?: string[] | undefined;
101
+ /**
102
+ * Alias of {@link LinterOptions.files}.
103
+ */
104
+ file?: string[] | undefined;
105
+ /**
106
+ * Use the `files` configuration to filter the files found.
107
+ */
108
+ filterFiles?: boolean | undefined;
109
+ /**
110
+ * Files must be found and processed otherwise it is considered an error.
111
+ */
112
+ mustFindFiles?: boolean;
113
+ /**
114
+ * List of dictionary names to use.
115
+ */
116
+ dictionary?: string[] | undefined;
117
+ /**
118
+ * List of dictionary names to disable.
119
+ */
120
+ disableDictionary?: string[] | undefined;
121
+ /**
122
+ * Stop processing and exit if an issue or error is found.
123
+ */
124
+ failFast?: boolean;
125
+ /**
126
+ * Keep going even if an error is found.
127
+ */
128
+ continueOnError?: boolean;
129
+ /**
130
+ * Optional list of reporters to use, overriding any specified in the
131
+ * configuration.
132
+ */
133
+ reporter?: string[];
134
+ /**
135
+ * Load and parse documents, but do not spell check.
136
+ */
137
+ skipValidation?: boolean;
138
+ /**
139
+ * Path to configuration file.
140
+ */
141
+ config?: string | CSpellConfigFile;
142
+ }
143
+ interface TraceOptions extends BaseOptions {
144
+ /**
145
+ * Use stdin for the input.
146
+ */
147
+ stdin?: boolean;
148
+ /**
149
+ * Enable the `allowCompoundWords` option.
150
+ */
151
+ allowCompoundWords?: boolean;
152
+ /**
153
+ * Ignore case and accents when searching for words.
154
+ */
155
+ ignoreCase?: boolean;
156
+ /**
157
+ * Show all dictionaries, not just the ones that contain the words or are enabled.
158
+ */
159
+ all?: boolean;
160
+ /**
161
+ * Show only dictionaries that contain the words.
162
+ * If `all` is set, this option is ignored.
163
+ */
164
+ onlyFound?: boolean;
165
+ /**
166
+ * Names of dictionaries to use.
167
+ */
168
+ dictionary?: string[] | undefined;
169
+ /**
170
+ * Configure how to display the dictionary path.
171
+ */
172
+ dictionaryPath?: "hide" | "long" | "short" | "full";
173
+ }
174
+ interface SuggestionOptions extends BaseOptions {
175
+ /**
176
+ * Strict case and accent checking
177
+ * @default true
178
+ */
179
+ strict?: boolean;
180
+ /**
181
+ * List of dictionaries to use. If specified, only that list of dictionaries will be used.
182
+ */
183
+ dictionaries?: string[] | undefined;
184
+ /**
185
+ * The number of suggestions to make.
186
+ * @default 8
187
+ */
188
+ numSuggestions?: number;
189
+ /**
190
+ * Max number of changes / edits to the word to get to a suggestion matching suggestion.
191
+ * @default 4
192
+ */
193
+ numChanges?: number;
194
+ /**
195
+ * If multiple suggestions have the same edit / change "cost", then included them even if
196
+ * it causes more than `numSuggestions` to be returned.
197
+ * @default true
198
+ */
199
+ includeTies?: boolean;
200
+ /**
201
+ * Use stdin for the input
202
+ */
203
+ useStdin?: boolean | undefined;
204
+ /**
205
+ * Use REPL interface for making suggestions.
206
+ */
207
+ repl?: boolean;
208
+ }
209
+ interface DictionariesOptions {
210
+ /**
211
+ * Path to configuration file.
212
+ */
213
+ config?: string;
214
+ /**
215
+ * Load the default configuration
216
+ * @default true
217
+ */
218
+ defaultConfiguration?: boolean;
219
+ /**
220
+ * Use color in the output.
221
+ * `true` to force color, `false` to turn off color.
222
+ * `undefined` to use color if the output is a TTY.
223
+ */
224
+ color?: boolean | undefined;
225
+ /**
226
+ * Show enabled:
227
+ * - `true` to show only enabled dictionaries.
228
+ * - `false` to show only disabled dictionaries.
229
+ * - `undefined` to show all dictionaries.
230
+ */
231
+ enabled?: boolean | undefined;
232
+ /**
233
+ * The locale to use when listing dictionaries.
234
+ */
235
+ locale?: string;
236
+ /**
237
+ * The file type to use when listing dictionaries.
238
+ */
239
+ fileType?: string;
240
+ /**
241
+ * show the language locales supported by the dictionary.
242
+ */
243
+ showLocales?: boolean;
244
+ /**
245
+ * show the file types supported by the dictionary.
246
+ */
247
+ showFileTypes?: boolean;
248
+ /**
249
+ * Dhow the location of the dictionary.
250
+ */
251
+ showLocation?: boolean;
252
+ pathFormat?: "hide" | "short" | "long" | "full";
253
+ }
254
+ interface LegacyOptions {
255
+ local?: string;
256
+ }
257
+ interface BaseOptions {
258
+ /**
259
+ * Path to configuration file.
260
+ */
261
+ config?: string;
262
+ /**
263
+ * Programming Language ID.
264
+ */
265
+ languageId?: string;
266
+ /**
267
+ * Locale to use.
268
+ */
269
+ locale?: string;
270
+ /**
271
+ * Load the default configuration
272
+ * @default true
273
+ */
274
+ defaultConfiguration?: boolean;
275
+ /**
276
+ * Check In-Document CSpell directives for correctness.
277
+ */
278
+ validateDirectives?: boolean;
279
+ /**
280
+ * Return an exit code if there are issues found.
281
+ * @default true
282
+ */
283
+ exitCode?: boolean;
284
+ /**
285
+ * Execution flags.
286
+ * Used primarily for releasing experimental features.
287
+ * Flags are of the form key:value
288
+ */
289
+ flag?: string[];
290
+ /**
291
+ * Use color in the output.
292
+ * `true` to force color, `false` to turn off color.
293
+ * `undefined` to use color if the output is a TTY.
294
+ */
295
+ color?: boolean | undefined;
296
+ }
297
+ interface LinterCliOptions extends LinterOptions {
298
+ /**
299
+ * Show legacy output
300
+ */
301
+ legacy?: boolean;
302
+ /**
303
+ * Show summary at the end
304
+ */
305
+ summary?: boolean;
306
+ /**
307
+ * Show issues
308
+ */
309
+ issues?: boolean;
310
+ /**
311
+ * Run in silent mode.
312
+ * @default false
313
+ */
314
+ silent?: boolean;
315
+ /**
316
+ * Show progress
317
+ */
318
+ progress?: boolean;
319
+ /**
320
+ * issues are shown with a relative path to the root or `cwd`
321
+ */
322
+ relative?: boolean;
323
+ /**
324
+ * Files must be found or cli will exit with an error.
325
+ */
326
+ mustFindFiles?: boolean;
327
+ /**
328
+ * Generate a summary report of issues.
329
+ */
330
+ issuesSummaryReport?: boolean;
331
+ /**
332
+ * Generate a summary report of performance.
333
+ */
334
+ showPerfSummary?: boolean;
335
+ /**
336
+ * Set the template to use when reporting issues.
337
+ *
338
+ * The template is a string that can contain the following placeholders:
339
+ * - `$filename` - the file name
340
+ * - `$col` - the column number
341
+ * - `$row` - the row number
342
+ * - `$text` - the word that is misspelled
343
+ * - `$message` - the issues message: "unknown word", "word is misspelled", etc.
344
+ * - `$messageColored` - the issues message with color based upon the message type.
345
+ * - `$uri` - the URI of the file
346
+ * - `$suggestions` - suggestions for the misspelled word (if requested)
347
+ * - `$quickFix` - possible quick fixes for the misspelled word.
348
+ * - `$contextFull` - the full context of the misspelled word.
349
+ * - `$contextLeft` - the context to the left of the misspelled word.
350
+ * - `$contextRight` - the context to the right of the misspelled word.
351
+ *
352
+ * Color is supported using the following template pattern:
353
+ * - `{<style[.style]> <text>}` - where `<style>` is a style name and `<text>` is the text to style.
354
+ *
355
+ * Styles
356
+ * - `bold`, `italic`, `underline`, `strikethrough`, `dim`, `inverse`
357
+ * - `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
358
+ *
359
+ * Example:
360
+ * @example "{green $filename}:{yellow $row}:{yellow $col} $message {red $text} $quickFix {dim $suggestions}"
361
+ * @since 8.12.0
362
+ */
363
+ issueTemplate?: string;
364
+ /**
365
+ * Prevents searching for local configuration files
366
+ *
367
+ * When `--no-config-search` is passed on the command line, this will be `true`.
368
+ * If the flag is not passed, it defaults to `false`.
369
+ */
370
+ configSearch?: boolean;
371
+ /**
372
+ * Directory paths at which CSpell should stop searching for configuration files.
373
+ *
374
+ * These are set via one or more `--stop-config-search-at <dir>` CLI options.
375
+ * If no flags are passed, this will be `undefined`.
376
+ */
377
+ stopConfigSearchAt?: string[];
378
+ report?: ReportChoices | undefined;
379
+ }
380
+ type ReportChoices = "all" | "simple" | "typos" | "flagged";
381
+ interface CSpellConfigFile {
382
+ url: URL;
383
+ settings: CSpellSettings;
384
+ }
385
+ //#endregion
386
+ export { BaseOptions, DictionariesOptions, LegacyOptions, LinterCliOptions, SuggestionOptions, TraceOptions };
387
+ //# sourceMappingURL=options-ChaXtdFn.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "9.1.3",
3
+ "version": "9.2.0",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "bin": {
@@ -9,14 +9,14 @@
9
9
  },
10
10
  "type": "module",
11
11
  "sideEffects": false,
12
- "types": "dist/esm/index.d.mts",
13
- "module": "dist/esm/index.mjs",
12
+ "types": "dist/esm/index.d.ts",
13
+ "module": "dist/esm/index.js",
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./dist/esm/index.mjs"
16
+ "import": "./dist/esm/index.js"
17
17
  },
18
18
  "./app": {
19
- "import": "./dist/esm/app.mjs"
19
+ "import": "./dist/esm/app.js"
20
20
  },
21
21
  "./bin": {
22
22
  "import": "./bin.mjs"
@@ -25,24 +25,26 @@
25
25
  "import": "./bin.mjs"
26
26
  },
27
27
  "./application": {
28
- "import": "./dist/esm/application.mjs"
28
+ "import": "./dist/esm/application.js"
29
29
  }
30
30
  },
31
31
  "files": [
32
32
  "bin.mjs",
33
33
  "dist",
34
- "!**/*.tsbuildInfo",
35
34
  "!**/__mocks__",
36
- "!**/test/**",
37
- "!**/*.test.*",
35
+ "!**/*.map",
36
+ "!**/*.perf.*",
38
37
  "!**/*.spec.*",
39
- "!**/*.map"
38
+ "!**/*.test.*",
39
+ "!**/*.tsbuildInfo",
40
+ "!**/perf/**",
41
+ "!**/test/**",
42
+ "!dist/tsc"
40
43
  ],
41
44
  "scripts": {
42
45
  "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
43
- "build": "tsc -p . && pnpm run build:api",
44
- "build:api": "rollup -c rollup.config.mjs",
45
- "build:esm": "tsc -p .",
46
+ "build": "tsdown && pnpm build:tsc",
47
+ "build:tsc": "tsc -p .",
46
48
  "build:readme": "pnpm build:readme:help",
47
49
  "build:readme:help": "pnpm build:readme:help:lint && pnpm build:readme:help:trace && inject-markdown README.md && prettier -w README.md",
48
50
  "build:readme:help:lint": "./bin.mjs lint --help > static/help-lint.txt",
@@ -81,22 +83,22 @@
81
83
  },
82
84
  "homepage": "https://cspell.org/",
83
85
  "dependencies": {
84
- "@cspell/cspell-json-reporter": "9.1.3",
85
- "@cspell/cspell-pipe": "9.1.3",
86
- "@cspell/cspell-types": "9.1.3",
87
- "@cspell/dynamic-import": "9.1.3",
88
- "@cspell/url": "9.1.3",
86
+ "@cspell/cspell-json-reporter": "9.2.0",
87
+ "@cspell/cspell-pipe": "9.2.0",
88
+ "@cspell/cspell-types": "9.2.0",
89
+ "@cspell/dynamic-import": "9.2.0",
90
+ "@cspell/url": "9.2.0",
89
91
  "chalk": "^5.4.1",
90
92
  "chalk-template": "^1.1.0",
91
93
  "commander": "^14.0.0",
92
- "cspell-config-lib": "9.1.3",
93
- "cspell-dictionary": "9.1.3",
94
- "cspell-gitignore": "9.1.3",
95
- "cspell-glob": "9.1.3",
96
- "cspell-io": "9.1.3",
97
- "cspell-lib": "9.1.3",
94
+ "cspell-config-lib": "9.2.0",
95
+ "cspell-dictionary": "9.2.0",
96
+ "cspell-gitignore": "9.2.0",
97
+ "cspell-glob": "9.2.0",
98
+ "cspell-io": "9.2.0",
99
+ "cspell-lib": "9.2.0",
98
100
  "fast-json-stable-stringify": "^2.1.0",
99
- "file-entry-cache": "^9.1.0",
101
+ "flatted": "^3.3.3",
100
102
  "semver": "^7.7.2",
101
103
  "tinyglobby": "^0.2.14"
102
104
  },
@@ -104,12 +106,11 @@
104
106
  "node": ">=20"
105
107
  },
106
108
  "devDependencies": {
107
- "@types/file-entry-cache": "^5.0.4",
108
109
  "@types/glob": "^8.1.0",
109
110
  "@types/micromatch": "^4.0.9",
110
111
  "@types/semver": "^7.7.0",
111
112
  "micromatch": "^4.0.8",
112
113
  "minimatch": "^9.0.5"
113
114
  },
114
- "gitHead": "cfa9ab3d0b5dc82afc488a6bf86a23e3a2afc077"
115
+ "gitHead": "6004e6a19e11985bc61e6578846195be07365049"
115
116
  }
@@ -1,5 +0,0 @@
1
- import type { Command } from 'commander';
2
- export { LinterCliOptions as Options } from './options.js';
3
- export { ApplicationError, CheckFailed } from './util/errors.js';
4
- export declare function run(command?: Command, argv?: string[]): Promise<void>;
5
- //# sourceMappingURL=app.d.mts.map
package/dist/esm/app.mjs DELETED
@@ -1,34 +0,0 @@
1
- import { Option as CommanderOption, program } from 'commander';
2
- import { satisfies as semverSatisfies } from 'semver';
3
- import { commandCheck } from './commandCheck.js';
4
- import { commandDictionaries } from './commandDictionaries.js';
5
- import { commandInit } from './commandInit.js';
6
- import { commandLink } from './commandLink.js';
7
- import { commandLint } from './commandLint.js';
8
- import { commandSuggestion } from './commandSuggestion.js';
9
- import { commandTrace } from './commandTrace.js';
10
- import { npmPackage } from './pkgInfo.js';
11
- import { ApplicationError } from './util/errors.js';
12
- export { ApplicationError, CheckFailed } from './util/errors.js';
13
- export async function run(command, argv) {
14
- const prog = command || program;
15
- const args = argv || process.argv;
16
- prog.exitOverride();
17
- prog.version(npmPackage.version).description('Spelling Checker for Code').name('cspell');
18
- if (!semverSatisfies(process.versions.node, npmPackage.engines.node)) {
19
- throw new ApplicationError(`Unsupported NodeJS version (${process.versions.node}); ${npmPackage.engines.node} is required`);
20
- }
21
- const optionFlags = new CommanderOption('-f,--flag <flag:value>', 'Declare an execution flag value')
22
- .hideHelp()
23
- .argParser((value, prev) => prev?.concat(value) || [value]);
24
- commandLint(prog).addOption(optionFlags);
25
- commandTrace(prog).addOption(optionFlags);
26
- commandCheck(prog).addOption(optionFlags);
27
- commandSuggestion(prog).addOption(optionFlags);
28
- commandInit(prog).addOption(optionFlags);
29
- commandLink(prog);
30
- commandDictionaries(prog);
31
- prog.exitOverride();
32
- await prog.parseAsync(args);
33
- }
34
- //# sourceMappingURL=app.mjs.map
@@ -1,17 +0,0 @@
1
- import type { CSpellReporter, RunResult } from '@cspell/cspell-types';
2
- import type { CheckTextInfo, FeatureFlags, TraceWordResult } from 'cspell-lib';
3
- import { type InitOptions } from './config/index.js';
4
- import type { TimedSuggestionsForWordResult } from './emitters/suggestionsEmitter.js';
5
- import type { BaseOptions, LegacyOptions, LinterCliOptions, SuggestionOptions, TraceOptions } from './options.js';
6
- export { listDictionaries } from './dictionaries/index.js';
7
- export type { TraceResult } from 'cspell-lib';
8
- export { IncludeExcludeFlag } from 'cspell-lib';
9
- export type AppError = NodeJS.ErrnoException;
10
- export declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
11
- export declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
12
- export type CheckTextResult = CheckTextInfo;
13
- export declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
14
- export declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
15
- export declare function createInit(options: InitOptions): Promise<void>;
16
- export declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
17
- //# sourceMappingURL=application.d.mts.map