-
Notifications
You must be signed in to change notification settings - Fork 842
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 EuiIcon to TypeScript #1355
Conversation
if (COLORS.indexOf(color) > -1) { | ||
optionalColorClass = colorToClassMap[color]; | ||
if (color) { | ||
checkValidColor(color, type || 'empty'); |
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.
Interesting way to re-implement this prop type, I like it!
That babel warning is fine. It's on our roadmap to begin addressing EuiIcon's overall size. |
@chandlerprall I've pushed some review feedback, but the prop types generator fails on these again. Might be the |
Cancel that - everything's good after rebasing, so I've also inlined that interface that I mentioned above. 🙌 |
0658cb4
to
0cae82e
Compare
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.
LGTM, nice work!
Summary
Convert the
EuiIcon
component to TypeScript. Notes:tsc
andtslint
, as TSLint recommends that compilation run cleanly before linting.Something else to note is that I'm seeing the following warning when building EUI now:
True enough, if you look at the output in
lib/
, it's...ugly. I ran it through Prettier, and did the same formaster
, and the output varies in the expected ways but not by that much. Perhaps I just inched over the threshold? I did wonder if we should stop using the plugin and write a script to callsvgo
and generate actual component files instead? In any case, I started the docs site locally and the icons looked fine.Checklist