Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 15, 2024
1 parent ee06c80 commit 2334b1d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
17 changes: 10 additions & 7 deletions code/addons/docs/src/preview.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import type { PreparedStory } from '@storybook/types';
import { global } from '@storybook/global';

const excludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce((acc, entry) => {
const [tag, option] = entry;
if ((option as any).excludeFromDocsStories) {
acc[tag] = true;
}
return acc;
}, {} as Record<string, boolean>);
const excludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce(
(acc, entry) => {
const [tag, option] = entry;
if ((option as any).excludeFromDocsStories) {
acc[tag] = true;
}
return acc;
},
{} as Record<string, boolean>
);

export const parameters: any = {
docs: {
Expand Down
11 changes: 7 additions & 4 deletions code/lib/cli/src/upgrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ vi.mock('@storybook/telemetry');
vi.mock('./versions', async (importOriginal) => {
const originalVersions = ((await importOriginal()) as { default: typeof versions }).default;
return {
default: Object.keys(originalVersions).reduce((acc, key) => {
acc[key] = '8.0.0';
return acc;
}, {} as Record<string, string>),
default: Object.keys(originalVersions).reduce(
(acc, key) => {
acc[key] = '8.0.0';
return acc;
},
{} as Record<string, string>
),
};
});

Expand Down
17 changes: 10 additions & 7 deletions code/lib/core-server/src/presets/common-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ const STATIC_FILTER = 'static-filter';
addons.register(STATIC_FILTER, (api) => {
// FIXME: this ensures the filter is applied after the first render
// to avoid a strange race condition in Webkit only.
const excludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce((acc, entry) => {
const [tag, option] = entry;
if ((option as any).excludeFromSidebar) {
acc[tag] = true;
}
return acc;
}, {} as Record<string, boolean>);
const excludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce(
(acc, entry) => {
const [tag, option] = entry;
if ((option as any).excludeFromSidebar) {
acc[tag] = true;
}
return acc;
},
{} as Record<string, boolean>
);

api.experimental_setFilter(STATIC_FILTER, (item) => {
const tags = item.tags || [];
Expand Down

0 comments on commit 2334b1d

Please sign in to comment.