unconfig
unconfig copied to clipboard
Allow glob pattern in sources
Suppose I want to find all config files below the current directory, I'd like to be able to do something like:
const { config, sources } = await unconfigLoad<MyConfig>({
cwd: directory,
sources: [
{
files: "**/my.config",
extensions: ["js", "ts"]
}
]
});
Does that introduce any weird complexity?
Great package btw. Super useful.
Sounds reasonable, PR welome
according to the current source (method [findUp] in fs.ts)
when we passing FindUpOptions = {multiple: true} then we will check all files in the [parent] path only like: /project/myprj -> /project -> /
should we browse the both sides as default? (parent and child) or add a new option for choosing which direction (parent or child) to check?
Sorry, I should have gotten back to this sooner. I ended up realizing that what I was about to implement was probably not be super useful for users, and might even complicate some things.
I do not need this anymore, feel free to close this issue.