@@ -8,6 +8,7 @@ import url from "node:url";
8
8
import { exit } from "specialist" ;
9
9
import readdir from "tiny-readdir-glob" ;
10
10
import zeptomatchEscape from "zeptomatch-escape" ;
11
+ import zeptomatchIsStatic from "zeptomatch-is-static" ;
11
12
import type { ContextOptions , FormatOptions , FunctionMaybe , Key , LogLevel , Options , PrettierConfigWithOverrides , PrettierPlugin } from "./types.js" ;
12
13
import type { PluginsOptions , PromiseMaybe } from "./types.js" ;
13
14
@@ -239,11 +240,6 @@ function isFunction(value: unknown): value is Function {
239
240
return typeof value === "function" ;
240
241
}
241
242
242
- function isGlobStatic ( glob : string ) : boolean {
243
- //TODO: Make this perfect, grammar-based, rather than letting some glob-looking paths slip through
244
- return / ^ (?: \\ .| [ a - z A - Z 0 - 9 / . _ - ] ) * $ / . test ( glob ) ;
245
- }
246
-
247
243
function isInteger ( value : unknown ) : value is number {
248
244
return Number . isInteger ( value ) ;
249
245
}
@@ -309,7 +305,7 @@ function normalizeOptions(options: unknown, targets: unknown[]): Options {
309
305
const cache = "cache" in options ? ! ! options . cache : true ;
310
306
const cacheLocation = "cacheLocation" in options && isString ( options . cacheLocation ) ? options . cacheLocation : undefined ;
311
307
const errorOnUnmatchedPattern = "errorOnUnmatchedPattern" in options ? ! ! options . errorOnUnmatchedPattern : true ;
312
- const ignoreUnknown = "ignoreUnknown" in options && isBoolean ( options . ignoreUnknown ) ? ! ! options . ignoreUnknown : globs . some ( isGlobStatic ) ;
308
+ const ignoreUnknown = "ignoreUnknown" in options && isBoolean ( options . ignoreUnknown ) ? ! ! options . ignoreUnknown : globs . some ( zeptomatchIsStatic ) ;
313
309
314
310
const logLevel = "logLevel" in options ? ( ( options . logLevel || "log" ) as LogLevel ) : "log" ;
315
311
const parallel = "parallel" in options && ! ! options . parallel ;
0 commit comments