Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Jun 12, 2019
1 parent d963ec6 commit be7bc0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
8 changes: 5 additions & 3 deletions src/gulp/createToc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import hash from 'object-hash';
import path from 'path';
import through2 from 'through2';
import vinyl from 'vinyl';
import { IInteraction, IStories, ITOC } from '~/stories/stories.toc';
import { IInteraction, IStories, ITOC } from '~/stories/stories.toc.d';

/** Build TOC data. */
class ScenarioBuilder {
Expand All @@ -20,8 +20,10 @@ class ScenarioBuilder {
callback
) => {
if (!chunk.isNull() && chunk.relative) {
const src = `~/stories/${chunk.relative}`;
const { default: story, interactions } = (await import(src)) as IStories;
const source = `~/stories/${chunk.relative}`;
const { default: story, interactions } = (await import(
source
)) as IStories;
this.interactionsMap.set(story().kind, interactions || []);
}
callback(undefined, chunk);
Expand Down
18 changes: 1 addition & 17 deletions src/stories/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { withKnobs, text } from '@storybook/addon-knobs/react';
import { storiesOf } from '@storybook/react';
import React from 'react';
import { IInteraction } from './stories.toc';
import { IInteraction } from './stories.toc.d';

/** Interactions definition for BackstopJS. */
export const interactions: IInteraction[] = [
Expand All @@ -19,19 +19,3 @@ export default () =>
storiesOf('Welcome', module)
.addDecorator(withKnobs)
.add('to Storybook', () => <div>{text('title', 'Hello')}</div>);

// import { Button, Welcome } from '@storybook/react/demo';
// import { action } from '@storybook/addon-actions';
// import { linkTo } from '@storybook/addon-links';

// storiesOf('Button', module)
// .add('with text', () => (
// <Button onClick={action('clicked')}>Hello Button</Button>
// ))
// .add('with some emoji', () => (
// <Button onClick={action('clicked')}>
// <span role="img" aria-label="so cool">
// 馃榾 馃槑 馃憤 馃挴
// </span>
// </Button>
// ));
2 changes: 1 addition & 1 deletion src/stories/stories.toc.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Story } from '@storybook/react';

import { IBackstopScenarioOptions } from '../../backstop_data/engine_scripts/backstop';
import { IBackstopScenarioOptions } from '../../backstop_data/engine_scripts/backstop.d';

/** Definition of component interactions scenario. */
export interface IInteraction extends Partial<IBackstopScenarioOptions> {
Expand Down

0 comments on commit be7bc0a

Please sign in to comment.