c12 icon indicating copy to clipboard operation
c12 copied to clipboard

option to fail if config not exists

Open genu opened this issue 8 months ago • 1 comments
trafficstars

Environment

Node v22.5.1

Reproduction

    const { config } = await loadConfig({ configFile: 'THIS_FILE_DOESNT_EXIST.ts' })

    console.log('loaded config: ', config)

Describe the bug

When loading a config, there isn't a way, as far as I can tell to know whether the config file was loaded or not:

The config file doesn't exist, nor does loadConfig raise an error about it. I would think that there should be a guarantee that the config was loaded after calling loadConfig or indicate that the config file failed to load.

Additional context

No response

Logs


genu avatar Feb 25 '25 16:02 genu