From 73d821fe3aaf387cc72563bede06d791322354ff Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 29 Jun 2022 21:07:07 +0200 Subject: [PATCH 1/2] cleanup --- lib/blocks/src/blocks/useStory.ts | 1 + lib/blocks/src/controls/Boolean.tsx | 1 - lib/blocks/src/controls/options/Checkbox.tsx | 4 ++-- lib/blocks/src/controls/options/Radio.tsx | 6 ------ lib/cli/src/generators/baseGenerator.ts | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/blocks/src/blocks/useStory.ts b/lib/blocks/src/blocks/useStory.ts index a9caa893001..6c56b695570 100644 --- a/lib/blocks/src/blocks/useStory.ts +++ b/lib/blocks/src/blocks/useStory.ts @@ -21,6 +21,7 @@ export function useStories( const [storiesById, setStories] = useState>>({}); useEffect(() => { + // deepscan-disable-next-line NO_EFFECT_CALL Promise.all( storyIds.map(async (storyId) => { // loadStory will be called every single time useStory is called diff --git a/lib/blocks/src/controls/Boolean.tsx b/lib/blocks/src/controls/Boolean.tsx index a7ab0596ef1..d2ee8167b16 100644 --- a/lib/blocks/src/controls/Boolean.tsx +++ b/lib/blocks/src/controls/Boolean.tsx @@ -78,7 +78,6 @@ const Label = styled.label(({ theme }) => ({ }, })); -const format = (value: BooleanValue): string | null => (value ? String(value) : null); const parse = (value: string | null): boolean => value === 'true'; export type BooleanProps = ControlProps & BooleanConfig; diff --git a/lib/blocks/src/controls/options/Checkbox.tsx b/lib/blocks/src/controls/options/Checkbox.tsx index 029a50273a9..0e2afe03c1a 100644 --- a/lib/blocks/src/controls/options/Checkbox.tsx +++ b/lib/blocks/src/controls/options/Checkbox.tsx @@ -1,4 +1,4 @@ -import React, { FC, ChangeEvent, useState, Fragment } from 'react'; +import React, { FC, ChangeEvent, useState } from 'react'; import { styled } from '@storybook/theming'; import { logger } from '@storybook/client-logger'; import { ControlProps, OptionsMultiSelection, NormalizedOptionsConfig } from '../types'; @@ -61,7 +61,7 @@ export const CheckboxControl: FC = ({ const handleChange = (e: ChangeEvent) => { const option = (e.target as HTMLInputElement).value; const updated = [...selected]; - if (updated?.includes(option)) { + if (updated.includes(option)) { updated.splice(updated.indexOf(option), 1); } else { updated.push(option); diff --git a/lib/blocks/src/controls/options/Radio.tsx b/lib/blocks/src/controls/options/Radio.tsx index a7ab189eb34..6bd147505ad 100644 --- a/lib/blocks/src/controls/options/Radio.tsx +++ b/lib/blocks/src/controls/options/Radio.tsx @@ -24,12 +24,6 @@ const Wrapper = styled.div<{ isInline: boolean }>(({ isInline }) => } ); -const Fieldset = styled.fieldset({ - border: 0, - padding: 0, - margin: 0, -}); - const Text = styled.span({}); const Label = styled.label({ diff --git a/lib/cli/src/generators/baseGenerator.ts b/lib/cli/src/generators/baseGenerator.ts index 7151a03cb69..2f880e40f5b 100644 --- a/lib/cli/src/generators/baseGenerator.ts +++ b/lib/cli/src/generators/baseGenerator.ts @@ -154,7 +154,7 @@ export async function baseGenerator( packages: frameworkPackages, type, // @ts-ignore - renderer: rendererInclude, + renderer: rendererInclude, // deepscan-disable-line UNUSED_DECL framework: frameworkInclude, builder: builderInclude, } = getFrameworkDetails(renderer, builder, pnp); From 5661ebc41474ce38ef2d85d66f54751d982bff89 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 29 Jun 2022 21:09:57 +0200 Subject: [PATCH 2/2] fix --- lib/blocks/package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/blocks/package.json b/lib/blocks/package.json index f5f44cc034f..61053bc9980 100644 --- a/lib/blocks/package.json +++ b/lib/blocks/package.json @@ -74,8 +74,10 @@ "publishConfig": { "access": "public" }, - "bundlerEntrypoint": [ - "./src/index.ts" - ], + "bundler": { + "entries": [ + "./src/index.ts" + ] + }, "gitHead": "24725501c32a073cebc6bf2674a47357136fbe3a" }