Skip to content

Commit 92dcd71

Browse files
More efficiently discarding non-already-ignored matches
1 parent 9618b6c commit 92dcd71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ async function runGlobs(options: Options, pluginsOptions: PluginsOptions): Promi
103103
//TODO: Maybe do work in chunks here, as keeping too many formatted files in memory can be a problem
104104
const filesResults = await Promise.allSettled(
105105
filesPathsTargets.map(async (filePath) => {
106-
const isIgnored = () => !ignoreFiles.length && (ignoreManual ? ignoreManual(filePath) : getIgnoreResolved(filePath, ignoreNames));
106+
const isIgnored = () => (ignoreManual ? ignoreManual(filePath) : getIgnoreResolved(filePath, ignoreNames));
107107
const isCacheable = () => cache?.has(filePath, isIgnored);
108-
const ignored = cache ? !(await isCacheable()) : await isIgnored();
108+
const ignored = !ignoreFiles.length && (cache ? !(await isCacheable()) : await isIgnored());
109109
if (ignored) return;
110110
const getFormatOptions = async (): Promise<FormatOptions> => {
111111
const editorConfig = options.editorConfig ? getEditorConfigFormatOptions(await getEditorConfigResolved(filePath, editorConfigNames)) : {};

0 commit comments

Comments
 (0)