cspell 9.1.3 → 9.1.5
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.
- package/README.md +29 -21
- package/bin.mjs +1 -1
- package/dist/esm/app.d.ts +19 -0
- package/dist/esm/app.js +1033 -0
- package/dist/esm/application-D-NwS6qb.js +2573 -0
- package/dist/esm/application-DbOQYm56.d.ts +116 -0
- package/dist/esm/application.d.ts +3 -0
- package/dist/esm/application.js +3 -0
- package/dist/esm/index.d.ts +55 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/options-ChaXtdFn.d.ts +387 -0
- package/package.json +27 -25
- package/dist/esm/app.d.mts +0 -5
- package/dist/esm/app.mjs +0 -34
- package/dist/esm/application.d.mts +0 -17
- package/dist/esm/application.mjs +0 -99
- package/dist/esm/cli-reporter.d.ts +0 -38
- package/dist/esm/cli-reporter.js +0 -386
- package/dist/esm/commandCheck.d.ts +0 -3
- package/dist/esm/commandCheck.js +0 -52
- package/dist/esm/commandConfig.d.ts +0 -3
- package/dist/esm/commandConfig.js +0 -18
- package/dist/esm/commandDictionaries.d.ts +0 -3
- package/dist/esm/commandDictionaries.js +0 -40
- package/dist/esm/commandHelpers.d.ts +0 -18
- package/dist/esm/commandHelpers.js +0 -30
- package/dist/esm/commandInit.d.ts +0 -3
- package/dist/esm/commandInit.js +0 -25
- package/dist/esm/commandLink.d.ts +0 -3
- package/dist/esm/commandLink.js +0 -48
- package/dist/esm/commandLint.d.ts +0 -3
- package/dist/esm/commandLint.js +0 -226
- package/dist/esm/commandSuggestion.d.ts +0 -3
- package/dist/esm/commandSuggestion.js +0 -61
- package/dist/esm/commandTrace.d.ts +0 -3
- package/dist/esm/commandTrace.js +0 -91
- package/dist/esm/config/adjustConfig.d.ts +0 -7
- package/dist/esm/config/adjustConfig.js +0 -137
- package/dist/esm/config/config.d.ts +0 -5
- package/dist/esm/config/config.js +0 -18
- package/dist/esm/config/configInit.d.ts +0 -3
- package/dist/esm/config/configInit.js +0 -104
- package/dist/esm/config/constants.d.ts +0 -17
- package/dist/esm/config/constants.js +0 -23
- package/dist/esm/config/index.d.ts +0 -3
- package/dist/esm/config/index.js +0 -2
- package/dist/esm/config/options.d.ts +0 -62
- package/dist/esm/config/options.js +0 -2
- package/dist/esm/config/updateConfig.d.ts +0 -3
- package/dist/esm/config/updateConfig.js +0 -2
- package/dist/esm/console.d.ts +0 -25
- package/dist/esm/console.js +0 -53
- package/dist/esm/dictionaries/index.d.ts +0 -3
- package/dist/esm/dictionaries/index.js +0 -2
- package/dist/esm/dictionaries/listDictionaries.d.ts +0 -33
- package/dist/esm/dictionaries/listDictionaries.js +0 -131
- package/dist/esm/dirname.d.ts +0 -2
- package/dist/esm/dirname.js +0 -13
- package/dist/esm/emitters/DictionaryPathFormat.d.ts +0 -3
- package/dist/esm/emitters/DictionaryPathFormat.js +0 -12
- package/dist/esm/emitters/dictionaryListEmitter.d.ts +0 -19
- package/dist/esm/emitters/dictionaryListEmitter.js +0 -82
- package/dist/esm/emitters/helpers.d.ts +0 -14
- package/dist/esm/emitters/helpers.js +0 -67
- package/dist/esm/emitters/suggestionsEmitter.d.ts +0 -13
- package/dist/esm/emitters/suggestionsEmitter.js +0 -79
- package/dist/esm/emitters/traceEmitter.d.ts +0 -19
- package/dist/esm/emitters/traceEmitter.js +0 -87
- package/dist/esm/environment.d.ts +0 -39
- package/dist/esm/environment.js +0 -30
- package/dist/esm/featureFlags/featureFlags.d.ts +0 -4
- package/dist/esm/featureFlags/featureFlags.js +0 -21
- package/dist/esm/featureFlags/index.d.ts +0 -2
- package/dist/esm/featureFlags/index.js +0 -2
- package/dist/esm/index.d.mts +0 -6
- package/dist/esm/index.mjs +0 -4
- package/dist/esm/link.d.ts +0 -8
- package/dist/esm/link.js +0 -39
- package/dist/esm/lint/LintRequest.d.ts +0 -26
- package/dist/esm/lint/LintRequest.js +0 -83
- package/dist/esm/lint/index.d.ts +0 -3
- package/dist/esm/lint/index.js +0 -3
- package/dist/esm/lint/lint.d.ts +0 -8
- package/dist/esm/lint/lint.js +0 -515
- package/dist/esm/models.d.ts +0 -15
- package/dist/esm/models.js +0 -2
- package/dist/esm/options.d.ts +0 -353
- package/dist/esm/options.js +0 -9
- package/dist/esm/pkgInfo.d.ts +0 -14
- package/dist/esm/pkgInfo.js +0 -7
- package/dist/esm/repl/index.d.ts +0 -18
- package/dist/esm/repl/index.js +0 -52
- package/dist/esm/util/InMemoryReporter.d.ts +0 -31
- package/dist/esm/util/InMemoryReporter.js +0 -49
- package/dist/esm/util/LintFileResult.d.ts +0 -14
- package/dist/esm/util/LintFileResult.js +0 -2
- package/dist/esm/util/async.d.ts +0 -3
- package/dist/esm/util/async.js +0 -4
- package/dist/esm/util/cache/CSpellLintResultCache.d.ts +0 -20
- package/dist/esm/util/cache/CSpellLintResultCache.js +0 -2
- package/dist/esm/util/cache/CacheOptions.d.ts +0 -34
- package/dist/esm/util/cache/CacheOptions.js +0 -2
- package/dist/esm/util/cache/DiskCache.d.ts +0 -63
- package/dist/esm/util/cache/DiskCache.js +0 -214
- package/dist/esm/util/cache/DummyCache.d.ts +0 -11
- package/dist/esm/util/cache/DummyCache.js +0 -18
- package/dist/esm/util/cache/ObjectCollection.d.ts +0 -17
- package/dist/esm/util/cache/ObjectCollection.js +0 -127
- package/dist/esm/util/cache/createCache.d.ts +0 -31
- package/dist/esm/util/cache/createCache.js +0 -69
- package/dist/esm/util/cache/file-entry-cache.d.mts +0 -4
- package/dist/esm/util/cache/file-entry-cache.mjs +0 -5
- package/dist/esm/util/cache/fileEntryCache.d.ts +0 -9
- package/dist/esm/util/cache/fileEntryCache.js +0 -79
- package/dist/esm/util/cache/index.d.ts +0 -4
- package/dist/esm/util/cache/index.js +0 -2
- package/dist/esm/util/canUseColor.d.ts +0 -2
- package/dist/esm/util/canUseColor.js +0 -10
- package/dist/esm/util/configFileHelper.d.ts +0 -15
- package/dist/esm/util/configFileHelper.js +0 -43
- package/dist/esm/util/constants.d.ts +0 -6
- package/dist/esm/util/constants.js +0 -6
- package/dist/esm/util/errors.d.ts +0 -24
- package/dist/esm/util/errors.js +0 -60
- package/dist/esm/util/extractContext.d.ts +0 -5
- package/dist/esm/util/extractContext.js +0 -75
- package/dist/esm/util/fileHelper.d.ts +0 -44
- package/dist/esm/util/fileHelper.js +0 -165
- package/dist/esm/util/glob.d.ts +0 -45
- package/dist/esm/util/glob.js +0 -147
- package/dist/esm/util/pad.d.ts +0 -45
- package/dist/esm/util/pad.js +0 -191
- package/dist/esm/util/prefetch.d.ts +0 -2
- package/dist/esm/util/prefetch.js +0 -15
- package/dist/esm/util/reporters.d.ts +0 -30
- package/dist/esm/util/reporters.js +0 -209
- package/dist/esm/util/stdin.d.ts +0 -2
- package/dist/esm/util/stdin.js +0 -5
- package/dist/esm/util/stdinUrl.d.ts +0 -9
- package/dist/esm/util/stdinUrl.js +0 -26
- package/dist/esm/util/table.d.ts +0 -41
- package/dist/esm/util/table.js +0 -115
- package/dist/esm/util/timer.d.ts +0 -4
- package/dist/esm/util/timer.js +0 -9
- package/dist/esm/util/types.d.ts +0 -7
- package/dist/esm/util/types.js +0 -5
- package/dist/esm/util/unindent.d.ts +0 -14
- package/dist/esm/util/unindent.js +0 -55
- package/dist/esm/util/util.d.ts +0 -14
- package/dist/esm/util/util.js +0 -30
- package/dist/esm/util/writeFile.d.ts +0 -3
- package/dist/esm/util/writeFile.js +0 -30
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { BaseOptions, DictionariesOptions, LegacyOptions, LinterCliOptions, SuggestionOptions, TraceOptions } from "./options-ChaXtdFn.js";
|
|
2
|
+
import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib";
|
|
3
|
+
import { CSpellReporter, RunResult } from "@cspell/cspell-types";
|
|
4
|
+
|
|
5
|
+
//#region src/config/options.d.ts
|
|
6
|
+
interface BaseConfigOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The path to the configuration file to create / update.
|
|
9
|
+
* If not provided, a default file name will be used based on the format.
|
|
10
|
+
*/
|
|
11
|
+
config?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The list of configuration files or dictionary packages to import.
|
|
14
|
+
* This can be a list of file paths, package names, or URLs.
|
|
15
|
+
*/
|
|
16
|
+
import?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* The locale to use when spell checking (e.g., en, en-US, de).
|
|
19
|
+
*/
|
|
20
|
+
locale?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to add comments to the configuration file.
|
|
23
|
+
* - `true` - comments will be added to the configuration file.
|
|
24
|
+
* - `false` - no comments will be added.
|
|
25
|
+
* - `undefined` - the default behavior will be used based on the format.
|
|
26
|
+
*/
|
|
27
|
+
comments?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to remove all comments from the configuration file.
|
|
30
|
+
* - `true` - all comments will be removed.
|
|
31
|
+
* - `false` | `undefined` - no comments will be removed.
|
|
32
|
+
* @implies `comments: false`
|
|
33
|
+
*/
|
|
34
|
+
removeComments?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to add the schema reference to the configuration file.
|
|
37
|
+
* - `true` - the schema reference will be added / updated.
|
|
38
|
+
* - `false` - no schema reference will be added.
|
|
39
|
+
*/
|
|
40
|
+
schema?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The list of dictionaries to enable in the configuration file.
|
|
43
|
+
* These are added to an existing configuration file or a new one.
|
|
44
|
+
* Existing dictionaries will not be removed.
|
|
45
|
+
*/
|
|
46
|
+
dictionary?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Whether to write the configuration to stdout instead of a file.
|
|
49
|
+
*/
|
|
50
|
+
stdout?: boolean;
|
|
51
|
+
}
|
|
52
|
+
interface InitOptions extends BaseConfigOptions {
|
|
53
|
+
/**
|
|
54
|
+
* The path where the configuration file will be written, it can be a file path or a URL.
|
|
55
|
+
* If not provided, a default file name will be used based on the format.
|
|
56
|
+
* The default will be `cspell.config.yaml` or `cspell.json` based on the format.
|
|
57
|
+
* @conflicts `config` - If `config` is provided, it will be used instead of `output`.
|
|
58
|
+
*/
|
|
59
|
+
output?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The format of the configuration file.
|
|
62
|
+
* @conflicts `config` - If `config` is provided, the format will be inferred from the file extension.
|
|
63
|
+
*/
|
|
64
|
+
format?: "yaml" | "yml" | "json" | "jsonc";
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/emitters/suggestionsEmitter.d.ts
|
|
68
|
+
interface TimedSuggestionsForWordResult extends SuggestionsForWordResult {
|
|
69
|
+
elapsedTimeMs?: number;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/dictionaries/listDictionaries.d.ts
|
|
73
|
+
interface ListDictionariesResult {
|
|
74
|
+
/**
|
|
75
|
+
* The name of the dictionary.
|
|
76
|
+
*/
|
|
77
|
+
name: string;
|
|
78
|
+
/**
|
|
79
|
+
* The description of the dictionary.
|
|
80
|
+
*/
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* The path to the dictionary file.
|
|
84
|
+
*/
|
|
85
|
+
path?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* True if the dictionary is enabled.
|
|
88
|
+
*/
|
|
89
|
+
enabled: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The inline dictionaries supported by the dictionary.
|
|
92
|
+
*/
|
|
93
|
+
inline?: string[] | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* the languages locales supported by the dictionary.
|
|
96
|
+
*/
|
|
97
|
+
locales?: string[] | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* The file types supported by the dictionary.
|
|
100
|
+
*/
|
|
101
|
+
fileTypes?: string[] | undefined;
|
|
102
|
+
}
|
|
103
|
+
declare function listDictionaries(options: DictionariesOptions): Promise<ListDictionariesResult[]>;
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/application.d.mts
|
|
106
|
+
type AppError = NodeJS.ErrnoException;
|
|
107
|
+
declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
|
|
108
|
+
declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
|
|
109
|
+
type CheckTextResult = CheckTextInfo;
|
|
110
|
+
declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
|
|
111
|
+
declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
|
|
112
|
+
declare function createInit(options: InitOptions): Promise<void>;
|
|
113
|
+
declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
|
|
114
|
+
//#endregion
|
|
115
|
+
export { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
|
|
116
|
+
//# sourceMappingURL=application-DbOQYm56.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "./options-ChaXtdFn.js";
|
|
2
|
+
import { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace } from "./application-DbOQYm56.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-D-NwS6qb.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-DbOQYm56.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, BaseOptions, LinterCliOptions as CSpellApplicationOptions, CSpellReporterConfiguration, CSpellReporterModule, CheckTextResult, IncludeExcludeFlag, 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-D-NwS6qb.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
|
+
"version": "9.1.5",
|
|
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.
|
|
13
|
-
"module": "dist/esm/index.
|
|
12
|
+
"types": "dist/esm/index.d.ts",
|
|
13
|
+
"module": "dist/esm/index.js",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"import": "./dist/esm/index.
|
|
16
|
+
"import": "./dist/esm/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./app": {
|
|
19
|
-
"import": "./dist/esm/app.
|
|
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.
|
|
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
|
-
"
|
|
37
|
-
"!**/*.
|
|
35
|
+
"!**/*.map",
|
|
36
|
+
"!**/*.perf.*",
|
|
38
37
|
"!**/*.spec.*",
|
|
39
|
-
"!**/*.
|
|
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": "
|
|
44
|
-
"build:
|
|
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,20 +83,20 @@
|
|
|
81
83
|
},
|
|
82
84
|
"homepage": "https://cspell.org/",
|
|
83
85
|
"dependencies": {
|
|
84
|
-
"@cspell/cspell-json-reporter": "9.1.
|
|
85
|
-
"@cspell/cspell-pipe": "9.1.
|
|
86
|
-
"@cspell/cspell-types": "9.1.
|
|
87
|
-
"@cspell/dynamic-import": "9.1.
|
|
88
|
-
"@cspell/url": "9.1.
|
|
86
|
+
"@cspell/cspell-json-reporter": "9.1.5",
|
|
87
|
+
"@cspell/cspell-pipe": "9.1.5",
|
|
88
|
+
"@cspell/cspell-types": "9.1.5",
|
|
89
|
+
"@cspell/dynamic-import": "9.1.5",
|
|
90
|
+
"@cspell/url": "9.1.5",
|
|
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.
|
|
93
|
-
"cspell-dictionary": "9.1.
|
|
94
|
-
"cspell-gitignore": "9.1.
|
|
95
|
-
"cspell-glob": "9.1.
|
|
96
|
-
"cspell-io": "9.1.
|
|
97
|
-
"cspell-lib": "9.1.
|
|
94
|
+
"cspell-config-lib": "9.1.5",
|
|
95
|
+
"cspell-dictionary": "9.1.5",
|
|
96
|
+
"cspell-gitignore": "9.1.5",
|
|
97
|
+
"cspell-glob": "9.1.5",
|
|
98
|
+
"cspell-io": "9.1.5",
|
|
99
|
+
"cspell-lib": "9.1.5",
|
|
98
100
|
"fast-json-stable-stringify": "^2.1.0",
|
|
99
101
|
"file-entry-cache": "^9.1.0",
|
|
100
102
|
"semver": "^7.7.2",
|
|
@@ -111,5 +113,5 @@
|
|
|
111
113
|
"micromatch": "^4.0.8",
|
|
112
114
|
"minimatch": "^9.0.5"
|
|
113
115
|
},
|
|
114
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "6303813cb5da37e88b3ccab7ce5bcf09373f5cf2"
|
|
115
117
|
}
|
package/dist/esm/app.d.mts
DELETED
|
@@ -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
|