-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: add config path option #71
Comments
I ended up with a bit of time this afternoon to look at this, and it was fairly straightforward. Of course still open for discussion if there are opinions on how to implement! I decided to pass the config path through as a new parameter on export function getInput(
disk: Disk,
+ configPath: string | undefined,
program: Partial<SyncpackConfig>,
): ProgramInput Initially I considered passing this through with other options on the |
Released in 7.1.0 |
Very nice, thanks! 🎉 |
Description
Currently,
syncpack
only locates the config file (if present) withcosmiconfig
.Other tools, such as ESLint and Prettier, allow the user to specific a configuration path other than the normal one auto-detected. This can be useful for i.e. moving the config files out of the package root and into a
config/
folder. Allowing a custom config path would bringsyncpack
into parity with these tools.Suggested Solution
Add
-c
/--config
option to CLI:-i, --indent [value] override indentation. defaults to " " + -c, --config <path> path to a syncpack config file, overriding automatic detection -h, --help display help for command
When specified, use that path to locate the config file. If the file is not present, exit with an error.
When not specified, locate the config settings with
cosmiconfig
as normal.PR
Happy to look at submitting a PR on this.
The text was updated successfully, but these errors were encountered: