Skip to content

Commit

Permalink
build(storybook): add ts check on storybook on linting (#132)
Browse files Browse the repository at this point in the history
This PR add a ts checks also on typescript stories to avoid having a broken master.
  • Loading branch information
markov00 authored Mar 29, 2019
1 parent 092e7f4 commit 56b173d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
"start": "yarn storybook",
"storybook": "start-storybook -p 9001 -c .storybook",
"storybook:build": "rm -rf .out && build-storybook -c .storybook -o .out",
"lint": "yarn build:ts --noEmit && tslint -c ./tslint.yaml -p ./tsconfig.json",
"lint": "yarn typecheck:all && tslint -c ./tslint.yaml -p ./tsconfig.json",
"lint:fix": "yarn lint --fix",
"prettier": "prettier --check --debug-check \"**/*.{ts,tsx}\"",
"prettier:fix": "prettier --write \"{,!(node_modules)/}**/*.{ts,tsx}\"",
"test": "jest --config jest.config.json",
"watch": "yarn test --watch",
"format:fix": "yarn prettier:fix && yarn lint:fix",
"format:check": "yarn prettier && yarn lint",
"style:fix": "tsc -p ./tsconfig.json --noEmit && yarn prettier-tslint fix \"{,!(node_modules)/}**/*.{ts,tsx}\"",
"semantic-release": "semantic-release"
"style:fix": "yarn typecheck:src && yarn prettier-tslint fix \"{,!(node_modules)/}**/*.{ts,tsx}\"",
"semantic-release": "semantic-release",
"typecheck:src": "yarn build:ts --noEmit",
"typecheck:all": "tsc -p ./tsconfig.all.json --noEmit"
},
"files": [
"dist/**/*",
Expand Down
30 changes: 16 additions & 14 deletions stories/interactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ storiesOf('Interactions', module)
linear: ScaleType.Linear,
log: ScaleType.Log,
};

const xScaleType = ScaleType.Linear;
const yScaleType = select('yScaleType', yScaleTypeOptions, ScaleType.Linear, specChange);

const xAccessorOptions = { x: 'x', y1: 'y1', y2: 'y2' };
Expand All @@ -215,19 +213,14 @@ storiesOf('Interactions', module)

const data = hasAdditionalG1Value ? [...seriesData, additionalG1Value] : seriesData;

const barSeriesProps = {
xScaleType,
yScaleType,
xAccessor,
yAccessors,
splitSeriesAccessors,
data,
yScaleToDataExtent,
};

return (
<Chart renderer="canvas" className={'story-chart'}>
<Settings showLegend={true} legendPosition={Position.Right} {...onLegendItemListeners} xDomain={xDomain} />
<Settings
showLegend={true}
legendPosition={Position.Right}
{...onLegendItemListeners}
xDomain={xDomain}
/>
<Axis
id={getAxisId('bottom')}
position={Position.Bottom}
Expand All @@ -242,7 +235,16 @@ storiesOf('Interactions', module)
domain={yDomain}
/>

<BarSeries id={getSpecId('bars')} {...barSeriesProps} />
<BarSeries
id={getSpecId('bars')}
xScaleType={ScaleType.Linear}
yScaleType={yScaleType}
xAccessor={xAccessor}
yAccessors={yAccessors}
splitSeriesAccessors={splitSeriesAccessors}
data={data}
yScaleToDataExtent={yScaleToDataExtent}
/>
</Chart>
);
})
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig",
"include": ["stories/**/*"]
}

0 comments on commit 56b173d

Please sign in to comment.