-
Notifications
You must be signed in to change notification settings - Fork 10
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
Option to skip file content reading #41
Comments
Hello and thank you for suggestion. While I agree this makes since in a subset of scenarios. This was a conscious decision to be compatible with cosmiconfig |
I've given this more thought and I think this is a good idea. I will release a new minor version where a new option like |
When using custom loaders, a simple approach could be to detect the number of arguments of the loader using const loaderKey = path.extname(searchPlace) || 'noExt';
const loader = loaders[loaderKey];
const content = loader.length === 1 ? undefined : String(await fsReadFileAsync(filepath)); EDIT: For reference, I implented something like this in lint-staged naive config loading: lint-staged/lint-staged@dc0fe71#diff-bff4b732db5b89cc001efe07fb282c50542546d6ccd1f7ee2053f7ff5afdd89dR102 |
I think the loaders can read the file themself, it's not necessary to provide the content to
loader
.lilconfig/src/index.ts
Line 257 in b056bd8
The text was updated successfully, but these errors were encountered: