diff --git a/eslint.config.mjs b/eslint.config.mjs index 391214cb6184..433085ceae89 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -322,6 +322,7 @@ export default defineConfig( 'jsdoc/tag-lines': 'off', 'regexp/no-dupe-disjunctions': 'error', + 'regexp/no-missing-g-flag': 'error', 'regexp/no-useless-character-class': 'error', 'regexp/no-useless-flag': 'error', 'regexp/no-useless-lazy': 'error', diff --git a/packages/website/src/components/editor/createProvideTwoslashInlay.ts b/packages/website/src/components/editor/createProvideTwoslashInlay.ts index 7ec378b4aff7..89f3c7bb26ce 100644 --- a/packages/website/src/components/editor/createProvideTwoslashInlay.ts +++ b/packages/website/src/components/editor/createProvideTwoslashInlay.ts @@ -9,7 +9,7 @@ import type { SandboxInstance } from './useSandboxServices'; function findTwoshashQueries(code: string): RegExpExecArray[] { // RegExp that matches '^//?$' - const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/m; + const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/gm; return [...code.matchAll(twoslashQueryRegex)]; }