Skip to content
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(gatsby): Convert get-static-dir to typescript #22083

Merged
merged 4 commits into from
Mar 9, 2020

Conversation

mottox2
Copy link
Contributor

@mottox2 mottox2 commented Mar 9, 2020

Description

Convert utils/get-static-dir to typescript

Related Issues

Related to #21995


/**
* copyStaticDirs
* --
* Copy files from the static directory to the public directory
*/
exports.copyStaticDirs = () => {
export const copyStaticDirs = (): void | Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you look into what it would take to make this always return Promise and what impacts that would have on any consuming functions? I don't like the difference in return types here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of returning Promise.resolve, he can just return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MichaelDeBoey!
I return undefined instead of Promise.resolve to pass consistent-return rule.

Copy link
Contributor

@blainekasten blainekasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@blainekasten blainekasten merged commit 509339f into gatsbyjs:master Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants