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

enable typescript in project #5

Merged
merged 1 commit into from
Jan 23, 2020
Merged

enable typescript in project #5

merged 1 commit into from
Jan 23, 2020

Conversation

alaboudi
Copy link
Contributor

This PR enables us to use typescript in the design system

Comment on lines +9 to +23
webpackFinal: async config => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('ts-loader'),
},
{
loader: require.resolve('react-docgen-typescript-loader'),
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out that the typescript-preset actually has an error 🤦‍♀️. This manual step is required till the PR fix is merged in.

Copy link
Contributor

Choose a reason for hiding this comment

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

For reference, here is the link to the related github issue: storybookjs/presets#65

@@ -0,0 +1,8 @@
import * as React from "react";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm trying to figure out how to write import React from "react" rather than import * as React from "react". If you know how, your contribution is welcomed 🙃

Copy link
Contributor

Choose a reason for hiding this comment

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

Try #typescript on the rangle slack. Maybe it is not loading types correctly from node_modules/@types.

@sachasayan
Copy link
Contributor

Looks great.

@alaboudi alaboudi force-pushed the enable-ts branch 2 times, most recently from a5e66a1 to 27edc0f Compare January 23, 2020 16:25
@alaboudi alaboudi merged commit 40190fd into master Jan 23, 2020
@winkerVSbecks winkerVSbecks deleted the enable-ts branch March 30, 2020 18:18
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