diff --git a/test/internal/ban-limits.json b/test/internal/ban-limits.json index 90247d51da..9994ceb9d3 100644 --- a/test/internal/ban-limits.json +++ b/test/internal/ban-limits.json @@ -7,7 +7,7 @@ ".stdDir()": 40, ".stdFile()": 18, "// autofix": 168, - ": [a-zA-Z0-9_\\.\\*\\?\\[\\]\\(\\)]+ = undefined,": 228, + ": [^=]+= undefined,$": 261, "== alloc.ptr": 0, "== allocator.ptr": 0, "@import(\"bun\").": 0, diff --git a/test/internal/ban-words.test.ts b/test/internal/ban-words.test.ts index 9e8edb43b9..8660778656 100644 --- a/test/internal/ban-words.test.ts +++ b/test/internal/ban-words.test.ts @@ -31,7 +31,7 @@ const words: Record = { "== alloc.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" }, "!= alloc.ptr": { reason: "The std.mem.Allocator context pointer can be undefined, which makes this comparison undefined behavior" }, - [String.raw`: [a-zA-Z0-9_\.\*\?\[\]\(\)]+ = undefined,`]: { reason: "Do not default a struct field to undefined", regex: true }, + ": [^=]+= undefined,$": { reason: "Do not default a struct field to undefined", regex: true }, "usingnamespace": { reason: "Zig 0.15 will remove `usingnamespace`" }, "std.fs.Dir": { reason: "Prefer bun.sys + bun.FD instead of std.fs" }, @@ -69,7 +69,7 @@ for (const source of sources) { if (source.startsWith("src" + path.sep + "codegen")) continue; const content = await file(source).text(); for (const word of words_keys) { - let regex = words[word].regex ? new RegExp(word, "g") : undefined; + let regex = words[word].regex ? new RegExp(word, "gm") : undefined; const did_match = regex ? regex.test(content) : content.includes(word); if (regex) regex.lastIndex = 0; if (did_match) {