Skip to content

Commit d3f9f22

Browse files
committed
Add index, convert default to named exports
1 parent 525ce4e commit d3f9f22

30 files changed

Lines changed: 49 additions & 115 deletions

.eslintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// const error = 2;
2+
// const warn = 1;
3+
const ignore = 0;
4+
15
module.exports = {
26
root: true,
37
parser: 'babel-eslint',
@@ -15,6 +19,7 @@ module.exports = {
1519
jsxBracketSameLine: false,
1620
},
1721
],
22+
'import/prefer-default-export': ignore,
1823
'react/jsx-filename-extension': [
1924
1,
2025
{

src/components/basics/Avatar.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import styled, { css } from 'styled-components';
44
import { color, typography } from './shared/styles';
55
import { glow } from './shared/animation';
6-
import Icon from './Icon';
6+
import { Icon } from './Icon';
77

88
export const sizes = {
99
large: 40,
@@ -91,7 +91,7 @@ const Initial = styled.div`
9191
`}
9292
`;
9393

94-
function Avatar({ loading, username, src, size, ...props }) {
94+
export function Avatar({ loading, username, src, size, ...props }) {
9595
let avatarFigure = <Icon icon="useralt" />;
9696

9797
if (!loading) {
@@ -122,5 +122,3 @@ Avatar.defaultProps = {
122122
src: null,
123123
size: 'medium',
124124
};
125-
126-
export default Avatar;

src/components/basics/Avatar.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
33

4-
import Avatar from './Avatar';
4+
import { Avatar } from './Avatar';
55

66
storiesOf('basics/Avatar', module)
77
.addParameters({ component: Avatar })

src/components/basics/Badge.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ const BadgeWrapper = styled.div`
4848
`};
4949
`;
5050

51-
function Badge({ ...props }) {
51+
export function Badge({ ...props }) {
5252
return <BadgeWrapper {...props} />;
5353
}
54-
55-
export default Badge;

src/components/basics/Badge.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
3-
import Badge from './Badge';
3+
import { Badge } from './Badge';
44

55
storiesOf('basics/Badge', module)
66
.add('all badges', () => (

src/components/basics/Button.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ const ButtonWrapper = styled.button`
306306

307307
const ButtonLink = ButtonWrapper.withComponent('a');
308308

309-
function Button({ loading, loadingText, isLink, children, ...props }) {
309+
export function Button({ loading, loadingText, isLink, children, ...props }) {
310310
if (isLink) {
311311
return (
312312
<ButtonLink loading={loading} {...props}>
@@ -335,5 +335,3 @@ Button.defaultProps = {
335335
loadingText: null,
336336
isLink: false,
337337
};
338-
339-
export default Button;

src/components/basics/Button.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { storiesOf } from '@storybook/react';
3-
import Button from './Button';
4-
import Icon from './Icon';
3+
import { Button } from './Button';
4+
import { Icon } from './Icon';
55

66
storiesOf('basics/Button', module).add('all buttons', () => (
77
<div>

src/components/basics/Checkbox.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const Input = styled.input.attrs({ type: 'checkbox' })`
7474
}
7575
`;
7676

77-
function Checkbox({ label, error, ...props }) {
77+
export function Checkbox({ label, error, ...props }) {
7878
return (
7979
<Label>
8080
<Input {...props} type="checkbox" />
@@ -95,5 +95,3 @@ Checkbox.defaultProps = {
9595
label: null,
9696
error: null,
9797
};
98-
99-
export default Checkbox;

src/components/basics/Checkbox.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { action } from '@storybook/addon-actions';
44

5-
import Checkbox from './Checkbox';
5+
import { Checkbox } from './Checkbox';
66

77
const onChange = action('change');
88
storiesOf('basics/Checkbox', module)

src/components/basics/FormState.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function defaultBindings({ field, props, $try }) {
2727
return bindings;
2828
}
2929

30-
export default class FormData extends MobxReactForm {
30+
export class FormData extends MobxReactForm {
3131
constructor(fields, { plugins = { dvr: validatorjs }, hooks, options }) {
3232
super(fields, { plugins, hooks, options });
3333
}

0 commit comments

Comments
 (0)