Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function checkText(filename: string, options: BaseOptions): Promise {
const configGlob = options.config || defaultConfigGlob;
const configGlobOptions = options.config ? {} : defaultConfigGlobOptions;
const pSettings = globP(configGlob, configGlobOptions).then(filenames => ({source: filenames[0], config: cspell.readSettingsFiles(filenames)}));
const [foundSettings, text] = await Promise.all([pSettings, readFile(filename)]);
const settingsFromCommandLine = util.clean({
languageId: options.languageId || undefined,
local: options.local || undefined,
});
const info = calcFinalConfigInfo(foundSettings, settingsFromCommandLine, filename, text);
return Validator.checkText(text, info.configInfo.config);
}