cspell 6.1.2 → 6.1.3
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/dist/application.js +2 -3
- package/dist/cli-reporter.js +2 -4
- package/dist/commandSuggestion.js +1 -2
- package/dist/commandTrace.js +1 -1
- package/dist/emitters/traceEmitter.js +3 -6
- package/dist/link.js +2 -3
- package/dist/lint/lint.js +16 -21
- package/dist/util/cache/DiskCache.js +6 -7
- package/dist/util/cache/ObjectCollection.js +1 -2
- package/dist/util/cache/createCache.js +4 -5
- package/dist/util/errors.js +1 -1
- package/dist/util/fileHelper.js +5 -4
- package/dist/util/glob.js +1 -1
- package/package.json +10 -10
package/dist/application.js
CHANGED
|
@@ -43,12 +43,11 @@ function lint(fileGlobs, options, emitters) {
|
|
|
43
43
|
}
|
|
44
44
|
exports.lint = lint;
|
|
45
45
|
async function* trace(words, options) {
|
|
46
|
-
var _a, _b;
|
|
47
46
|
options = (0, options_1.fixLegacy)(options);
|
|
48
47
|
const iWords = options.stdin ? (0, cspell_pipe_1.toAsyncIterable)(words, (0, stdin_1.readStdin)()) : words;
|
|
49
48
|
const { languageId, locale, allowCompoundWords, ignoreCase } = options;
|
|
50
49
|
const configFile = await (0, fileHelper_1.readConfig)(options.config, undefined);
|
|
51
|
-
const loadDefault =
|
|
50
|
+
const loadDefault = options.defaultConfiguration ?? configFile.config.loadDefaultConfiguration ?? true;
|
|
52
51
|
const config = (0, cspell_lib_1.mergeSettings)((0, cspell_lib_1.getDefaultSettings)(loadDefault), (0, cspell_lib_1.getGlobalSettings)(), configFile.config);
|
|
53
52
|
yield* (0, cspell_lib_1.traceWordsAsync)(iWords, config, { languageId, locale, ignoreCase, allowCompoundWords });
|
|
54
53
|
}
|
|
@@ -78,7 +77,7 @@ async function* suggestions(words, options) {
|
|
|
78
77
|
return v;
|
|
79
78
|
}
|
|
80
79
|
function mapEnd(v) {
|
|
81
|
-
const elapsedTimeMs = timer
|
|
80
|
+
const elapsedTimeMs = timer?.();
|
|
82
81
|
return { ...v, elapsedTimeMs };
|
|
83
82
|
}
|
|
84
83
|
const iWords = options.repl
|
package/dist/cli-reporter.js
CHANGED
|
@@ -117,8 +117,7 @@ function getReporter(options) {
|
|
|
117
117
|
Warning: (s) => console.info(chalk.yellow(s)),
|
|
118
118
|
};
|
|
119
119
|
function infoEmitter(message, msgType) {
|
|
120
|
-
|
|
121
|
-
(_a = emitters[msgType]) === null || _a === void 0 ? void 0 : _a.call(emitters, message);
|
|
120
|
+
emitters[msgType]?.(message);
|
|
122
121
|
}
|
|
123
122
|
const root = vscode_uri_1.URI.file(options.root || process.cwd());
|
|
124
123
|
const fsPathRoot = root.fsPath;
|
|
@@ -153,7 +152,6 @@ function getReporter(options) {
|
|
|
153
152
|
}
|
|
154
153
|
exports.getReporter = getReporter;
|
|
155
154
|
function formatIssue(templateStr, issue, maxIssueTextWidth) {
|
|
156
|
-
var _a;
|
|
157
155
|
function clean(t) {
|
|
158
156
|
return t.replace(/\s+/, ' ');
|
|
159
157
|
}
|
|
@@ -165,7 +163,7 @@ function formatIssue(templateStr, issue, maxIssueTextWidth) {
|
|
|
165
163
|
const rowText = row.toString();
|
|
166
164
|
const colText = col.toString();
|
|
167
165
|
const padRowCol = ' '.repeat(Math.max(1, 8 - (rowText.length + colText.length)));
|
|
168
|
-
const suggestions =
|
|
166
|
+
const suggestions = issue.suggestions?.join(', ') || '';
|
|
169
167
|
const message = issue.isFlagged ? '{yellow Forbidden word}' : 'Unknown word';
|
|
170
168
|
const substitutions = {
|
|
171
169
|
$col: colText,
|
|
@@ -39,8 +39,7 @@ function count(_, previous) {
|
|
|
39
39
|
return (previous || 0) + 1;
|
|
40
40
|
}
|
|
41
41
|
function asNumber(value, prev) {
|
|
42
|
-
|
|
43
|
-
return (_a = parseInt(value, 10)) !== null && _a !== void 0 ? _a : prev;
|
|
42
|
+
return parseInt(value, 10) ?? prev;
|
|
44
43
|
}
|
|
45
44
|
function commandSuggestion(prog) {
|
|
46
45
|
const suggestionCommand = prog.command('suggestions');
|
package/dist/commandTrace.js
CHANGED
|
@@ -51,7 +51,7 @@ function commandTrace(prog) {
|
|
|
51
51
|
for await (const results of App.trace(words, options)) {
|
|
52
52
|
(0, traceEmitter_1.emitTraceResults)(results, { cwd: process.cwd() });
|
|
53
53
|
numFound += results.reduce((n, r) => n + (r.found ? 1 : 0), 0);
|
|
54
|
-
const numErrors = results.map((r) =>
|
|
54
|
+
const numErrors = results.map((r) => r.errors?.length || 0).reduce((n, r) => n + r, 0);
|
|
55
55
|
if (numErrors) {
|
|
56
56
|
console.error('Dictionary Errors.');
|
|
57
57
|
throw new errors_1.CheckFailed('dictionary errors', 1);
|
|
@@ -33,14 +33,13 @@ const util_1 = require("../util/util");
|
|
|
33
33
|
const chalk = require("chalk");
|
|
34
34
|
const colWidthDictionaryName = 20;
|
|
35
35
|
function emitTraceResults(results, options) {
|
|
36
|
-
var _a;
|
|
37
36
|
const maxWordLength = results
|
|
38
37
|
.map((r) => r.foundWord || r.word)
|
|
39
38
|
.reduce((a, b) => Math.max(a, (0, util_1.width)(b)), 'Word'.length);
|
|
40
39
|
const cols = {
|
|
41
40
|
word: maxWordLength,
|
|
42
41
|
dictName: colWidthDictionaryName,
|
|
43
|
-
terminalWidth:
|
|
42
|
+
terminalWidth: options.lineWidth ?? (process.stdout.columns || 120),
|
|
44
43
|
};
|
|
45
44
|
const col = new Intl.Collator();
|
|
46
45
|
results.sort((a, b) => col.compare(a.dictName, b.dictName));
|
|
@@ -58,9 +57,8 @@ function emitHeader(colWidths) {
|
|
|
58
57
|
console.log(chalk.underline(line.join(' ').slice(0, colWidths.terminalWidth)));
|
|
59
58
|
}
|
|
60
59
|
function emitTraceResult(r, colWidths, options) {
|
|
61
|
-
var _a, _b;
|
|
62
60
|
const { word: wordColWidth, terminalWidth, dictName: widthName } = colWidths;
|
|
63
|
-
const errors =
|
|
61
|
+
const errors = r.errors?.map((e) => e.message)?.join('\n\t') || '';
|
|
64
62
|
const word = (0, util_1.pad)(r.foundWord || r.word, wordColWidth);
|
|
65
63
|
const cWord = word.replace(/[+]/g, chalk.yellow('+'));
|
|
66
64
|
const w = r.forbidden ? chalk.red(cWord) : chalk.green(cWord);
|
|
@@ -90,8 +88,7 @@ function trimMid(s, w) {
|
|
|
90
88
|
return s.slice(0, l) + '...' + s.slice(-r);
|
|
91
89
|
}
|
|
92
90
|
function calcFoundChar(r) {
|
|
93
|
-
|
|
94
|
-
const errors = ((_b = (_a = r.errors) === null || _a === void 0 ? void 0 : _a.map((e) => e.message)) === null || _b === void 0 ? void 0 : _b.join('\n\t')) || '';
|
|
91
|
+
const errors = r.errors?.map((e) => e.message)?.join('\n\t') || '';
|
|
95
92
|
let color = chalk.dim;
|
|
96
93
|
color = r.found ? chalk.whiteBright : color;
|
|
97
94
|
color = r.forbidden ? chalk.red : color;
|
package/dist/link.js
CHANGED
|
@@ -13,13 +13,12 @@ function listGlobalImportsResultToTable(results) {
|
|
|
13
13
|
const header = ['id', 'package', 'name', 'filename', 'dictionaries', 'errors'];
|
|
14
14
|
const decorate = (isError) => (isError ? (s) => chalk_1.default.red(s) : (s) => s);
|
|
15
15
|
function toColumns(r) {
|
|
16
|
-
var _a, _b;
|
|
17
16
|
return [
|
|
18
17
|
r.id,
|
|
19
|
-
|
|
18
|
+
r.package?.name,
|
|
20
19
|
r.name,
|
|
21
20
|
r.filename,
|
|
22
|
-
|
|
21
|
+
r.dictionaryDefinitions?.map((def) => def.name).join(', '),
|
|
23
22
|
r.error ? 'Failed to read file.' : '',
|
|
24
23
|
]
|
|
25
24
|
.map((c) => c || '')
|
package/dist/lint/lint.js
CHANGED
|
@@ -52,7 +52,6 @@ async function runLint(cfg) {
|
|
|
52
52
|
await reporter.result(lintResult);
|
|
53
53
|
return lintResult;
|
|
54
54
|
async function processFile(filename, configInfo, cache) {
|
|
55
|
-
var _a, _b, _c, _d, _e;
|
|
56
55
|
const getElapsedTimeMs = (0, timer_1.getTimeMeasurer)();
|
|
57
56
|
const cachedResult = await cache.getCachedLintResults(filename);
|
|
58
57
|
if (cachedResult) {
|
|
@@ -82,7 +81,7 @@ async function runLint(cfg) {
|
|
|
82
81
|
const { text } = fileInfo;
|
|
83
82
|
result.fileInfo = fileInfo;
|
|
84
83
|
let spellResult = {};
|
|
85
|
-
reporter.info(`Checking: ${filename}, File type: ${
|
|
84
|
+
reporter.info(`Checking: ${filename}, File type: ${doc.languageId ?? 'auto'}, Language: ${doc.locale ?? 'default'}`, cspell_types_1.MessageTypes.Info);
|
|
86
85
|
try {
|
|
87
86
|
const validateOptions = { generateSuggestions: cfg.options.showSuggestions, numSuggestions: 5 };
|
|
88
87
|
const r = await cspell.spellCheckDocument(doc, validateOptions, configInfo.config);
|
|
@@ -95,7 +94,7 @@ async function runLint(cfg) {
|
|
|
95
94
|
result.errors += 1;
|
|
96
95
|
}
|
|
97
96
|
result.elapsedTimeMs = getElapsedTimeMs();
|
|
98
|
-
const config =
|
|
97
|
+
const config = spellResult.settingsUsed ?? {};
|
|
99
98
|
result.configErrors += await reportConfigurationErrors(config);
|
|
100
99
|
const elapsed = result.elapsedTimeMs / 1000.0;
|
|
101
100
|
const dictionaries = config.dictionaries || [];
|
|
@@ -106,7 +105,7 @@ async function runLint(cfg) {
|
|
|
106
105
|
const { id: _id, name: _name, __imports, __importRef, ...cfg } = config;
|
|
107
106
|
const debugCfg = {
|
|
108
107
|
filename,
|
|
109
|
-
languageId:
|
|
108
|
+
languageId: doc.languageId ?? cfg.languageId ?? 'default',
|
|
110
109
|
config: { ...cfg, source: null },
|
|
111
110
|
source: spellResult.localConfigFilepath,
|
|
112
111
|
};
|
|
@@ -123,14 +122,13 @@ async function runLint(cfg) {
|
|
|
123
122
|
return { ...tdo, context };
|
|
124
123
|
}
|
|
125
124
|
async function processFiles(files, configInfo, cacheSettings) {
|
|
126
|
-
var _a, _b;
|
|
127
125
|
const fileCount = files instanceof Array ? files.length : undefined;
|
|
128
126
|
const status = runResult();
|
|
129
127
|
const cache = (0, cache_1.createCache)(cacheSettings);
|
|
130
128
|
if (cfg.options.cacheReset) {
|
|
131
129
|
cache.reset();
|
|
132
130
|
}
|
|
133
|
-
const failFast =
|
|
131
|
+
const failFast = cfg.options.failFast ?? configInfo.config.failFast ?? false;
|
|
134
132
|
const emitProgressBegin = (filename, fileNum, fileCount) => reporter.progress({
|
|
135
133
|
type: 'ProgressFileBegin',
|
|
136
134
|
fileNum,
|
|
@@ -142,16 +140,16 @@ async function runLint(cfg) {
|
|
|
142
140
|
fileNum,
|
|
143
141
|
fileCount,
|
|
144
142
|
filename,
|
|
145
|
-
elapsedTimeMs: result
|
|
146
|
-
processed: result
|
|
147
|
-
numErrors:
|
|
148
|
-
cached: result
|
|
143
|
+
elapsedTimeMs: result?.elapsedTimeMs,
|
|
144
|
+
processed: result?.processed,
|
|
145
|
+
numErrors: result?.issues.length || result?.errors,
|
|
146
|
+
cached: result?.cached,
|
|
149
147
|
});
|
|
150
148
|
async function* loadAndProcessFiles() {
|
|
151
149
|
let i = 0;
|
|
152
150
|
for await (const filename of files) {
|
|
153
151
|
++i;
|
|
154
|
-
emitProgressBegin(filename, i, fileCount
|
|
152
|
+
emitProgressBegin(filename, i, fileCount ?? i);
|
|
155
153
|
const result = await processFile(filename, configInfo, cache);
|
|
156
154
|
yield { filename, fileNum: i, result };
|
|
157
155
|
}
|
|
@@ -160,7 +158,7 @@ async function runLint(cfg) {
|
|
|
160
158
|
const { filename, fileNum, result } = await fileP;
|
|
161
159
|
status.files += 1;
|
|
162
160
|
status.cachedFiles = (status.cachedFiles || 0) + (result.cached ? 1 : 0);
|
|
163
|
-
emitProgressComplete(filename, fileNum, fileCount
|
|
161
|
+
emitProgressComplete(filename, fileNum, fileCount ?? fileNum, result);
|
|
164
162
|
// Show the spelling errors after emitting the progress.
|
|
165
163
|
result.issues.filter(cfg.uniqueFilter).forEach((issue) => reporter.issue(issue));
|
|
166
164
|
if (result.issues.length || result.errors) {
|
|
@@ -193,8 +191,7 @@ async function runLint(cfg) {
|
|
|
193
191
|
});
|
|
194
192
|
const dictCollection = await cspell.getDictionary(config);
|
|
195
193
|
dictCollection.dictionaries.forEach((dict) => {
|
|
196
|
-
|
|
197
|
-
const dictErrors = ((_a = dict.getErrors) === null || _a === void 0 ? void 0 : _a.call(dict)) || [];
|
|
194
|
+
const dictErrors = dict.getErrors?.() || [];
|
|
198
195
|
const msg = `Dictionary Error with (${dict.name})`;
|
|
199
196
|
dictErrors.forEach((error) => {
|
|
200
197
|
const key = msg + error.toString();
|
|
@@ -269,9 +266,8 @@ function checkGlobs(globs, reporter) {
|
|
|
269
266
|
.forEach((glob) => reporter.error('Linter', new errors_1.CheckFailed(`Glob starting or ending with ' (single quote) is not likely to match any files: ${glob}.`)));
|
|
270
267
|
}
|
|
271
268
|
async function determineGlobs(configInfo, cfg) {
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
const gitignoreRoots = (_c = cfg.options.gitignoreRoot) !== null && _c !== void 0 ? _c : configInfo.config.gitignoreRoot;
|
|
269
|
+
const useGitignore = cfg.options.gitignore ?? configInfo.config.useGitignore ?? false;
|
|
270
|
+
const gitignoreRoots = cfg.options.gitignoreRoot ?? configInfo.config.gitignoreRoot;
|
|
275
271
|
const gitIgnore = useGitignore ? await generateGitIgnore(gitignoreRoots) : undefined;
|
|
276
272
|
const cliGlobs = cfg.fileGlobs;
|
|
277
273
|
const allGlobs = cliGlobs.length ? cliGlobs : configInfo.config.files || [];
|
|
@@ -285,7 +281,6 @@ async function determineGlobs(configInfo, cfg) {
|
|
|
285
281
|
}
|
|
286
282
|
async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) {
|
|
287
283
|
async function _determineFilesToCheck() {
|
|
288
|
-
var _a;
|
|
289
284
|
const { fileLists } = cfg;
|
|
290
285
|
const hasFileLists = !!fileLists.length;
|
|
291
286
|
const { allGlobs, gitIgnore, fileGlobs, excludeGlobs, normalizedExcludes } = globInfo;
|
|
@@ -301,7 +296,7 @@ async function determineFilesToCheck(configInfo, cfg, reporter, globInfo) {
|
|
|
301
296
|
ignore: ignoreGlobs.concat(normalizedExcludes),
|
|
302
297
|
nodir: true,
|
|
303
298
|
};
|
|
304
|
-
const enableGlobDot =
|
|
299
|
+
const enableGlobDot = cfg.enableGlobDot ?? configInfo.config.enableGlobDot;
|
|
305
300
|
if (enableGlobDot !== undefined) {
|
|
306
301
|
globOptions.dot = enableGlobDot;
|
|
307
302
|
}
|
|
@@ -403,12 +398,12 @@ function getLoggerFromReporter(reporter) {
|
|
|
403
398
|
}
|
|
404
399
|
async function generateGitIgnore(roots) {
|
|
405
400
|
const root = (typeof roots === 'string' ? [roots].filter((r) => !!r) : roots) || [];
|
|
406
|
-
if (!
|
|
401
|
+
if (!root?.length) {
|
|
407
402
|
const cwd = process.cwd();
|
|
408
403
|
const repo = (await (0, cspell_gitignore_1.findRepoRoot)(cwd)) || cwd;
|
|
409
404
|
root.push(repo);
|
|
410
405
|
}
|
|
411
|
-
return new cspell_gitignore_1.GitIgnore(root
|
|
406
|
+
return new cspell_gitignore_1.GitIgnore(root?.map((p) => path.resolve(p)));
|
|
412
407
|
}
|
|
413
408
|
async function useFileLists(fileListFiles, includeGlobPatterns, root, dot) {
|
|
414
409
|
includeGlobPatterns = includeGlobPatterns.length ? includeGlobPatterns : ['**'];
|
|
@@ -58,9 +58,9 @@ class DiskCache {
|
|
|
58
58
|
async getCachedLintResults(filename) {
|
|
59
59
|
const fileDescriptor = this.fileEntryCache.getFileDescriptor(filename);
|
|
60
60
|
const meta = fileDescriptor.meta;
|
|
61
|
-
const data = meta
|
|
62
|
-
const result = data
|
|
63
|
-
const versionMatches = this.version ===
|
|
61
|
+
const data = meta?.data;
|
|
62
|
+
const result = data?.r;
|
|
63
|
+
const versionMatches = this.version === data?.v;
|
|
64
64
|
// Cached lint results are valid if and only if:
|
|
65
65
|
// 1. The file is present in the filesystem
|
|
66
66
|
// 2. The file has not changed since the time it was previously linted
|
|
@@ -124,7 +124,7 @@ class DiskCache {
|
|
|
124
124
|
calcDependencyHashes(dependsUponFiles) {
|
|
125
125
|
dependsUponFiles.sort();
|
|
126
126
|
const c = getTreeEntry(this.dependencyCacheTree, dependsUponFiles);
|
|
127
|
-
if (c
|
|
127
|
+
if (c?.d) {
|
|
128
128
|
return c.d;
|
|
129
129
|
}
|
|
130
130
|
const dependencies = dependsUponFiles.map((f) => this.getDependency(f));
|
|
@@ -179,10 +179,9 @@ class DiskCache {
|
|
|
179
179
|
}
|
|
180
180
|
exports.DiskCache = DiskCache;
|
|
181
181
|
function getTreeEntry(tree, keys) {
|
|
182
|
-
var _a;
|
|
183
182
|
let r = tree;
|
|
184
183
|
for (const k of keys) {
|
|
185
|
-
r =
|
|
184
|
+
r = r.c?.get(k);
|
|
186
185
|
if (!r)
|
|
187
186
|
return r;
|
|
188
187
|
}
|
|
@@ -196,7 +195,7 @@ function setTreeEntry(tree, deps, update = false) {
|
|
|
196
195
|
r.c = new Map();
|
|
197
196
|
}
|
|
198
197
|
const cn = r.c.get(k);
|
|
199
|
-
const n = cn
|
|
198
|
+
const n = cn ?? {};
|
|
200
199
|
if (!cn) {
|
|
201
200
|
r.c.set(k, n);
|
|
202
201
|
}
|
|
@@ -62,10 +62,9 @@ exports.Collection = Collection;
|
|
|
62
62
|
function addToCollection(root, v) {
|
|
63
63
|
const known = root.contains;
|
|
64
64
|
function addValToCol(c, v) {
|
|
65
|
-
var _a;
|
|
66
65
|
const t = toValueType(v);
|
|
67
66
|
const val = c.v || Object.create(null);
|
|
68
|
-
const r =
|
|
67
|
+
const r = val[t] ?? v;
|
|
69
68
|
val[t] = r;
|
|
70
69
|
c.v = val;
|
|
71
70
|
return val[t];
|
|
@@ -24,11 +24,10 @@ function createCache(options) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.createCache = createCache;
|
|
26
26
|
async function calcCacheSettings(config, cacheOptions, root) {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const cacheStrategy = (_g = (_f = cacheOptions.cacheStrategy) !== null && _f !== void 0 ? _f : cs.cacheStrategy) !== null && _g !== void 0 ? _g : 'metadata';
|
|
27
|
+
const cs = config.cache ?? {};
|
|
28
|
+
const useCache = cacheOptions.cache ?? cs.useCache ?? false;
|
|
29
|
+
const cacheLocation = await resolveCacheLocation(path_1.default.resolve(root, cacheOptions.cacheLocation ?? cs.cacheLocation ?? exports.DEFAULT_CACHE_LOCATION));
|
|
30
|
+
const cacheStrategy = cacheOptions.cacheStrategy ?? cs.cacheStrategy ?? 'metadata';
|
|
32
31
|
return {
|
|
33
32
|
useCache,
|
|
34
33
|
cacheLocation,
|
package/dist/util/errors.js
CHANGED
|
@@ -54,7 +54,7 @@ function toApplicationError(e, message) {
|
|
|
54
54
|
if (e instanceof ApplicationError && !message)
|
|
55
55
|
return e;
|
|
56
56
|
const err = toError(e);
|
|
57
|
-
return new ApplicationError(message
|
|
57
|
+
return new ApplicationError(message ?? err.message, undefined, err);
|
|
58
58
|
}
|
|
59
59
|
exports.toApplicationError = toApplicationError;
|
|
60
60
|
//# sourceMappingURL=errors.js.map
|
package/dist/util/fileHelper.js
CHANGED
|
@@ -39,13 +39,12 @@ const stdin_1 = require("./stdin");
|
|
|
39
39
|
const UTF8 = 'utf8';
|
|
40
40
|
const STDIN = 'stdin';
|
|
41
41
|
async function readConfig(configFile, root) {
|
|
42
|
-
var _a;
|
|
43
42
|
if (configFile) {
|
|
44
43
|
const config = (await cspell.loadConfig(configFile)) || {};
|
|
45
44
|
return { source: configFile, config };
|
|
46
45
|
}
|
|
47
46
|
const config = await cspell.searchForConfig(root);
|
|
48
|
-
return { source:
|
|
47
|
+
return { source: config?.__importRef?.filename || 'None found', config: config || {} };
|
|
49
48
|
}
|
|
50
49
|
exports.readConfig = readConfig;
|
|
51
50
|
function fileInfoToDocument(fileInfo, languageId, locale) {
|
|
@@ -92,10 +91,12 @@ async function findFiles(globPatterns, options) {
|
|
|
92
91
|
}
|
|
93
92
|
exports.findFiles = findFiles;
|
|
94
93
|
function calcFinalConfigInfo(configInfo, settingsFromCommandLine, filename, text) {
|
|
95
|
-
var _a, _b, _c;
|
|
96
94
|
const ext = path.extname(filename);
|
|
97
95
|
const fileSettings = cspell.calcOverrideSettings(configInfo.config, path.resolve(filename));
|
|
98
|
-
const loadDefault =
|
|
96
|
+
const loadDefault = settingsFromCommandLine.loadDefaultConfiguration ??
|
|
97
|
+
configInfo.config.loadDefaultConfiguration ??
|
|
98
|
+
fileSettings.loadDefaultConfiguration ??
|
|
99
|
+
true;
|
|
99
100
|
const settings = cspell.mergeSettings(cspell.getDefaultSettings(loadDefault), cspell.getGlobalSettings(), fileSettings, settingsFromCommandLine);
|
|
100
101
|
const languageIds = settings.languageId ? [settings.languageId] : cspell.getLanguagesForExt(ext);
|
|
101
102
|
const config = cspell.constructSettingsForText(settings, text, languageIds);
|
package/dist/util/glob.js
CHANGED
|
@@ -39,7 +39,7 @@ const useJoinPatterns = process.env['CSPELL_SINGLE_GLOB'];
|
|
|
39
39
|
* @param options - search options.
|
|
40
40
|
*/
|
|
41
41
|
async function globP(pattern, options) {
|
|
42
|
-
const root =
|
|
42
|
+
const root = options?.root || process.cwd();
|
|
43
43
|
const opts = options || { root };
|
|
44
44
|
const rawPatterns = typeof pattern === 'string' ? [pattern] : pattern;
|
|
45
45
|
const normPatterns = useJoinPatterns ? joinPatterns(rawPatterns) : rawPatterns;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"description": "A Spelling Checker for Code!",
|
|
5
5
|
"funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
},
|
|
71
71
|
"homepage": "https://streetsidesoftware.github.io/cspell/",
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@cspell/cspell-pipe": "^6.1.
|
|
73
|
+
"@cspell/cspell-pipe": "^6.1.3",
|
|
74
74
|
"chalk": "^4.1.2",
|
|
75
75
|
"commander": "^9.3.0",
|
|
76
|
-
"cspell-gitignore": "^6.1.
|
|
77
|
-
"cspell-glob": "^6.1.
|
|
78
|
-
"cspell-lib": "^6.1.
|
|
76
|
+
"cspell-gitignore": "^6.1.3",
|
|
77
|
+
"cspell-glob": "^6.1.3",
|
|
78
|
+
"cspell-lib": "^6.1.3",
|
|
79
79
|
"fast-json-stable-stringify": "^2.1.0",
|
|
80
80
|
"file-entry-cache": "^6.0.1",
|
|
81
81
|
"fs-extra": "^10.1.0",
|
|
@@ -90,21 +90,21 @@
|
|
|
90
90
|
"node": ">=14"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@cspell/cspell-json-reporter": "^6.1.
|
|
94
|
-
"@cspell/cspell-types": "^6.1.
|
|
93
|
+
"@cspell/cspell-json-reporter": "^6.1.3",
|
|
94
|
+
"@cspell/cspell-types": "^6.1.3",
|
|
95
95
|
"@types/file-entry-cache": "^5.0.2",
|
|
96
96
|
"@types/fs-extra": "^9.0.13",
|
|
97
97
|
"@types/glob": "^7.2.0",
|
|
98
98
|
"@types/imurmurhash": "^0.1.1",
|
|
99
99
|
"@types/micromatch": "^4.0.2",
|
|
100
100
|
"@types/minimatch": "^3.0.5",
|
|
101
|
-
"@types/semver": "^7.3.
|
|
101
|
+
"@types/semver": "^7.3.10",
|
|
102
102
|
"jest": "^28.1.1",
|
|
103
103
|
"micromatch": "^4.0.5",
|
|
104
104
|
"minimatch": "^5.1.0",
|
|
105
105
|
"rimraf": "^3.0.2",
|
|
106
|
-
"rollup": "^2.75.
|
|
106
|
+
"rollup": "^2.75.7",
|
|
107
107
|
"rollup-plugin-dts": "^4.2.2"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "e96b313542f2ec0a38ac04d1422d97e724ded3a6"
|
|
110
110
|
}
|