From 2c243466ea0188e3e2ded80ba60151198aca73d8 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Fri, 6 Mar 2026 13:36:39 +0000 Subject: [PATCH] fix(linter/plugins): define `RegExp.escape` for tsc --- apps/oxlint/src-js/globals.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/oxlint/src-js/globals.d.ts b/apps/oxlint/src-js/globals.d.ts index e4d19096f9bd6..5db7c9fd96e20 100644 --- a/apps/oxlint/src-js/globals.d.ts +++ b/apps/oxlint/src-js/globals.d.ts @@ -5,3 +5,9 @@ declare const DEBUG: boolean; // `true` if is build for conformance testing declare const CONFORMANCE: boolean; + +// `RegExp.escape` is not yet in TypeScript's lib types (available from ES2025). +// TODO: Remove this once TypeScript ships it. +interface RegExpConstructor { + escape(this: void, str: string): string; +}