How to use the cspell-lib.traceWords function in cspell-lib

To help you get started, we’ve selected a few cspell-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streetsidesoftware / cspell / packages / cspell / src / application.ts View on Github external
export async function trace(words: string[], options: TraceOptions): Promise {
    const configGlob = options.config || defaultConfigGlob;
    const configGlobOptions = options.config ? {} : defaultConfigGlobOptions;

    const configFiles = (await globP(configGlob, configGlobOptions)).filter(util.uniqueFn());
    const config = cspell.mergeSettings(cspell.getDefaultSettings(), cspell.getGlobalSettings(), cspell.readSettingsFiles(configFiles));
    const results = await traceWords(words, config);
    return results;
}