-
Notifications
You must be signed in to change notification settings - Fork 367
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
chore: enhance types for base-command.ts #6261
Conversation
export const getPluginsToAutoInstall = (pluginsInstalled = [], pluginsRecommended = []) => | ||
pluginsRecommended.reduce( | ||
export const getPluginsToAutoInstall = ( | ||
command: BaseCommand, |
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.
I don't see this parameter used anywhere - am I missing something?
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.
Nope it is a prerequisite for the follow up PR just forgot to remove it from this one. In the follow up I need to access the feature flags from the base command.
/** @private */ | ||
noBaseOptions = false | ||
|
||
#noBaseOptions = false |
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.
Can we not use private noBaseOptions
?
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.
TypeScript private is not a JavaScript private this is truly private and not accessible after transpiling.
TBH I would prefer this notation over using they private keyword as this is just dropped on transpiling
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.
Do we care if it's truly private or not, though? This is not a public interface we're exposing to user code. I think we should focus on code readability and type safety, and having to prefix every private property with #
feels a bit awkward and noisy to me, personally.
@@ -613,7 +548,8 @@ export default class BaseCommand extends Command { | |||
certificateFile: flags.httpProxyCertificateFilename, | |||
}) | |||
const apiOpts = { ...apiUrlOpts, agent } | |||
const api = new NetlifyAPI(token || '', apiOpts) | |||
// TODO: remove typecast once we have proper types for the API |
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 for submitting a pull request! 🎉
Summary
To not have my change and the types refactoring in one PR this is just the PR for the types refactorings.
The actual change will come in a follow-up.
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)