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
Refactor to slightly simplify the code #7675
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mouvedia Thanks for the refactoring. Overall LGTM, but can you check my review comments?
lib/augmentConfig.mjs
Outdated
if (typeof lookup === 'string') { | ||
return getModulePath(configDir, lookup, cwd); | ||
} | ||
const cb = (/** @type { any } */ lookup) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggest] So, how about the following? ⬇️
const cb = (/** @type { any } */ lookup) => { | |
/** @type {<T>(lookup: T) => (string | T)} */ | |
const toAbsolutePath = (lookup) => { |
In addition, I prefer a more descriptive variable name over cb
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks great to me 😄
N/A