Skip to content

Commit

Permalink
fix: fix build exports (#21)
Browse files Browse the repository at this point in the history
- Disable prefer default export rule
- Use named exports in components
  • Loading branch information
amalv authored Nov 5, 2019
1 parent 9c647b0 commit 524e12b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
2,
{ devDependencies: ["**/test.tsx", "**/test.ts"] },
],
"import/prefer-default-export": "off",
"@typescript-eslint/indent": [2, 2],
quotes: ["error", "double"],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/RoundedButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { action } from "@storybook/addon-actions";
import RoundedButton from "./RoundedButton";
import { RoundedButton } from "./RoundedButton";

export default { title: "Rounded Button" };

Expand Down
6 changes: 2 additions & 4 deletions src/components/RoundedButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { ColorProperty } from "csstype";

export interface RoundedButtonProps {
Expand All @@ -8,7 +8,7 @@ export interface RoundedButtonProps {
children: React.ReactNode;
}

const RoundedButton: React.FC<RoundedButtonProps> = ({
export const RoundedButton: React.FC<RoundedButtonProps> = ({
color,
children,
onClick,
Expand All @@ -32,5 +32,3 @@ const RoundedButton: React.FC<RoundedButtonProps> = ({
{children}
</button>
);

export default RoundedButton;
2 changes: 1 addition & 1 deletion src/components/SignInButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import SignInButton from "./SignInButton";
import { SignInButton } from "./SignInButton";
import { FacebookIcon, GoogleIcon, EmailIcon } from "./SignIn.styles";

export default {
Expand Down
4 changes: 1 addition & 3 deletions src/components/SignInButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface SignInButtonProps {
children: React.ReactNode;
}

const SignInButton: React.FC<SignInButtonProps> = ({
export const SignInButton: React.FC<SignInButtonProps> = ({
borderColor,
icon,
children,
Expand All @@ -27,5 +27,3 @@ const SignInButton: React.FC<SignInButtonProps> = ({
</BaseButton>
</StylesProvider>
);

export default SignInButton;
4 changes: 2 additions & 2 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as RoundedButton } from "./RoundedButton";
export { default as SignInButton } from "./SignInButton";
export * from "./RoundedButton";
export * from "./SignInButton";

1 comment on commit 524e12b

@vercel
Copy link

@vercel vercel bot commented on 524e12b Nov 5, 2019

Choose a reason for hiding this comment

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

Please sign in to comment.