cspell 10.1.1 → 10.2.0-alpha.1
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 +2 -0
- package/bin.mjs +1 -1
- package/dist/esm/app.d.ts +1 -1
- package/dist/esm/app.js +5 -3
- package/dist/esm/{application-BeYqH0KN.d.ts → application-094uTsvC.d.ts} +2 -2
- package/dist/esm/{application-BcBLKy3U.js → application-BIFVUM_N.js} +67 -18
- package/dist/esm/application.d.ts +1 -1
- package/dist/esm/application.js +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/{options-CG62AIq-.d.ts → options-DlXe327y.d.ts} +8 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -165,6 +165,8 @@ Options:
|
|
|
165
165
|
line.
|
|
166
166
|
--file [file...] Specify files to spell check. They are filtered
|
|
167
167
|
by the [globs...].
|
|
168
|
+
--force-check Force the --file or --file-list documents to be
|
|
169
|
+
checked even if it would normally be excluded.
|
|
168
170
|
--no-issues Do not show the spelling errors.
|
|
169
171
|
--no-progress Turn off progress messages
|
|
170
172
|
--no-summary Turn off summary message in console.
|
package/bin.mjs
CHANGED
|
@@ -13,7 +13,7 @@ run(program, process.argv).catch((e) => {
|
|
|
13
13
|
// It is possible an explicit exit code was set, use it if it was.
|
|
14
14
|
process.exitCode = process.exitCode || 1;
|
|
15
15
|
}
|
|
16
|
-
if (e instanceof CheckFailed) {
|
|
16
|
+
if (e instanceof CheckFailed || e instanceof CommanderError) {
|
|
17
17
|
process.exitCode = e.exitCode;
|
|
18
18
|
}
|
|
19
19
|
});
|
package/dist/esm/app.d.ts
CHANGED
package/dist/esm/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ApplicationError, S as width, T as console, _ as padLeft, a as parseApplicationFeatureFlags, b as pruneAnsiTextEnd, c as listDictionaries, d as validateUnitSize, f as unindent, g as tableToLines, i as lint, l as ReportChoicesAll, m as npmPackage, n as checkText, o as suggestions, p as DEFAULT_CACHE_LOCATION, r as createInit, s as trace, t as IncludeExcludeFlag, u as cvtLinterCliCommandOptionsToLinterCliOptions, v as padWidth, w as CheckFailed, x as pruneAnsiTextStart, y as ansiWidth } from "./application-
|
|
1
|
+
import { C as ApplicationError, S as width, T as console, _ as padLeft, a as parseApplicationFeatureFlags, b as pruneAnsiTextEnd, c as listDictionaries, d as validateUnitSize, f as unindent, g as tableToLines, i as lint, l as ReportChoicesAll, m as npmPackage, n as checkText, o as suggestions, p as DEFAULT_CACHE_LOCATION, r as createInit, s as trace, t as IncludeExcludeFlag, u as cvtLinterCliCommandOptionsToLinterCliOptions, v as padWidth, w as CheckFailed, x as pruneAnsiTextStart, y as ansiWidth } from "./application-BIFVUM_N.js";
|
|
2
2
|
import { Link } from "cspell-lib";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import * as iPath from "node:path";
|
|
@@ -357,7 +357,7 @@ References:
|
|
|
357
357
|
`;
|
|
358
358
|
function commandLint(prog, opts) {
|
|
359
359
|
const spellCheckCommand = prog.command("lint", opts);
|
|
360
|
-
spellCheckCommand.description("Check spelling").option("-c, --config <cspell.json>", "Configuration file to use. By default cspell looks for cspell.json in the current directory.").addOption(crOpt("--config-search", "Allow searching for configuration files.", void 0).hideHelp()).option("--no-config-search", "Disable automatic searching for additional configuration files in parent directories. Only the specified config file (if any) will be used.").option("--stop-config-search-at <dir>", "Specify a directory at which to stop searching for configuration files when walking up from the files being checked. Useful for limiting config inheritance.", collect$1).option("-v, --verbose", "Display more information about the files being checked. Add more than one -v for increased verbosity.", increaseVerbosity, 0).option("--locale <locale>", "Set language locales. i.e. \"en,fr\" for English and French, or \"en-GB\" for British English.").option("--language-id <file-type>", "Force programming language for unknown extensions. i.e. \"php\" or \"scala\"").addOption(crOpt("--languageId <file-type>", "Alias of \"--language-id\". Force programming language for unknown extensions. i.e. \"php\" or \"scala\"").hideHelp()).option("--words-only", "Only output the words not found in the dictionaries.").addOption(crOpt("--wordsOnly", "Only output the words not found in the dictionaries.").hideHelp()).option("-u, --unique", "Only output the first instance of a word not found in the dictionaries.").option("-e, --exclude <glob>", "Exclude files matching the glob pattern. This option can be used multiple times to add multiple globs. ", collect$1).option("--file-list <path or stdin>", "Specify a list of files to be spell checked. The list is filtered against the glob file patterns. Note: the format is 1 file path per line.", collect$1).option("--file [file...]", "Specify files to spell check. They are filtered by the [globs...].", collect$1).addOption(crOpt("--files [file...]", "Alias of \"--file\". Files to spell check.", collect$1).hideHelp()).option("--no-issues", "Do not show the spelling errors.").option("--no-progress", "Turn off progress messages").option("--no-summary", "Turn off summary message in console.").option("-s, --silent", "Silent mode, suppress error messages.").option("--no-exit-code", "Do not return an exit code if issues are found.").addOption(crOpt("--quiet", "Only show spelling issues or errors.").implies({
|
|
360
|
+
spellCheckCommand.description("Check spelling").option("-c, --config <cspell.json>", "Configuration file to use. By default cspell looks for cspell.json in the current directory.").addOption(crOpt("--config-search", "Allow searching for configuration files.", void 0).hideHelp()).option("--no-config-search", "Disable automatic searching for additional configuration files in parent directories. Only the specified config file (if any) will be used.").option("--stop-config-search-at <dir>", "Specify a directory at which to stop searching for configuration files when walking up from the files being checked. Useful for limiting config inheritance.", collect$1).option("-v, --verbose", "Display more information about the files being checked. Add more than one -v for increased verbosity.", increaseVerbosity, 0).option("--locale <locale>", "Set language locales. i.e. \"en,fr\" for English and French, or \"en-GB\" for British English.").option("--language-id <file-type>", "Force programming language for unknown extensions. i.e. \"php\" or \"scala\"").addOption(crOpt("--languageId <file-type>", "Alias of \"--language-id\". Force programming language for unknown extensions. i.e. \"php\" or \"scala\"").hideHelp()).option("--words-only", "Only output the words not found in the dictionaries.").addOption(crOpt("--wordsOnly", "Only output the words not found in the dictionaries.").hideHelp()).option("-u, --unique", "Only output the first instance of a word not found in the dictionaries.").option("-e, --exclude <glob>", "Exclude files matching the glob pattern. This option can be used multiple times to add multiple globs. ", collect$1).option("--file-list <path or stdin>", "Specify a list of files to be spell checked. The list is filtered against the glob file patterns. Note: the format is 1 file path per line.", collect$1).option("--file [file...]", "Specify files to spell check. They are filtered by the [globs...].", collect$1).addOption(crOpt("--files [file...]", "Alias of \"--file\". Files to spell check.", collect$1).hideHelp()).option("--force-check", "Force the --file or --file-list documents to be checked even if it would normally be excluded.").option("--no-issues", "Do not show the spelling errors.").option("--no-progress", "Turn off progress messages").option("--no-summary", "Turn off summary message in console.").option("-s, --silent", "Silent mode, suppress error messages.").option("--no-exit-code", "Do not return an exit code if issues are found.").addOption(crOpt("--quiet", "Only show spelling issues or errors.").implies({
|
|
361
361
|
summary: false,
|
|
362
362
|
progress: false
|
|
363
363
|
})).option("--fail-fast", "Exit after first file with an issue or error.").addOption(crOpt("--no-fail-fast", "Process all files even if there is an error.").hideHelp()).option("--continue-on-error", "Continue processing files even if there is a configuration error.").option("-r, --root <root folder>", "Root directory, defaults to current directory.").addOption(crOpt("--relative", "Issues are displayed relative to the root.").default(true).hideHelp()).option("--no-relative", "Issues are displayed with absolute path instead of relative to the root.").option("--show-context", "Show the surrounding text around an issue.").option("--show-suggestions", "Show spelling suggestions.").addOption(crOpt("--no-show-suggestions", "Do not show spelling suggestions or fixes.").default(void 0)).addOption(crOpt("--must-find-files", "Error if no files are found.").default(true).hideHelp()).option("--no-must-find-files", "Do not error if no files are found.").addOption(crOpt("--legacy", "Legacy output").hideHelp()).addOption(crOpt("--local <local>", "Deprecated -- Use: --locale").hideHelp()).option("--cache", "Use cache to only check changed files.").option("--no-cache", "Do not use cache.").option("--cache-reset", "Reset the cache file.").addOption(crOpt("--cache-strategy <strategy>", "Strategy to use for detecting changed files.").choices(["content", "metadata"]).default("content")).option("--cache-location <path>", `Path to the cache file or directory. (default: "${DEFAULT_CACHE_LOCATION}")`).option("--dot", "Include files and directories starting with `.` (period) when matching globs.").option("--gitignore", "Ignore files matching glob patterns found in .gitignore files.").option("--no-gitignore", "Do NOT use .gitignore files.").option("--gitignore-root <path>", "Prevent searching for .gitignore files past root.", collect$1).option("--validate-directives", "Validate in-document CSpell directives.").addOption(crOpt("--no-validate-directives", "Do not validate in-document CSpell directives.").hideHelp()).option("--max-file-size <size>", "Prevent checking large files. i.e 1MB, 50KB, 1GB").addOption(crOpt("--color", "Force color.").default(void 0)).addOption(crOpt("--no-color", "Turn off color.").default(void 0)).addOption(crOpt("--default-configuration", "Load the default configuration and dictionaries.").hideHelp()).addOption(crOpt("--no-default-configuration", "Do not load the default configuration and dictionaries.")).option("--dictionary <name>", "Enable a dictionary by name.", collect$1).addOption(crOpt("--no-dictionary <name>", "Disable a dictionary by name. Can be used multiple times.", prefixCollect("!")).hideHelp()).option("--disable-dictionary <name>", "Disable a dictionary by name.", collect$1).option("--reporter <module|path>", "Specify one or more reporters to use.", collect$1).addOption(crOpt("--report <level>", "Set how unknown words are reported").choices(ReportChoicesAll)).addOption(crOpt("--skip-validation", "Collect and process documents, but do not spell check.").implies({ cache: false }).hideHelp()).addOption(crOpt("--issues-summary-report", "Output a summary of issues found.").hideHelp()).addOption(crOpt("--show-perf-summary", "Output a performance summary report.").hideHelp()).option("--issue-template [template]", "Use a custom issue template. See --help --issue-template for details.").addOption(crOpt("--debug", "Output information useful for debugging cspell.json files.").hideHelp()).usage(usage).addHelpText("after", augmentCommandHelp).arguments("[globs...]").action(action);
|
|
@@ -370,7 +370,9 @@ async function action(fileGlobs, cliOptions) {
|
|
|
370
370
|
options.color ??= canUseColor(options.color);
|
|
371
371
|
const maxFileSizeErr = validateMaxFileSize(options.maxFileSize);
|
|
372
372
|
if (maxFileSizeErr) this.error(`error: invalid option value for --max-file-size: ${maxFileSizeErr}`);
|
|
373
|
-
const { mustFindFiles, fileList, files, file } = options;
|
|
373
|
+
const { mustFindFiles, fileList, files, file, forceCheck } = options;
|
|
374
|
+
if (forceCheck && !file?.length && !files?.length && !fileList?.length) this.error("error: --force-check requires --file, --files, or --file-list to be specified");
|
|
375
|
+
if (fileGlobs.length && (file?.length || files?.length)) this.error("error: mixing globs and --file is not supported");
|
|
374
376
|
const result = await lint(fileGlobs, options);
|
|
375
377
|
if (!fileGlobs.length && !result.files && !result.errors && !fileList && !files?.length && !file?.length) {
|
|
376
378
|
this.outputHelp();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-
|
|
1
|
+
import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-DlXe327y.js";
|
|
2
2
|
import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib";
|
|
3
3
|
import { CSpellReporter, RunResult } from "@cspell/cspell-types";
|
|
4
4
|
//#region src/config/options.d.ts
|
|
@@ -116,4 +116,4 @@ declare function createInit(options: InitOptions): Promise<void>;
|
|
|
116
116
|
declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
|
|
117
117
|
//#endregion
|
|
118
118
|
export { checkText as a, parseApplicationFeatureFlags as c, listDictionaries as d, TraceResult as i, suggestions as l, CheckTextResult as n, createInit as o, IncludeExcludeFlag as r, lint as s, AppError as t, trace as u };
|
|
119
|
-
//# sourceMappingURL=application-
|
|
119
|
+
//# sourceMappingURL=application-094uTsvC.d.ts.map
|
|
@@ -616,8 +616,8 @@ function getReporter(options, config) {
|
|
|
616
616
|
consoleError(errorText);
|
|
617
617
|
}
|
|
618
618
|
const resultEmitter = (result) => {
|
|
619
|
-
if (!fileGlobs.length && !result.files) return;
|
|
620
619
|
const { files, issues, cachedFiles, filesWithIssues, errors, skippedFiles } = result;
|
|
620
|
+
if (!fileGlobs.length && !files && !skippedFiles && !errors && !issues) return;
|
|
621
621
|
const numFilesWithIssues = filesWithIssues.size;
|
|
622
622
|
const chalk = stderr.chalk;
|
|
623
623
|
if (stderr.getColorLevel() > 0) {
|
|
@@ -1190,7 +1190,7 @@ try {
|
|
|
1190
1190
|
const pkgDir = _dirname;
|
|
1191
1191
|
const npmPackage = {
|
|
1192
1192
|
name: "cspell",
|
|
1193
|
-
version: "10.
|
|
1193
|
+
version: "10.2.0-alpha.1",
|
|
1194
1194
|
engines: { node: ">=22.18.0" }
|
|
1195
1195
|
};
|
|
1196
1196
|
//#endregion
|
|
@@ -2490,12 +2490,13 @@ async function processFile(file, cache, prefetch, processFileOptions) {
|
|
|
2490
2490
|
result.fileInfo = fileInfo;
|
|
2491
2491
|
let spellResult = {};
|
|
2492
2492
|
try {
|
|
2493
|
-
const { showSuggestions: generateSuggestions, validateDirectives, skipValidation } = cfg.options;
|
|
2493
|
+
const { showSuggestions: generateSuggestions, validateDirectives, skipValidation, forceCheck: force } = cfg.options;
|
|
2494
2494
|
const validateOptions = clean({
|
|
2495
2495
|
generateSuggestions,
|
|
2496
2496
|
numSuggestions: configInfo.config.numSuggestions ?? 5,
|
|
2497
2497
|
validateDirectives,
|
|
2498
|
-
skipValidation
|
|
2498
|
+
skipValidation,
|
|
2499
|
+
force
|
|
2499
2500
|
});
|
|
2500
2501
|
const r = await spellCheckDocument(doc, validateOptions, userSettings);
|
|
2501
2502
|
spellResult = r;
|
|
@@ -2789,17 +2790,18 @@ function processMaxFileSize(value) {
|
|
|
2789
2790
|
return num;
|
|
2790
2791
|
}
|
|
2791
2792
|
function runResult(init = {}) {
|
|
2792
|
-
const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles = 0 } = init;
|
|
2793
|
+
const { files = 0, filesWithIssues = /* @__PURE__ */ new Set(), issues = 0, errors = 0, cachedFiles = 0, skippedFiles = 0 } = init;
|
|
2793
2794
|
return {
|
|
2794
2795
|
files,
|
|
2795
2796
|
filesWithIssues,
|
|
2796
2797
|
issues,
|
|
2797
2798
|
errors,
|
|
2798
|
-
cachedFiles
|
|
2799
|
+
cachedFiles,
|
|
2800
|
+
skippedFiles
|
|
2799
2801
|
};
|
|
2800
2802
|
}
|
|
2801
2803
|
//#endregion
|
|
2802
|
-
//#region \0@oxc-project+runtime@0.
|
|
2804
|
+
//#region \0@oxc-project+runtime@0.147.0/helpers/esm/usingCtx.js
|
|
2803
2805
|
function _usingCtx() {
|
|
2804
2806
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
2805
2807
|
var n = Error();
|
|
@@ -2908,7 +2910,8 @@ async function runLint(cfg) {
|
|
|
2908
2910
|
...cfg.options,
|
|
2909
2911
|
version
|
|
2910
2912
|
}, root);
|
|
2911
|
-
const
|
|
2913
|
+
const filesToCheck = await determineFilesToCheck(configInfo, cfg, reporter, globInfo);
|
|
2914
|
+
const processFilesOptions = {
|
|
2912
2915
|
chalk,
|
|
2913
2916
|
configInfo,
|
|
2914
2917
|
cfg,
|
|
@@ -2918,8 +2921,12 @@ async function runLint(cfg) {
|
|
|
2918
2921
|
userSettings: configInfo.config,
|
|
2919
2922
|
lintReporter: reporter,
|
|
2920
2923
|
cacheSettings
|
|
2921
|
-
}
|
|
2924
|
+
};
|
|
2925
|
+
const result = await processFiles(filesToCheck.files, processFilesOptions);
|
|
2922
2926
|
if (configErrorCount && cfg.options.exitCode !== false) result.errors ||= configErrorCount;
|
|
2927
|
+
const skippedFiles = Math.max(0, filesToCheck.numFiles - result.files);
|
|
2928
|
+
result.files += skippedFiles;
|
|
2929
|
+
result.skippedFiles = (result.skippedFiles || 0) + skippedFiles;
|
|
2923
2930
|
return result;
|
|
2924
2931
|
} catch (e) {
|
|
2925
2932
|
const err = toApplicationError(e);
|
|
@@ -2995,10 +3002,27 @@ function filesToProcess(files) {
|
|
|
2995
3002
|
}));
|
|
2996
3003
|
}
|
|
2997
3004
|
async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) {
|
|
3005
|
+
const result = {
|
|
3006
|
+
files: [],
|
|
3007
|
+
numFiles: 0
|
|
3008
|
+
};
|
|
3009
|
+
function countFiles(fnKeep) {
|
|
3010
|
+
if (!fnKeep) return () => {
|
|
3011
|
+
result.numFiles++;
|
|
3012
|
+
return true;
|
|
3013
|
+
};
|
|
3014
|
+
return (file) => {
|
|
3015
|
+
result.numFiles++;
|
|
3016
|
+
return fnKeep(file);
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
2998
3019
|
async function _determineFilesToCheck() {
|
|
3020
|
+
return !cfg.fileLists?.length && !cfg.files?.length ? determineFilesToCheckFromGlobs() : determineFilesToCheckFromCliFiles();
|
|
3021
|
+
}
|
|
3022
|
+
async function determineFilesToCheckFromCliFiles() {
|
|
2999
3023
|
const { fileLists } = cfg;
|
|
3000
3024
|
const hasFileLists = !!fileLists.length;
|
|
3001
|
-
const {
|
|
3025
|
+
const { gitIgnore, allGlobs, excludeGlobs, normalizedExcludes } = globInfo;
|
|
3002
3026
|
const { root } = cfg;
|
|
3003
3027
|
const globsToExcludeRaw = [...configInfo.config.ignorePaths || [], ...excludeGlobs];
|
|
3004
3028
|
const globsToExclude = globsToExcludeRaw.filter((g) => !globPattern(g).startsWith("!"));
|
|
@@ -3015,22 +3039,46 @@ async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) {
|
|
|
3015
3039
|
};
|
|
3016
3040
|
const enableGlobDot = cfg.enableGlobDot ?? configInfo.config.enableGlobDot;
|
|
3017
3041
|
if (enableGlobDot !== void 0) globOptions.dot = enableGlobDot;
|
|
3018
|
-
const
|
|
3019
|
-
const
|
|
3020
|
-
const rawCliFiles = cfg.files?.map((file) => resolveFilename(file, root)).filter(includeFilter);
|
|
3042
|
+
const includeFilterCountSkipped = countFiles(createIncludeFileFilterFn(allGlobs, root, enableGlobDot));
|
|
3043
|
+
const rawCliFiles = cfg.files?.map((file) => resolveFilename(file, root)).filter(includeFilterCountSkipped);
|
|
3021
3044
|
const cliFiles = cfg.options.mustFindFiles ? rawCliFiles : rawCliFiles && pipeAsync(rawCliFiles, opFilterAsync(isFile));
|
|
3022
|
-
const foundFiles = hasFileLists ? concatAsyncIterables(cliFiles, await useFileLists(fileLists,
|
|
3023
|
-
const
|
|
3045
|
+
const foundFiles = hasFileLists ? concatAsyncIterables(cliFiles, await useFileLists(fileLists, includeFilterCountSkipped)) : cliFiles || [];
|
|
3046
|
+
const opFilterExcludedFiles = opFilter(filterOutExcludedFilesFn(globMatcher));
|
|
3047
|
+
const filtered = !cfg.options.forceCheck && gitIgnore ? await gitIgnore.filterOutIgnored(foundFiles) : foundFiles;
|
|
3024
3048
|
return isAsyncIterable(filtered) ? pipeAsync(filtered, opFilterExcludedFiles, filesToProcessAsync) : filesToProcess(pipe(filtered, opFilterExcludedFiles));
|
|
3025
3049
|
}
|
|
3050
|
+
async function determineFilesToCheckFromGlobs() {
|
|
3051
|
+
const { gitIgnore, fileGlobs, excludeGlobs, normalizedExcludes } = globInfo;
|
|
3052
|
+
const { root } = cfg;
|
|
3053
|
+
const globsToExcludeRaw = [...configInfo.config.ignorePaths || [], ...excludeGlobs];
|
|
3054
|
+
const globsToExclude = globsToExcludeRaw.filter((g) => !globPattern(g).startsWith("!"));
|
|
3055
|
+
if (globsToExclude.length !== globsToExcludeRaw.length) {
|
|
3056
|
+
const msg = `Negative glob exclusions are not supported: ${globsToExcludeRaw.map((g) => globPattern(g)).filter((g) => g.startsWith("!")).join(", ")}`;
|
|
3057
|
+
reporter.info(msg, MessageTypes$1.Warning);
|
|
3058
|
+
}
|
|
3059
|
+
const globMatcher = buildGlobMatcher(globsToExclude, root, true);
|
|
3060
|
+
const globOptions = {
|
|
3061
|
+
root,
|
|
3062
|
+
cwd: root,
|
|
3063
|
+
ignore: [...extractGlobsFromMatcher(globMatcher), ...normalizedExcludes],
|
|
3064
|
+
nodir: true
|
|
3065
|
+
};
|
|
3066
|
+
const enableGlobDot = cfg.enableGlobDot ?? configInfo.config.enableGlobDot;
|
|
3067
|
+
if (enableGlobDot !== void 0) globOptions.dot = enableGlobDot;
|
|
3068
|
+
const opFilterExcludedFiles = opFilter(filterOutExcludedFilesFn(globMatcher));
|
|
3069
|
+
const foundFiles = await findFiles(fileGlobs, globOptions);
|
|
3070
|
+
const filtered = gitIgnore ? await gitIgnore.filterOutIgnored(foundFiles) : foundFiles;
|
|
3071
|
+
return isAsyncIterable(filtered) ? pipeAsync(filtered, opFilterExcludedFiles, filesToProcessAsync, opFilter(countFiles())) : filesToProcess(pipe(filtered, opFilterExcludedFiles)).filter(countFiles());
|
|
3072
|
+
}
|
|
3026
3073
|
function isExcluded(filename, globMatcherExclude) {
|
|
3027
3074
|
if (isBinaryFile(toFileURL(filename))) return true;
|
|
3075
|
+
if (cfg.options.forceCheck) return false;
|
|
3028
3076
|
const { root } = cfg;
|
|
3029
3077
|
const absFilename = path$1.resolve(root, filename);
|
|
3030
3078
|
const r = globMatcherExclude.matchEx(absFilename);
|
|
3031
3079
|
if (r.matched) {
|
|
3032
3080
|
const { glob, source } = extractGlobSource(r.pattern);
|
|
3033
|
-
if (calcVerboseLevel(cfg.options) >
|
|
3081
|
+
if (calcVerboseLevel(cfg.options) > 0) reporter.info(`Excluded File: ${path$1.relative(root, absFilename)}; Excluded by ${glob} from ${source}`, MessageTypes$1.Info);
|
|
3034
3082
|
}
|
|
3035
3083
|
return r.matched;
|
|
3036
3084
|
}
|
|
@@ -3039,7 +3087,8 @@ async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) {
|
|
|
3039
3087
|
if (calcVerboseLevel(cfg.options) > 1) reporter.info(`Exclusion Globs: \n ${excludeInfo.join("\n ")}\n`, MessageTypes$1.Info);
|
|
3040
3088
|
return (filename) => !isExcluded(filename, globMatcherExclude);
|
|
3041
3089
|
}
|
|
3042
|
-
|
|
3090
|
+
result.files = await _determineFilesToCheck();
|
|
3091
|
+
return result;
|
|
3043
3092
|
}
|
|
3044
3093
|
function extractGlobSource(g) {
|
|
3045
3094
|
const { glob, rawGlob, source } = g;
|
|
@@ -3460,4 +3509,4 @@ function parseApplicationFeatureFlags(flags) {
|
|
|
3460
3509
|
//#endregion
|
|
3461
3510
|
export { ApplicationError as C, width as S, console as T, padLeft as _, parseApplicationFeatureFlags as a, pruneAnsiTextEnd as b, listDictionaries as c, validateUnitSize as d, unindent as f, tableToLines as g, getReporter as h, lint as i, ReportChoicesAll as l, npmPackage as m, checkText as n, suggestions as o, DEFAULT_CACHE_LOCATION as p, createInit as r, trace as s, IncludeExcludeFlag as t, cvtLinterCliCommandOptionsToLinterCliOptions as u, padWidth as v, CheckFailed as w, pruneAnsiTextStart as x, ansiWidth as y };
|
|
3462
3511
|
|
|
3463
|
-
//# sourceMappingURL=application-
|
|
3512
|
+
//# sourceMappingURL=application-BIFVUM_N.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-
|
|
1
|
+
import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-094uTsvC.js";
|
|
2
2
|
export { AppError, CheckTextResult, IncludeExcludeFlag, type TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
|
package/dist/esm/application.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as parseApplicationFeatureFlags, c as listDictionaries, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-
|
|
1
|
+
import { a as parseApplicationFeatureFlags, c as listDictionaries, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-BIFVUM_N.js";
|
|
2
2
|
export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as LinterCliOptions, o as TraceOptions, s as FinalizedReporter, t as BaseOptions } from "./options-
|
|
2
|
-
import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-
|
|
1
|
+
import { i as LinterCliOptions, o as TraceOptions, s as FinalizedReporter, t as BaseOptions } from "./options-DlXe327y.js";
|
|
2
|
+
import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-094uTsvC.js";
|
|
3
3
|
import "chalk";
|
|
4
4
|
import { CSpellReporter, ReporterConfiguration } from "@cspell/cspell-types";
|
|
5
5
|
import { WriteStream } from "node:tty";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as parseApplicationFeatureFlags, c as listDictionaries, h as getReporter, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-
|
|
1
|
+
import { a as parseApplicationFeatureFlags, c as listDictionaries, h as getReporter, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-BIFVUM_N.js";
|
|
2
2
|
export * from "@cspell/cspell-types";
|
|
3
3
|
export { IncludeExcludeFlag, checkText, createInit, getReporter as getDefaultReporter, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
|
|
@@ -391,6 +391,13 @@ interface LinterCliOptions extends LinterOptions {
|
|
|
391
391
|
* If no flags are passed, this will be `undefined`.
|
|
392
392
|
*/
|
|
393
393
|
stopConfigSearchAt?: string[];
|
|
394
|
+
/**
|
|
395
|
+
* Force the document to be checked even if it would normally be excluded.
|
|
396
|
+
*/
|
|
397
|
+
forceCheck?: boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Which issues to report. If not set, all issues are reported.
|
|
400
|
+
*/
|
|
394
401
|
report?: ReportChoices | undefined;
|
|
395
402
|
}
|
|
396
403
|
type ReportChoices = "all" | "simple" | "typos" | "flagged";
|
|
@@ -400,4 +407,4 @@ interface CSpellConfigFile {
|
|
|
400
407
|
}
|
|
401
408
|
//#endregion
|
|
402
409
|
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-
|
|
410
|
+
//# sourceMappingURL=options-DlXe327y.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0-alpha.1",
|
|
4
4
|
"description": "A Spelling Checker for Code!",
|
|
5
5
|
"funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"sideEffects": false,
|
|
12
|
-
"types": "dist/cjs/commonJsApi.d.
|
|
12
|
+
"types": "dist/cjs/commonJsApi.d.cts",
|
|
13
13
|
"main": "dist/cjs/commonJsApi.cjs",
|
|
14
14
|
"module": "dist/esm/index.js",
|
|
15
15
|
"exports": {
|
|
@@ -90,23 +90,23 @@
|
|
|
90
90
|
},
|
|
91
91
|
"homepage": "https://cspell.org/",
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@cspell/cspell-json-reporter": "10.
|
|
94
|
-
"@cspell/cspell-performance-monitor": "10.
|
|
95
|
-
"@cspell/cspell-pipe": "10.
|
|
96
|
-
"@cspell/cspell-types": "10.
|
|
97
|
-
"@cspell/cspell-worker": "10.
|
|
98
|
-
"@cspell/dynamic-import": "10.
|
|
99
|
-
"@cspell/url": "10.
|
|
93
|
+
"@cspell/cspell-json-reporter": "10.2.0-alpha.1",
|
|
94
|
+
"@cspell/cspell-performance-monitor": "10.2.0-alpha.1",
|
|
95
|
+
"@cspell/cspell-pipe": "10.2.0-alpha.1",
|
|
96
|
+
"@cspell/cspell-types": "10.2.0-alpha.1",
|
|
97
|
+
"@cspell/cspell-worker": "10.2.0-alpha.1",
|
|
98
|
+
"@cspell/dynamic-import": "10.2.0-alpha.1",
|
|
99
|
+
"@cspell/url": "10.2.0-alpha.1",
|
|
100
100
|
"ansi-regex": "^6.3.0",
|
|
101
101
|
"chalk": "^6.0.0",
|
|
102
102
|
"chalk-template": "^1.1.2",
|
|
103
103
|
"commander": "^15.0.0",
|
|
104
|
-
"cspell-config-lib": "10.
|
|
105
|
-
"cspell-dictionary": "10.
|
|
106
|
-
"cspell-gitignore": "10.
|
|
107
|
-
"cspell-glob": "10.
|
|
108
|
-
"cspell-io": "10.
|
|
109
|
-
"cspell-lib": "10.
|
|
104
|
+
"cspell-config-lib": "10.2.0-alpha.1",
|
|
105
|
+
"cspell-dictionary": "10.2.0-alpha.1",
|
|
106
|
+
"cspell-gitignore": "10.2.0-alpha.1",
|
|
107
|
+
"cspell-glob": "10.2.0-alpha.1",
|
|
108
|
+
"cspell-io": "10.2.0-alpha.1",
|
|
109
|
+
"cspell-lib": "10.2.0-alpha.1",
|
|
110
110
|
"fast-json-stable-stringify": "^2.1.0",
|
|
111
111
|
"flatted": "^3.4.4",
|
|
112
112
|
"semver": "^7.8.5",
|
|
@@ -121,5 +121,5 @@
|
|
|
121
121
|
"micromatch": "^4.0.8",
|
|
122
122
|
"minimatch": "^9.0.9"
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "6f2e2705b7f91a807273cbbd821582a372774a9d"
|
|
125
125
|
}
|