refactor: deduplicate config lists and unify resolveFormatterBin branches

Extract BIOME_CONFIGS and PRETTIER_CONFIGS as shared constants to eliminate
duplication between PROJECT_ROOT_MARKERS and detectFormatter(). Unify the
biome/prettier branches in resolveFormatterBin() via a FORMATTER_PACKAGES
map. Remove redundant path.resolve() in quality-gate.js.
This commit is contained in:
Jonghyeok Park
2026-03-11 09:55:56 +09:00
parent 0a3afbe38f
commit 67841042d6
2 changed files with 33 additions and 52 deletions

View File

@@ -67,7 +67,7 @@ function maybeRunQualityGate(filePath) {
const strict = String(process.env.ECC_QUALITY_GATE_STRICT || '').toLowerCase() === 'true';
if (['.ts', '.tsx', '.js', '.jsx', '.json', '.md'].includes(ext)) {
const projectRoot = findProjectRoot(path.dirname(path.resolve(filePath)));
const projectRoot = findProjectRoot(path.dirname(filePath));
const formatter = detectFormatter(projectRoot);
if (formatter === 'biome') {