Sign In

cspell

Package Overview
Dependencies
Maintainers
1
Versions
469
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cspell - npm Package Compare versions

Comparing version
9.6.4
to
9.7.0
+109
dist/esm/index-BObT-HkR.d.ts
import { n as DictionariesOptions } from "./options-CeDseSxu.js";
import { SuggestionsForWordResult } from "cspell-lib";
//#region src/config/options.d.ts
interface BaseConfigOptions {
/**
* The path to the configuration file to create / update.
* If not provided, a default file name will be used based on the format.
*/
config?: string;
/**
* The list of configuration files or dictionary packages to import.
* This can be a list of file paths, package names, or URLs.
*/
import?: string[];
/**
* The locale to use when spell checking (e.g., en, en-US, de).
*/
locale?: string;
/**
* Whether to add comments to the configuration file.
* - `true` - comments will be added to the configuration file.
* - `false` - no comments will be added.
* - `undefined` - the default behavior will be used based on the format.
*/
comments?: boolean;
/**
* Whether to remove all comments from the configuration file.
* - `true` - all comments will be removed.
* - `false` | `undefined` - no comments will be removed.
* @implies `comments: false`
*/
removeComments?: boolean;
/**
* Whether to add the schema reference to the configuration file.
* - `true` - the schema reference will be added / updated.
* - `false` - no schema reference will be added.
*/
schema?: boolean;
/**
* The list of dictionaries to enable in the configuration file.
* These are added to an existing configuration file or a new one.
* Existing dictionaries will not be removed.
*/
dictionary?: string[];
/**
* Whether to write the configuration to stdout instead of a file.
*/
stdout?: boolean;
}
interface InitOptions extends BaseConfigOptions {
/**
* The path where the configuration file will be written, it can be a file path or a URL.
* If not provided, a default file name will be used based on the format.
* The default will be `cspell.config.yaml` or `cspell.json` based on the format.
* @conflicts `config` - If `config` is provided, it will be used instead of `output`.
*/
output?: string;
/**
* The format of the configuration file.
* @conflicts `config` - If `config` is provided, the format will be inferred from the file extension.
*/
format?: "yaml" | "yml" | "json" | "jsonc";
}
//#endregion
//#region src/emitters/suggestionsEmitter.d.ts
interface TimedSuggestionsForWordResult extends SuggestionsForWordResult {
elapsedTimeMs?: number;
}
//#endregion
//#region src/dictionaries/listDictionaries.d.ts
interface ListDictionariesResult {
/**
* The name of the dictionary.
*/
name: string;
/**
* The description of the dictionary.
*/
description?: string | undefined;
/**
* The path to the dictionary file.
*/
path?: string | undefined;
/**
* True if the dictionary is enabled.
*/
enabled: boolean;
/**
* True if the dictionary is blocked.
*/
blocked: boolean;
/**
* The inline dictionaries supported by the dictionary.
*/
inline?: string[] | undefined;
/**
* the languages locales supported by the dictionary.
*/
locales?: string[] | undefined;
/**
* The file types supported by the dictionary.
*/
fileTypes?: string[] | undefined;
}
declare function listDictionaries(options: DictionariesOptions): Promise<ListDictionariesResult[]>;
//#endregion
export { TimedSuggestionsForWordResult as n, InitOptions as r, listDictionaries as t };
//# sourceMappingURL=index-BObT-HkR.d.ts.map

Sorry, the diff of this file is too big to display

+1
-0

@@ -0,1 +1,2 @@

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
let _cspell_cspell_types = require("@cspell/cspell-types");

@@ -2,0 +3,0 @@

+2
-1

@@ -1,2 +0,3 @@

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-DYABxs7R.js";
import { A as width, D as ansiWidth, E as padWidth, M as CheckFailed, N as console, O as pruneAnsiTextEnd, T as padLeft, i as cvtLinterCliCommandOptionsToLinterCliOptions, j as ApplicationError, k as pruneAnsiTextStart, l as validateUnitSize, p as DEFAULT_CACHE_LOCATION, r as ReportChoicesAll, t as listDictionaries, u as unindent, v as npmPackage, w as tableToLines } from "./listDictionaries-DRQ2BGn_.js";
import { IncludeExcludeFlag, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";
import { Link } from "cspell-lib";

@@ -3,0 +4,0 @@ import chalk from "chalk";

@@ -1,3 +0,17 @@

import "./options-CeDseSxu.js";
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-i4vvz7Jf.js";
export { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
import { a as SuggestionOptions, i as LinterCliOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-CeDseSxu.js";
import { n as TimedSuggestionsForWordResult, r as InitOptions, t as listDictionaries } from "./index-BObT-HkR.js";
import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, TraceResult, TraceWordResult } from "cspell-lib";
import { CSpellReporter, RunResult } from "@cspell/cspell-types";
//#region src/application.d.mts
type AppError = NodeJS.ErrnoException;
declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
type CheckTextResult = CheckTextInfo;
declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
declare function createInit(options: InitOptions): Promise<void>;
declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
//#endregion
export { AppError, CheckTextResult, IncludeExcludeFlag, type TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
//# sourceMappingURL=application.d.ts.map

@@ -1,3 +0,97 @@

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-DYABxs7R.js";
import { C as clean, N as console, S as getReporter, _ as finalizeReporter, a as fixLegacy, b as parseFeatureFlags, c as runLint, d as getTimeMeasurer, f as readConfig, g as readStdin, h as readFileInfo, m as fileInfoToDocument, n as simpleRepl, o as LintRequest, s as extractUnknownWordsConfig, t as listDictionaries, x as configInit, y as getFeatureFlags } from "./listDictionaries-DRQ2BGn_.js";
import { opMap, opTap, pipeAsync, toAsyncIterable } from "@cspell/cspell-pipe";
import { IncludeExcludeFlag, SuggestionError, checkTextDocument, getDefaultSettings, getGlobalSettingsAsync, mergeSettings, suggestionsForWords, traceWordsAsync } from "cspell-lib";
export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
//#region src/application.mts
function lint(fileGlobs, options, reporter) {
options = fixLegacy(options);
const unknownWordsConfig = extractUnknownWordsConfig(options);
const useOptions = {
...options,
...unknownWordsConfig
};
const reporterOptions = {
...useOptions,
console
};
return runLint(new LintRequest(fileGlobs, useOptions, finalizeReporter(reporter) ?? getReporter({
...useOptions,
fileGlobs
}, reporterOptions)));
}
async function* trace(words, options) {
options = fixLegacy(options);
const iWords = options.stdin ? toAsyncIterable(words, readStdin()) : words;
const { languageId, locale, allowCompoundWords, ignoreCase } = options;
const configFile = await readConfig(options.config, void 0);
const loadDefault = options.defaultConfiguration ?? configFile.config.loadDefaultConfiguration ?? true;
const additionalSettings = {};
if (options.dictionary) additionalSettings.dictionaries = options.dictionary;
yield* traceWordsAsync(iWords, mergeSettings(await getDefaultSettings(loadDefault), await getGlobalSettingsAsync(), configFile.config, additionalSettings), clean({
languageId,
locale,
ignoreCase,
allowCompoundWords
}));
}
async function checkText(filename, options) {
options = fixLegacy(options);
const fileInfo = await readFileInfo(filename);
const { locale, languageId, validateDirectives } = options;
const doc = fileInfoToDocument(fileInfo, languageId, locale);
const checkOptions = {
configFile: options.config,
validateDirectives
};
const settingsFromCommandLine = clean({
languageId,
language: locale,
loadDefaultConfiguration: options.defaultConfiguration
});
return checkTextDocument(doc, clean({ ...checkOptions }), settingsFromCommandLine);
}
async function* suggestions(words, options) {
options = fixLegacy(options);
const configFile = await readConfig(options.config, void 0);
let timer;
function tapStart() {
timer = getTimeMeasurer();
}
function mapStart(v) {
tapStart();
return v;
}
function mapEnd(v) {
const elapsedTimeMs = timer?.();
return elapsedTimeMs ? {
...v,
elapsedTimeMs
} : v;
}
const iWords = options.repl ? pipeAsync(toAsyncIterable(words, simpleRepl()), opTap(tapStart)) : options.useStdin ? pipeAsync(toAsyncIterable(words, readStdin()), opTap(tapStart)) : words.map(mapStart);
try {
yield* pipeAsync(suggestionsForWords(iWords, clean({ ...options }), configFile.config), opMap(mapEnd));
} catch (e) {
if (!(e instanceof SuggestionError)) throw e;
console.error(e.message);
process.exitCode = 1;
}
}
function createInit(options) {
return configInit(options);
}
function registerApplicationFeatureFlags() {
const ff = getFeatureFlags();
[{
name: "timer",
description: "Display elapsed time for command."
}].forEach((flag) => ff.register(flag));
return ff;
}
function parseApplicationFeatureFlags(flags) {
return parseFeatureFlags(flags, registerApplicationFeatureFlags());
}
//#endregion
export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
//# sourceMappingURL=application.js.map
import { i as LinterCliOptions, o as TraceOptions, s as FinalizedReporter, t as BaseOptions } from "./options-CeDseSxu.js";
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-i4vvz7Jf.js";
import { t as listDictionaries } from "./index-BObT-HkR.js";
import { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";
import "chalk";

@@ -4,0 +5,0 @@ import { CSpellReporter, ReporterConfiguration } from "@cspell/cspell-types";

@@ -1,2 +0,3 @@

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-DYABxs7R.js";
import { S as getReporter, t as listDictionaries } from "./listDictionaries-DRQ2BGn_.js";
import { IncludeExcludeFlag, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";

@@ -3,0 +4,0 @@ export * from "@cspell/cspell-types"

{
"name": "cspell",
"version": "9.6.4",
"version": "9.7.0",
"description": "A Spelling Checker for Code!",

@@ -89,9 +89,9 @@ "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",

"dependencies": {
"@cspell/cspell-json-reporter": "9.6.4",
"@cspell/cspell-performance-monitor": "9.6.4",
"@cspell/cspell-pipe": "9.6.4",
"@cspell/cspell-types": "9.6.4",
"@cspell/cspell-worker": "9.6.4",
"@cspell/dynamic-import": "9.6.4",
"@cspell/url": "9.6.4",
"@cspell/cspell-json-reporter": "9.7.0",
"@cspell/cspell-performance-monitor": "9.7.0",
"@cspell/cspell-pipe": "9.7.0",
"@cspell/cspell-types": "9.7.0",
"@cspell/cspell-worker": "9.7.0",
"@cspell/dynamic-import": "9.7.0",
"@cspell/url": "9.7.0",
"ansi-regex": "^6.2.2",

@@ -101,11 +101,11 @@ "chalk": "^5.6.2",

"commander": "^14.0.3",
"cspell-config-lib": "9.6.4",
"cspell-dictionary": "9.6.4",
"cspell-gitignore": "9.6.4",
"cspell-glob": "9.6.4",
"cspell-io": "9.6.4",
"cspell-lib": "9.6.4",
"cspell-config-lib": "9.7.0",
"cspell-dictionary": "9.7.0",
"cspell-gitignore": "9.7.0",
"cspell-glob": "9.7.0",
"cspell-io": "9.7.0",
"cspell-lib": "9.7.0",
"fast-json-stable-stringify": "^2.1.0",
"flatted": "^3.3.3",
"semver": "^7.7.3",
"semver": "^7.7.4",
"tinyglobby": "^0.2.15"

@@ -120,5 +120,5 @@ },

"micromatch": "^4.0.8",
"minimatch": "^9.0.5"
"minimatch": "^9.0.6"
},
"gitHead": "e126c7f5708d4258ada35ba1d29d18952d7f0886"
"gitHead": "48f64e0bd95b39011af6dc80cd8ae4d519511f73"
}

Sorry, the diff of this file is too big to display

import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-CeDseSxu.js";
import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib";
import { CSpellReporter, RunResult } from "@cspell/cspell-types";
//#region src/config/options.d.ts
interface BaseConfigOptions {
/**
* The path to the configuration file to create / update.
* If not provided, a default file name will be used based on the format.
*/
config?: string;
/**
* The list of configuration files or dictionary packages to import.
* This can be a list of file paths, package names, or URLs.
*/
import?: string[];
/**
* The locale to use when spell checking (e.g., en, en-US, de).
*/
locale?: string;
/**
* Whether to add comments to the configuration file.
* - `true` - comments will be added to the configuration file.
* - `false` - no comments will be added.
* - `undefined` - the default behavior will be used based on the format.
*/
comments?: boolean;
/**
* Whether to remove all comments from the configuration file.
* - `true` - all comments will be removed.
* - `false` | `undefined` - no comments will be removed.
* @implies `comments: false`
*/
removeComments?: boolean;
/**
* Whether to add the schema reference to the configuration file.
* - `true` - the schema reference will be added / updated.
* - `false` - no schema reference will be added.
*/
schema?: boolean;
/**
* The list of dictionaries to enable in the configuration file.
* These are added to an existing configuration file or a new one.
* Existing dictionaries will not be removed.
*/
dictionary?: string[];
/**
* Whether to write the configuration to stdout instead of a file.
*/
stdout?: boolean;
}
interface InitOptions extends BaseConfigOptions {
/**
* The path where the configuration file will be written, it can be a file path or a URL.
* If not provided, a default file name will be used based on the format.
* The default will be `cspell.config.yaml` or `cspell.json` based on the format.
* @conflicts `config` - If `config` is provided, it will be used instead of `output`.
*/
output?: string;
/**
* The format of the configuration file.
* @conflicts `config` - If `config` is provided, the format will be inferred from the file extension.
*/
format?: "yaml" | "yml" | "json" | "jsonc";
}
//#endregion
//#region src/emitters/suggestionsEmitter.d.ts
interface TimedSuggestionsForWordResult extends SuggestionsForWordResult {
elapsedTimeMs?: number;
}
//#endregion
//#region src/dictionaries/listDictionaries.d.ts
interface ListDictionariesResult {
/**
* The name of the dictionary.
*/
name: string;
/**
* The description of the dictionary.
*/
description?: string | undefined;
/**
* The path to the dictionary file.
*/
path?: string | undefined;
/**
* True if the dictionary is enabled.
*/
enabled: boolean;
/**
* True if the dictionary is blocked.
*/
blocked: boolean;
/**
* The inline dictionaries supported by the dictionary.
*/
inline?: string[] | undefined;
/**
* the languages locales supported by the dictionary.
*/
locales?: string[] | undefined;
/**
* The file types supported by the dictionary.
*/
fileTypes?: string[] | undefined;
}
declare function listDictionaries(options: DictionariesOptions): Promise<ListDictionariesResult[]>;
//#endregion
//#region src/application.d.mts
type AppError = NodeJS.ErrnoException;
declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
type CheckTextResult = CheckTextInfo;
declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
declare function createInit(options: InitOptions): Promise<void>;
declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
//#endregion
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 };
//# sourceMappingURL=application-i4vvz7Jf.d.ts.map