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

chore: lint import order #104

Merged
merged 2 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Parameters } from '@storybook/addons';
import { withThemer, themeNames } from '../docs/themer/react';
import { withSpacer } from '../docs/spacer/react';
import { withIcons } from '../docs/icons/react';
import { withSpacer } from '../docs/spacer/react';
import { themeNames, withThemer } from '../docs/themer/react';
import { storySort } from './storySort';
import './styles.scss';

Expand Down
2 changes: 1 addition & 1 deletion .storybook/storySort.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StorySortComparator, Parameters } from '@storybook/addons';
import { Parameters, StorySortComparator } from '@storybook/addons';

// sorts stories naturally by kind, then by ID
export const storySort: StorySortComparator = ([_, a]: Story, [__, b]: Story) =>
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/_core.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Primary, Stories } from '@storybook/addon-docs/blocks';
import React from 'react';

const docsPage = () => (
<>
Expand Down
9 changes: 5 additions & 4 deletions docs/_core/borders/borders.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Primary, Stories, Title } from '@storybook/addon-docs/blocks';
import React from 'react';
import { Title, Primary, Stories } from '@storybook/addon-docs/blocks';
import { Examples } from './examples.story';
import { Helpers } from './helpers.story';
import { Intro } from './intro.story';

const docsPage = () => (
<>
Expand All @@ -16,6 +19,4 @@ export default {
},
};

export { Intro } from './intro.story';
export { Examples } from './examples.story';
export { Helpers } from './helpers.story';
export { Intro, Examples, Helpers };
josokinas marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion docs/_core/borders/examples.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { BorderRadius, borderRadius } from '@onfido/castor';
import React from 'react';
import styles from './borders.scss';

export const Examples = () => (
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/borders/helpers.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Helpers = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/borders/intro.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Intro = () => (
<>
Expand Down
7 changes: 4 additions & 3 deletions docs/_core/colors/colors.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Primary, Stories, Title } from '@storybook/addon-docs/blocks';
import React from 'react';
import { Title, Primary, Stories } from '@storybook/addon-docs/blocks';
import { Helpers } from './helpers.story';
import { Intro } from './intro.story';

const docsPage = () => (
<>
Expand All @@ -16,5 +18,4 @@ export default {
},
};

export { Intro } from './intro.story';
export { Helpers } from './helpers.story';
export { Intro, Helpers };
2 changes: 1 addition & 1 deletion docs/_core/colors/helpers.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Helpers = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/colors/intro.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Intro = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/intro.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Intro = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/spacing/helpers.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Helpers = () => (
<>
Expand Down
9 changes: 5 additions & 4 deletions docs/_core/spacing/spacing.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Primary, Stories, Title } from '@storybook/addon-docs/blocks';
import React from 'react';
import { Title, Primary, Stories } from '@storybook/addon-docs/blocks';
import { Examples } from './examples.story';
import { Helpers } from './helpers.story';
import { Intro } from './intro.story';

const docsPage = () => (
<>
Expand All @@ -16,6 +19,4 @@ export default {
},
};

export { Intro } from './intro.story';
export { Examples } from './examples.story';
export { Helpers } from './helpers.story';
export { Intro, Examples, Helpers };
2 changes: 1 addition & 1 deletion docs/_core/typography/examples.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { font, FontName } from '@onfido/castor';
import React from 'react';
import { FontName, font } from '@onfido/castor';
import styles from './typography.scss';

export const Examples = () => (
Expand Down
2 changes: 1 addition & 1 deletion docs/_core/typography/helpers.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Helpers = () => (
<>
Expand Down
9 changes: 5 additions & 4 deletions docs/_core/typography/typography.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Primary, Stories, Title } from '@storybook/addon-docs/blocks';
import React from 'react';
import { Title, Primary, Stories } from '@storybook/addon-docs/blocks';
import { Examples } from './examples.story';
import { Helpers } from './helpers.story';
import { Intro } from './intro.story';

const docsPage = () => (
<>
Expand All @@ -16,6 +19,4 @@ export default {
},
};

export { Intro } from './intro.story';
export { Examples } from './examples.story';
export { Helpers } from './helpers.story';
export { Intro, Examples, Helpers };
2 changes: 1 addition & 1 deletion docs/_react/_react.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Primary, Stories } from '@storybook/addon-docs/blocks';
import React from 'react';

const docsPage = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/_react/intro.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Source } from '@storybook/components';
import React from 'react';

export const Intro = () => (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs/icons/react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Icons } from '@onfido/castor-icons';
import React from 'react';

export function withIcons(storyFn: () => JSX.Element): JSX.Element {
const story = storyFn();
Expand Down
3 changes: 1 addition & 2 deletions docs/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import tokens from './tokens.scss';

export * from './docs';
export * from './storyOf';
export * from './Story';

export * from './storyOf';
export { tokens };
2 changes: 1 addition & 1 deletion docs/storyOf/storyOf.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, ReactNode, Fragment, createElement } from 'react';
import React, { createElement, FC, Fragment, ReactNode } from 'react';
import { Story } from '../Story';
import styles from './storyOf.scss';

Expand Down
4 changes: 2 additions & 2 deletions docs/themer/react.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { StoryContext } from '@storybook/addons';
import { switchTheme } from '@onfido/castor';
import { StoryContext } from '@storybook/addons';
import { useEffect } from 'react';
import './themes.scss';

export function withThemer(
Expand Down
2 changes: 1 addition & 1 deletion examples/html-css-js-parcel/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './index.css';
import { App } from './app';
import './index.css';

document.body.innerHTML = App();
2 changes: 1 addition & 1 deletion examples/html-scss-ts-parcel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './index.scss';
import { App } from './app';
import './index.scss';

document.body.innerHTML = App();
2 changes: 1 addition & 1 deletion examples/react-emotion-ts-parcel/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled';
import { borderRadius, color, space } from '@onfido/castor';
import { IconPassport, Icons } from '@onfido/castor-icons';
import { Button, Icon } from '@onfido/castor-react';
import { Icons, IconPassport } from '@onfido/castor-icons';
import React from 'react';

export const App = () => (
Expand Down
2 changes: 1 addition & 1 deletion examples/react-scss-js-webpack/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IconPassport, Icons } from '@onfido/castor-icons';
import { Button, Icon } from '@onfido/castor-react';
import { Icons, IconPassport } from '@onfido/castor-icons';
import React from 'react';
import styles from './App.scss';

Expand Down
4 changes: 2 additions & 2 deletions examples/react-scss-js-webpack/src/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import '@onfido/castor/dist/castor.css';
import '@onfido/castor/dist/themes/day.css';
import React from 'react';
import { render } from 'react-dom';
import { App } from './App';
import '@onfido/castor/dist/castor.css';
import '@onfido/castor/dist/themes/day.css';
import './index.css';

render(<App />, document.getElementById('root'));
2 changes: 1 addition & 1 deletion examples/react-scss-ts-parcel/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IconPassport, Icons } from '@onfido/castor-icons';
import { Button, Icon } from '@onfido/castor-react';
import { Icons, IconPassport } from '@onfido/castor-icons';
import React from 'react';
import styles from './App.scss';

Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/button/button.react.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { SyntheticEvent } from 'react';
import { space } from '@onfido/castor';
import { IconName, iconNames } from '@onfido/castor-icons';
import { Meta, Story, omit, storyOf } from '../../../../docs';
import React, { SyntheticEvent } from 'react';
import { Icon } from '../';
import { ButtonProps, Button } from './button.react';
import { Meta, omit, Story, storyOf } from '../../../../docs';
import { Button, ButtonProps } from './button.react';

export default {
title: 'React/Button',
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/button/button.react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { HTMLAttributes } from 'react';
import { ButtonProps as BaseProps, c, classy, m } from '@onfido/castor';
import React, { HTMLAttributes } from 'react';

export const Button: ButtonComponent = ({
kind = 'action',
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/icon/icon.react.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { Color } from '@onfido/castor';
import { iconNames } from '@onfido/castor-icons';
import { Meta, Story, omit, storyOf, tokens } from '../../../../docs';
import { IconProps, Icon } from './icon.react';
import React from 'react';
import { Meta, omit, Story, storyOf, tokens } from '../../../../docs';
import { Icon, IconProps } from './icon.react';

const colors = Object.keys(tokens).reduce((accumulator, name) => {
const [, color] = name.match(/^--color-([a-z0-9-]+)$/) ?? [];
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/icon/icon.react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { c, classy, color, IconProps as BaseProps } from '@onfido/castor';
import React from 'react';

/**
* Please note that this component requires an SVG sprite to be inlined in your
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/input/input.react.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Meta, Story, omit, storyOf } from '../../../../docs';
import { InputProps, Input } from './input.react';
import { Meta, omit, Story, storyOf } from '../../../../docs';
import { Input, InputProps } from './input.react';

export default {
title: 'React/Input',
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/input/input.react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { c, classy, InputProps as BaseProps, m } from '@onfido/castor';
import React from 'react';
import { c, classy, m, InputProps as BaseProps } from '@onfido/castor';

export const Input = ({
type = 'text',
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/textarea/textarea.react.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Meta, Story, omit, storyOf } from '../../../../docs';
import { TextareaProps, Textarea } from './textarea.react';
import { Meta, omit, Story, storyOf } from '../../../../docs';
import { Textarea, TextareaProps } from './textarea.react';

export default {
title: 'React/Textarea',
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/textarea/textarea.react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { c, classy, m, TextareaProps as BaseProps } from '@onfido/castor';
import React from 'react';

export const Textarea = ({
resize = 'vertical',
Expand Down