Skip to content

Commit

Permalink
style: format code with Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in b0471ae according to the output
from Prettier.

Details: #394
  • Loading branch information
deepsource-autofix[bot] authored Apr 11, 2024
1 parent b0471ae commit d20379f
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 189 deletions.
38 changes: 19 additions & 19 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { type StorybookConfig } from '@storybook/nextjs'
import { merge } from 'merge-anything'
import { type StorybookConfig } from "@storybook/nextjs";
import { merge } from "merge-anything";

import { dirname, join } from 'path'
import { dirname, join } from "path";

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
staticDirs: [
{
from: '../public',
to: '/',
from: "../public",
to: "/",
},
],
addons: [
getAbsolutePath('@storybook/addon-a11y'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath("@storybook/addon-a11y"),
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@storybook/addon-interactions"),
],
framework: {
name: '@storybook/nextjs',
name: "@storybook/nextjs",
options: {},
},
docs: {
autodocs: 'tag',
autodocs: "tag",
},
typescript: {
check: true,
reactDocgen: 'react-docgen-typescript', //'react-docgen-typescript',
reactDocgen: "react-docgen-typescript", //'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
shouldExtractValuesFromUnion: true,
Expand All @@ -42,14 +42,14 @@ const config: StorybookConfig = {
// 'next-i18next': 'react-i18next',
},
},
}
const mergedConfig = merge(config, configAdditions)
return mergedConfig
};
const mergedConfig = merge(config, configAdditions);
return mergedConfig;
},
}
};

export default config
export default config;

function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, 'package.json')))
return dirname(require.resolve(join(value, "package.json")));
}
38 changes: 19 additions & 19 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import { Global, MantineProvider } from '@mantine/core'
import { type MantineProviderProps } from '@mantine/core'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
import { type StoryFn } from '@storybook/react'
import { type ReactNode } from 'react'
import { I18nextProvider } from 'react-i18next'
import { Global, MantineProvider } from "@mantine/core";
import { type MantineProviderProps } from "@mantine/core";
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
import { type StoryFn } from "@storybook/react";
import { type ReactNode } from "react";
import { I18nextProvider } from "react-i18next";

import { i18n, i18nLocales } from './i18next'
import { storybookFont } from '../src/styles'
import { theme } from '../src/styles/theme'
import { i18n, i18nLocales } from "./i18next";
import { storybookFont } from "../src/styles";
import { theme } from "../src/styles/theme";

export const parameters = {
layout: 'centered',
layout: "centered",
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
i18n,
locale: 'en',
locale: "en",
locales: i18nLocales,
viewport: {
viewports: INITIAL_VIEWPORTS,
},
}
const mantineProviderProps: Omit<MantineProviderProps, 'children'> = {
};
const mantineProviderProps: Omit<MantineProviderProps, "children"> = {
withCSSVariables: false,
withGlobalStyles: true,
withNormalizeCSS: false,
}
};

const ThemeWrapper = ({ children }: DecoratorProps) => {
return (
Expand All @@ -38,17 +38,17 @@ const ThemeWrapper = ({ children }: DecoratorProps) => {
<I18nextProvider i18n={i18n}>{children}</I18nextProvider>
{/* </TypographyStylesProvider> */}
</MantineProvider>
)
}
);
};

export const decorators = [
(Story: StoryFn) => (
<ThemeWrapper>
<Story />
</ThemeWrapper>
),
]
];

type DecoratorProps = {
children: ReactNode
}
children: ReactNode;
};
32 changes: 18 additions & 14 deletions prisma/dataMigrationRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
type ListrTaskWrapper,
PRESET_TIMER,
PRESET_TIMESTAMP,
} from 'listr2'
} from "listr2";

import * as jobList from './data-migrations'
import * as jobList from "./data-migrations";

/**
* Job Runner
Expand All @@ -22,18 +22,18 @@ const rendererOptions = {
outputBar: 10,
persistentOutput: true,
timer: PRESET_TIMER,
} satisfies ListrJob['rendererOptions']
} satisfies ListrJob["rendererOptions"];

const injectOptions = (job: ListrJob): ListrJob => ({
...job,
rendererOptions,
})
});

const jobs = new Listr<Context>(
Object.values(jobList).map((job) => injectOptions(job)),
{
rendererOptions: {
formatOutput: 'wrap',
formatOutput: "wrap",
timer: PRESET_TIMER,
suffixSkips: true,
},
Expand All @@ -42,17 +42,21 @@ const jobs = new Listr<Context>(
timestamp: PRESET_TIMESTAMP,
},
exitOnError: false,
}
)
},
);

jobs.run()
jobs.run();

export type Context = {
error?: boolean
}
export type PassedTask = ListrTaskWrapper<Context, ListrDefaultRenderer, ListrDefaultRenderer>
export type ListrJob = ListrTaskObj<Context, ListrDefaultRenderer>
error?: boolean;
};
export type PassedTask = ListrTaskWrapper<
Context,
ListrDefaultRenderer,
ListrDefaultRenderer
>;
export type ListrJob = ListrTaskObj<Context, ListrDefaultRenderer>;
export type ListrTask = (
ctx: Context,
task: PassedTask
) => void | Promise<void | Listr<Context, any, any>> | Listr<Context, any, any>
task: PassedTask,
) => void | Promise<void | Listr<Context, any, any>> | Listr<Context, any, any>;
Loading

0 comments on commit d20379f

Please sign in to comment.