Replace strip-json-comments with jsonc-parser for better error reporting

This commit is contained in:
Chris Scott committed 2026-03-07 10:42:18 -05:00
1 parent e1890d0554
commit e1a4a70d3d
13 files changed
+132 -34

No files matched your search

+1 -4
View File
@@ -2,7 +2,7 @@ import { Database } from 'bun:sqlite'
import { unlinkSync, existsSync } from 'fs'
import { getOpenCodeConfigFilePath } from '@opencode-manager/shared/config/env'
import { logger } from '../utils/logger'
import stripJsonComments from 'strip-json-comments'
import { parseJsonc } from '@opencode-manager/shared/utils'
import type {
UserPreferences,
SettingsResponse,
@@ -25,9 +25,6 @@ interface OpenCodeConfigResponseWithRaw {
defaultConfig: OpenCodeConfigWithRaw | null
}
function parseJsonc(content: string): unknown {
return JSON.parse(stripJsonComments(content))
}
export class SettingsService {
private static lastKnownGoodConfigContent: string | null = null