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

Convert highlight helper to Typescript #2532

Merged
merged 6 commits into from
Jan 23, 2021

Conversation

daniellesniak
Copy link

See #3533

@dsevillamartin
Copy link
Member

Should the types be removed from the jsdoc comment? 🤔

I feel like there's no reason to have them there twice. The JSDoc is still helpful for the description of the arguments.

@daniellesniak
Copy link
Author

daniellesniak commented Jan 10, 2021

You're right, I fixed that.

Edit/:
I misunderstood your guidelines and removed all types' descriptions from JSDoc in previous commit so I fixed my mistake in next one. It should be fine now.

js/src/common/helpers/highlight.ts Outdated Show resolved Hide resolved
js/src/common/helpers/highlight.ts Outdated Show resolved Hide resolved
@w-4
Copy link
Contributor

w-4 commented Jan 10, 2021

also: .tsx file extension

@daniellesniak
Copy link
Author

I made length parameter optional, everything else look fine to me.

Copy link
Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

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

Makes sense to me, thanks!

@dsevillamartin
Copy link
Member

I wonder - does m.trust() only return a Mithril.Vnode? I am unable to check right now.

@daniellesniak
Copy link
Author

daniellesniak commented Jan 19, 2021

It's written in documentation that m.trust() returns Vnode. The same return type is in interface.

Docs:
trust

Interface:
hyperscript interface

Should I change return type to Mithril.Vnode<any, any> as in interface instead of Mithril.Vnode?

@dsevillamartin
Copy link
Member

Should I change return type to Mithril.Vnode<any, any> as in interface instead of Mithril.Vnode?

I think so, yeah.

Copy link
Member

@dsevillamartin dsevillamartin left a comment

Choose a reason for hiding this comment

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

LGTM!

@askvortsov1 askvortsov1 merged commit b50d806 into flarum:master Jan 23, 2021
@daniellesniak daniellesniak deleted the dl/typescript-highlight branch January 25, 2021 18:40
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