From 717e0cff96abe28fe3607c90cd7a9ac26e61151f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:00:05 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in 22a3369 according to the output from Prettier. Details: https://github.com/weareinreach/TransMascFutures/pull/375 --- .storybook/main.ts | 38 +++++++++++++++++------------------ .storybook/preview.tsx | 38 +++++++++++++++++------------------ prisma/dataMigrationRunner.ts | 32 ++++++++++++++++------------- 3 files changed, 56 insertions(+), 52 deletions(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 429d8ad4..6addc407 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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, @@ -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"))); } diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index e01ec016..14d43838 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,16 +1,16 @@ -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, @@ -18,17 +18,17 @@ export const parameters = { }, }, i18n, - locale: 'en', + locale: "en", locales: i18nLocales, viewport: { viewports: INITIAL_VIEWPORTS, }, -} -const mantineProviderProps: Omit = { +}; +const mantineProviderProps: Omit = { withCSSVariables: false, withGlobalStyles: true, withNormalizeCSS: false, -} +}; const ThemeWrapper = ({ children }: DecoratorProps) => { return ( @@ -38,8 +38,8 @@ const ThemeWrapper = ({ children }: DecoratorProps) => { {children} {/* */} - ) -} + ); +}; export const decorators = [ (Story: StoryFn) => ( @@ -47,8 +47,8 @@ export const decorators = [ ), -] +]; type DecoratorProps = { - children: ReactNode -} + children: ReactNode; +}; diff --git a/prisma/dataMigrationRunner.ts b/prisma/dataMigrationRunner.ts index 17572a98..10f72349 100644 --- a/prisma/dataMigrationRunner.ts +++ b/prisma/dataMigrationRunner.ts @@ -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 @@ -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( Object.values(jobList).map((job) => injectOptions(job)), { rendererOptions: { - formatOutput: 'wrap', + formatOutput: "wrap", timer: PRESET_TIMER, suffixSkips: true, }, @@ -42,17 +42,21 @@ const jobs = new Listr( timestamp: PRESET_TIMESTAMP, }, exitOnError: false, - } -) + }, +); -jobs.run() +jobs.run(); export type Context = { - error?: boolean -} -export type PassedTask = ListrTaskWrapper -export type ListrJob = ListrTaskObj + error?: boolean; +}; +export type PassedTask = ListrTaskWrapper< + Context, + ListrDefaultRenderer, + ListrDefaultRenderer +>; +export type ListrJob = ListrTaskObj; export type ListrTask = ( ctx: Context, - task: PassedTask -) => void | Promise> | Listr + task: PassedTask, +) => void | Promise> | Listr;