mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
FIX ts errors
This commit is contained in:
parent
c1e3cd730b
commit
faf99cc5fe
@ -26,7 +26,7 @@ const Icon = styled(Icons)({
|
||||
marginRight: 4,
|
||||
});
|
||||
|
||||
const RotatingIcon = styled(Icon)(({ theme }) => ({
|
||||
const RotatingIcon = styled(Icon)<{}>(({ theme }) => ({
|
||||
animation: `${theme.animation.rotate360} 1s linear infinite;`,
|
||||
}));
|
||||
|
||||
|
@ -24,6 +24,7 @@ interface ParsingResult<T> {
|
||||
}
|
||||
|
||||
const ACORN_WALK_VISITORS = {
|
||||
// @ts-ignore
|
||||
...acornWalk.base,
|
||||
JSXElement: () => {},
|
||||
};
|
||||
@ -43,6 +44,7 @@ function calculateNodeDepth(node: estree.Expression): number {
|
||||
const depths: number[] = [];
|
||||
|
||||
acornWalk.ancestor(
|
||||
// @ts-ignore
|
||||
node,
|
||||
{
|
||||
ObjectExpression(_: any, ancestors: estree.Node[]) {
|
||||
@ -82,6 +84,7 @@ function parseFunction(
|
||||
|
||||
// If there is at least a JSXElement in the body of the function, then it's a React component.
|
||||
acornWalk.simple(
|
||||
// @ts-ignore
|
||||
funcNode.body,
|
||||
{
|
||||
JSXElement(node: any) {
|
||||
@ -117,6 +120,7 @@ function parseClass(
|
||||
|
||||
// If there is at least a JSXElement in the body of the class, then it's a React component.
|
||||
acornWalk.simple(
|
||||
// @ts-ignore
|
||||
classNode.body,
|
||||
{
|
||||
JSXElement(node: any) {
|
||||
|
@ -58,7 +58,9 @@ export const StoryPanel: React.FC<StoryPanelProps> = ({ api }) => {
|
||||
if (story) {
|
||||
const {
|
||||
parameters: {
|
||||
// @ts-ignore
|
||||
mdxSource = '',
|
||||
// @ts-ignore
|
||||
storySource: { source, locationsMap } = { source: '', locationsMap: {} },
|
||||
} = {},
|
||||
} = story;
|
||||
|
@ -57,7 +57,7 @@
|
||||
"webpack": "^4.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-api": "6.0.0-alpha.15",
|
||||
"@storybook/client-api": "6.0.0-alpha.20",
|
||||
"@types/mini-css-extract-plugin": "^0.9.0",
|
||||
"@types/node": "^13.5.3",
|
||||
"@types/webpack": "^4.41.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user