fix: reduce global react doctor warnings (#214)

This commit is contained in:
Eyejoker
2026-06-03 08:30:24 +08:00
committed by GitHub
parent 22602da1ec
commit 2dab27f443
5 changed files with 41 additions and 45 deletions

View File

@@ -16,6 +16,7 @@ export function readCodexFeatureFromContent(
feature: CodexConfigFeature,
): boolean {
const lines = content.split('\n');
const featureLinePattern = new RegExp(`^${feature}\\s*=\\s*(true|false)$`);
let inFeatures = false;
for (const line of lines) {
@@ -28,9 +29,7 @@ export function readCodexFeatureFromContent(
break;
}
if (!inFeatures) continue;
const match = trimmed.match(
new RegExp(`^${feature}\\s*=\\s*(true|false)$`),
);
const match = trimmed.match(featureLinePattern);
if (match) return match[1] === 'true';
}