-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Upgrade cosmiconfig to 3.x #282
Comments
https://github.com/okonet/lint-staged/blob/master/package.json#L74 can be removed as well if we do that. |
3.0 is going to be released soon. We should update to that. |
Agreed! Let's wait. |
@sudo-suhas I didn't realize you're |
For that reason I've assigned you ;) Hope you don't mind. |
Ha ha.. It would be a pleasure 😁 |
yesss, we have @sudo-suhas here 🎉 |
@okonet cosmiconfig 3.0 has been released. I want to understand a couple of things before upgrading. Why do you think we should use caching and transform?
I think the cache and transform would have been relevant if we were invoking cosmiconfig now also supports loading the config synchronously. Would you like me to use that? |
I was under impression that using cache and transform will cache the transformed full config once (on the file system) and won't do that for any consequent calls. Since lint-staged config is rarely changed, I think it could improve the overall time of execution but I might be wrong. Also, transform will save us some work on getConfig optimization I hoped. |
I don't think we should use sync mode besides there are clear benefits of doing this. I'd like to stick the code style to be promise based for most parts. |
The cache is in-memory, not useful for our usage right now. But the file-system cache is a good idea. I might try to implement that in cosmiconfig. |
Good to know. Not sure how much benefit it will gain without inspecting the bottlenecks first. |
Wondering what was the use-case for caching in the first place. |
If you have something like stylelint, it has to call |
Yep. The reason I introduced caching was because stylelint wanted to switch from looking up a single configuration, once, to looking up a configuration for every particular file — allowing for different directories to use different configurations, but all linted in the same process. stylelint calls |
Okay so it seems to be a not so good fit for us... |
Want to note, too, that cosmicconfig@3 removes support for |
@neonsilk PR #304 adds support for |
https://github.com/davidtheclark/cosmiconfig 2.x offers caching and
transform
function that should potentially make #262 obsolete.The text was updated successfully, but these errors were encountered: