Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow glob pattern in sources #16

Open
ecstrema opened this issue Feb 24, 2022 · 3 comments
Open

Allow glob pattern in sources #16

ecstrema opened this issue Feb 24, 2022 · 3 comments

Comments

@ecstrema
Copy link
Contributor

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.

@antfu
Copy link
Member

antfu commented Feb 24, 2022

Sounds reasonable, PR welome

@azaleta
Copy link

azaleta commented Mar 22, 2022

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?

@ecstrema
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants