@@ -5,15 +5,9 @@ import { ComponentMerger } from '../merger/component-merger';
55import { ConfigMerger } from '../merger/config-merger' ;
66import { ConfigParser } from '../parser/config-parser' ;
77import type { ConfigMetadata } from '../registry/config-registry' ;
8- import {
9- ErrorHandler ,
10- FileSystemError ,
11- GenerationError ,
12- ValidationError ,
13- } from '../utils/error-handler' ;
148import { InputValidator } from '../utils/input-validator' ;
15- import { PathValidationError , PathValidator } from '../utils/path-validator' ;
16- import { createSpinner , SimpleSpinner } from '../utils/simple-spinner' ;
9+ import { PathValidator } from '../utils/path-validator' ;
10+ import { createSpinner } from '../utils/simple-spinner' ;
1711
1812export class ConfigGenerator {
1913 private parser : ConfigParser ;
@@ -37,7 +31,7 @@ export class ConfigGenerator {
3731 if ( ! outputDir ) {
3832 outputDir = '.' ;
3933 }
40-
34+
4135 // Normalize the path - this works for both absolute and relative paths
4236 // and doesn't require process.cwd()
4337 outputDir = path . normalize ( outputDir ) ;
@@ -91,7 +85,7 @@ export class ConfigGenerator {
9185 let agentsDir : string ;
9286 let commandsDir : string ;
9387 let hooksDir : string ;
94-
88+
9589 if ( path . isAbsolute ( outputDir ) ) {
9690 // For absolute paths (e.g., test temp directories), join directly
9791 claudeDir = path . join ( outputDir , '.claude' ) ;
@@ -206,12 +200,12 @@ export class ConfigGenerator {
206200
207201 // Validate the merged settings
208202 const validatedSettings = InputValidator . validateSettings ( mergedSettings ) ;
209-
203+
210204 // Debug: log validated settings
211205 if ( process . env . DEBUG ) {
212206 console . log ( 'Validated settings:' , JSON . stringify ( validatedSettings , null , 2 ) ) ;
213207 }
214-
208+
215209 const settingsPath = await PathValidator . createSafeFilePath (
216210 'settings.json' ,
217211 '.claude' ,
@@ -280,11 +274,15 @@ export class ConfigGenerator {
280274 try {
281275 await fs . access ( settingsPath ) ;
282276 const settingsContent = await fs . readFile ( settingsPath , 'utf-8' ) ;
283- const settings = JSON . parse ( settingsContent ) ;
277+ const _settings = JSON . parse ( settingsContent ) ;
284278 // Don't check for _metadata as it's not part of the Claude Code settings.json schema
285279 // Just verify the JSON is valid
286280 } catch ( error ) {
287- if ( error instanceof Error && 'code' in error && ( error as NodeJS . ErrnoException ) . code === 'ENOENT' ) {
281+ if (
282+ error instanceof Error &&
283+ 'code' in error &&
284+ ( error as NodeJS . ErrnoException ) . code === 'ENOENT'
285+ ) {
288286 errors . push ( 'Missing .claude/settings.json' ) ;
289287 } else {
290288 errors . push ( 'Invalid settings.json format' ) ;
@@ -293,5 +291,4 @@ export class ConfigGenerator {
293291
294292 return { valid : errors . length === 0 , errors } ;
295293 }
296-
297294}
0 commit comments