From 4e8fa2e6223e1b359fbc410a864b0ed8a6d4d65c Mon Sep 17 00:00:00 2001 From: Inomdzhon Mirdzhamolov Date: Thu, 20 Jun 2024 15:32:18 +0300 Subject: [PATCH] tech: bump prettier from 2.8.8 to 3.3.2; use stylelint-prettier (#7037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit h2. Описание **Stylelint** не учитывал конфигурацию **Prettier** из-за чего сохранение в IDE приводило к неправильному форматированию, т.к. по умолчанию используется `stylelint --fix`. Из-за этого `prettier --check` ругался на не корректное форматирование CSS. h2. Изменения - обновил **Prettier**, т.к. **stylelint-prettier** требует `prettier: >= 3` > **Note** > > Из-за `@storybook/core-common`, который использует ссылка на `prettier` через `prettier-fallback`, **Yarn** не смог зарезолвить версии между `prettier` и `prettier-fallback` корректно, `yarn dedupe` тоже не помог. Поэтому вручную удалил `prettier-fallback` из `yarn.lock` и запустил `yarn install`, чтобы встала нужная версия `prettier`. >
diff yarn.lock >

> > ```diff > - "prettier-fallback@npm:prettier@^3": > - version: 3.2.5 > - resolution: "prettier@npm:3.2.5" > > -"prettier@npm:^3.1.1, prettier@npm:^3.3.2": > - version: 3.3.2 > - resolution: "prettier@npm:3.3.2" > > + "prettier-fallback@npm:prettier@^3, prettier@npm:^3.1.1, prettier@npm:^3.3.2": > + version: 3.3.2 > + resolution: "prettier@npm:3.3.2" > ``` >

>
- в `lint:prettier` добавил флаги `--cache` и `--cache-location` для единообразия с `lint:es` и `lint:stylelint` - применил `prettier --write` (b501d5bc3d2354c13349504c2057b9a5db25766c) --- package.json | 5 +-- packages/vkui/playwright-ct.config.ts | 4 +-- packages/vkui/playwright/index.html | 2 +- .../ActionSheetItem.module.css | 4 ++- .../src/components/Alert/Alert.module.css | 4 ++- .../src/components/Button/Button.module.css | 4 ++- .../CustomScrollView.module.css | 4 ++- .../vkui/src/components/FixedLayout/Readme.md | 21 ++++++------ .../PanelHeaderContext.module.css | 8 +++-- .../PullToRefresh/PullToRefresh.module.css | 4 ++- .../PullToRefresh/PullToRefresh.stories.tsx | 11 ++++--- .../src/components/PullToRefresh/Readme.md | 11 ++++--- .../src/components/Search/Search.module.css | 3 +- .../SegmentedControl.module.css | 4 ++- .../components/TabsItem/TabsItem.module.css | 4 ++- .../vkui/src/components/Touch/Touch.test.tsx | 2 +- packages/vkui/src/components/View/Readme.md | 4 +-- packages/vkui/src/components/View/View.tsx | 4 +-- .../vkui/src/components/View/ViewInfinite.tsx | 4 +-- .../useAdaptivityConditionalRender/helpers.ts | 16 +++++----- .../vkui/src/hooks/useFocusVisible.test.tsx | 21 ++++++------ packages/vkui/src/hooks/usePatchChildren.ts | 4 +-- packages/vkui/src/lib/dom.tsx | 4 +-- .../src/testing/e2e/ComponentPlayground.tsx | 4 +-- stylelint.config.js | 2 ++ tools/storybook-addon-cartesian/src/Tool.tsx | 4 +-- yarn.lock | 32 +++++++++++-------- 27 files changed, 113 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 1266910d63..edd080b3c0 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "postcss-logical": "^7.0.1", "postcss-modules": "^6.0.0", "postcss-value-parser": "^4.2.0", - "prettier": "^2.8.8", + "prettier": "^3.3.2", "process": "^0.11.10", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -79,6 +79,7 @@ "stylelint": "^16.6.1", "stylelint-config-standard": "^36.0.0", "stylelint-media-use-custom-media": "^4.0.0", + "stylelint-prettier": "^5.0.0", "stylelint-use-logical": "^2.1.2", "stylelint-value-no-unknown-custom-properties": "^6.0.1", "swc-loader": "^0.2.6", @@ -111,7 +112,7 @@ "lint:es": "eslint . --ext .jsx,.js,.ts,.tsx --cache --cache-location .cache/.eslintcache", "lint:es:ci": "yarn lint:es -o lint-results.json -f json", "lint:style": "cross-env LINT_PRECOMMIT_RUN=1 stylelint '**/*.css' --cache --cache-location .cache/.stylelintcache", - "lint:prettier": "prettier --check --ignore-unknown .", + "lint:prettier": "prettier --check --ignore-unknown --cache --cache-location .cache/.prettiercache .", "lint:types": "tsc --incremental --emitDeclarationOnly --declaration --tsBuildInfoFile .cache/.tsbuildinfo", "lint:generated-files": "yarn workspace @vkontakte/vkui run lint:generated-files", "prepare": "husky", diff --git a/packages/vkui/playwright-ct.config.ts b/packages/vkui/playwright-ct.config.ts index 11dbcfe6c4..09d6717d3c 100644 --- a/packages/vkui/playwright-ct.config.ts +++ b/packages/vkui/playwright-ct.config.ts @@ -61,8 +61,8 @@ export default defineConfig({ workers: process.env.CI ? 1 : typeof process.env.PLAYWRIGHT_WORKERS === 'string' - ? Number(process.env.PLAYWRIGHT_WORKERS) - : undefined, + ? Number(process.env.PLAYWRIGHT_WORKERS) + : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: process.env.CI ? [['github'], ['dot'], ['blob'], ...DEFAULT_REPORTERS] diff --git a/packages/vkui/playwright/index.html b/packages/vkui/playwright/index.html index 42db51487e..91ba3bb611 100644 --- a/packages/vkui/playwright/index.html +++ b/packages/vkui/playwright/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/vkui/src/components/ActionSheetItem/ActionSheetItem.module.css b/packages/vkui/src/components/ActionSheetItem/ActionSheetItem.module.css index 6f0c764625..f552b0cd4e 100644 --- a/packages/vkui/src/components/ActionSheetItem/ActionSheetItem.module.css +++ b/packages/vkui/src/components/ActionSheetItem/ActionSheetItem.module.css @@ -131,7 +131,9 @@ block-size: 100%; background-color: var(--vkui--color_background_modal); content: ''; - transition: opacity 0.15s ease-out, background-color 0.15s ease-out; + transition: + opacity 0.15s ease-out, + background-color 0.15s ease-out; } .ActionSheetItem--ios::after { diff --git a/packages/vkui/src/components/Alert/Alert.module.css b/packages/vkui/src/components/Alert/Alert.module.css index 2b9f0daf98..5eed13f4e5 100644 --- a/packages/vkui/src/components/Alert/Alert.module.css +++ b/packages/vkui/src/components/Alert/Alert.module.css @@ -256,7 +256,9 @@ */ .Alert--vkcom { - box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 0 96px rgba(0, 0, 0, 0.16); + box-shadow: + 0 0 2px rgba(0, 0, 0, 0.12), + 0 0 96px rgba(0, 0, 0, 0.16); inline-size: 400px; } diff --git a/packages/vkui/src/components/Button/Button.module.css b/packages/vkui/src/components/Button/Button.module.css index d25409c41d..ba7ca6440a 100644 --- a/packages/vkui/src/components/Button/Button.module.css +++ b/packages/vkui/src/components/Button/Button.module.css @@ -9,7 +9,9 @@ border-radius: var(--vkui--size_border_radius--regular); max-inline-size: 100%; min-inline-size: var(--vkui--size_button_minimum_width--regular); - transition: background-color 0.15s ease-out, color 0.15s ease-out; + transition: + background-color 0.15s ease-out, + color 0.15s ease-out; } .Button--rounded { diff --git a/packages/vkui/src/components/CustomScrollView/CustomScrollView.module.css b/packages/vkui/src/components/CustomScrollView/CustomScrollView.module.css index a5878bcd1e..711a5f0644 100644 --- a/packages/vkui/src/components/CustomScrollView/CustomScrollView.module.css +++ b/packages/vkui/src/components/CustomScrollView/CustomScrollView.module.css @@ -51,7 +51,9 @@ block-size: 100%; background-color: var(--vkui--color_icon_medium); border-radius: 12px; - transition: transform 200ms, opacity 200ms; + transition: + transform 200ms, + opacity 200ms; } .CustomScrollView__trackerY:hover::before, diff --git a/packages/vkui/src/components/FixedLayout/Readme.md b/packages/vkui/src/components/FixedLayout/Readme.md index 36e60772c2..124d24741b 100644 --- a/packages/vkui/src/components/FixedLayout/Readme.md +++ b/packages/vkui/src/components/FixedLayout/Readme.md @@ -35,13 +35,13 @@ const Example = () => { fringilla volutpat in sed velit. Aenean aliquet bibendum pretium.

- Cras pulvinar lobortis purus. Donec placerat suscipit leo vitae sodales. Phasellus convallis - lorem vitae arcu finibus pellentesque. In imperdiet vel leo a euismod. Nam sed odio a neque - venenatis suscipit a placerat magna. Mauris magna nisl, consequat nec augue vitae, ultricies - scelerisque ante. Phasellus pharetra risus eget imperdiet sodales. Integer dignissim auctor - semper. Nulla odio odio, euismod ut interdum in, bibendum sed massa. Proin rutrum molestie - massa in ultrices. Donec eu euismod turpis, eget lobortis lorem. Nulla facilisi. Nam lacinia - posuere turpis, sed laoreet turpis auctor nec. + Cras pulvinar lobortis purus. Donec placerat suscipit leo vitae sodales. Phasellus + convallis lorem vitae arcu finibus pellentesque. In imperdiet vel leo a euismod. Nam sed + odio a neque venenatis suscipit a placerat magna. Mauris magna nisl, consequat nec augue + vitae, ultricies scelerisque ante. Phasellus pharetra risus eget imperdiet sodales. + Integer dignissim auctor semper. Nulla odio odio, euismod ut interdum in, bibendum sed + massa. Proin rutrum molestie massa in ultrices. Donec eu euismod turpis, eget lobortis + lorem. Nulla facilisi. Nam lacinia posuere turpis, sed laoreet turpis auctor nec.

Curabitur eu fermentum mauris. Phasellus malesuada consectetur mollis. Pellentesque @@ -56,9 +56,10 @@ const Example = () => {
In hac habitasse platea dictumst. Etiam luctus erat metus, quis efficitur quam vulputate quis. Duis ultricies non mauris condimentum molestie. Maecenas sollicitudin ex sem, quis - ultrices libero blandit eu. Vivamus in turpis pulvinar, malesuada enim at, hendrerit magna. - Proin eu nulla eget arcu pretium pharetra. Sed ullamcorper pulvinar est eu dapibus. Cras - at varius justo. In ex odio, condimentum id pellentesque a, sodales ut diam. + ultrices libero blandit eu. Vivamus in turpis pulvinar, malesuada enim at, hendrerit + magna. Proin eu nulla eget arcu pretium pharetra. Sed ullamcorper pulvinar est eu + dapibus. Cras at varius justo. In ex odio, condimentum id pellentesque a, sodales ut + diam.

Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; diff --git a/packages/vkui/src/components/PanelHeaderContext/PanelHeaderContext.module.css b/packages/vkui/src/components/PanelHeaderContext/PanelHeaderContext.module.css index 589456bb59..6c6a2d4df3 100644 --- a/packages/vkui/src/components/PanelHeaderContext/PanelHeaderContext.module.css +++ b/packages/vkui/src/components/PanelHeaderContext/PanelHeaderContext.module.css @@ -109,7 +109,9 @@ } .PanelHeaderContext--sizeX-regular .PanelHeaderContext__content { - box-shadow: 0 0 4px rgba(0, 0, 0, 0.08), 0 8px 8px rgba(0, 0, 0, 0.16); + box-shadow: + 0 0 4px rgba(0, 0, 0, 0.08), + 0 8px 8px rgba(0, 0, 0, 0.16); } @media (--sizeX-regular) { @@ -123,7 +125,9 @@ } .PanelHeaderContext--sizeX-none .PanelHeaderContext__content { - box-shadow: 0 0 4px rgba(0, 0, 0, 0.08), 0 8px 8px rgba(0, 0, 0, 0.16); + box-shadow: + 0 0 4px rgba(0, 0, 0, 0.08), + 0 8px 8px rgba(0, 0, 0, 0.16); } } diff --git a/packages/vkui/src/components/PullToRefresh/PullToRefresh.module.css b/packages/vkui/src/components/PullToRefresh/PullToRefresh.module.css index b77cb2a974..3540affd71 100644 --- a/packages/vkui/src/components/PullToRefresh/PullToRefresh.module.css +++ b/packages/vkui/src/components/PullToRefresh/PullToRefresh.module.css @@ -26,7 +26,9 @@ align-items: center; justify-content: center; box-sizing: border-box; - transition: transform 300ms cubic-bezier(0.1, 0, 0.25, 1), opacity 220ms ease-out; + transition: + transform 300ms cubic-bezier(0.1, 0, 0.25, 1), + opacity 220ms ease-out; opacity: 0; background: var(--vkui--color_background_modal); border-radius: 50%; diff --git a/packages/vkui/src/components/PullToRefresh/PullToRefresh.stories.tsx b/packages/vkui/src/components/PullToRefresh/PullToRefresh.stories.tsx index 5215ca07d7..49365e1fb9 100644 --- a/packages/vkui/src/components/PullToRefresh/PullToRefresh.stories.tsx +++ b/packages/vkui/src/components/PullToRefresh/PullToRefresh.stories.tsx @@ -33,10 +33,13 @@ export const Example: Story = { const onRefresh = React.useCallback(() => { setFetching(true); - setTimeout(() => { - setFetching(false); - setUsers((prevUsers) => [getRandomUser(), ...prevUsers]); - }, getRandomInt(600, 2000)); + setTimeout( + () => { + setFetching(false); + setUsers((prevUsers) => [getRandomUser(), ...prevUsers]); + }, + getRandomInt(600, 2000), + ); }, []); return ( diff --git a/packages/vkui/src/components/PullToRefresh/Readme.md b/packages/vkui/src/components/PullToRefresh/Readme.md index 9adfddb27a..c118a9f23d 100644 --- a/packages/vkui/src/components/PullToRefresh/Readme.md +++ b/packages/vkui/src/components/PullToRefresh/Readme.md @@ -19,10 +19,13 @@ const Example = () => { const onRefresh = React.useCallback(() => { setFetching(true); - setTimeout(() => { - setFetching(false); - setUsers((prevUsers) => [getRandomUser(), ...prevUsers]); - }, getRandomInt(600, 2000)); + setTimeout( + () => { + setFetching(false); + setUsers((prevUsers) => [getRandomUser(), ...prevUsers]); + }, + getRandomInt(600, 2000), + ); }, []); return ( diff --git a/packages/vkui/src/components/Search/Search.module.css b/packages/vkui/src/components/Search/Search.module.css index af40290d5a..ae3a2c7e70 100644 --- a/packages/vkui/src/components/Search/Search.module.css +++ b/packages/vkui/src/components/Search/Search.module.css @@ -164,7 +164,8 @@ min-inline-size: initial; max-inline-size: min-content; pointer-events: none; - transition: flex 0.3s var(--vkui--animation_easing_platform), + transition: + flex 0.3s var(--vkui--animation_easing_platform), transform 0.3s var(--vkui--animation_easing_platform); overflow: hidden; } diff --git a/packages/vkui/src/components/SegmentedControl/SegmentedControl.module.css b/packages/vkui/src/components/SegmentedControl/SegmentedControl.module.css index dd5bc6c8d2..847cbb6de8 100644 --- a/packages/vkui/src/components/SegmentedControl/SegmentedControl.module.css +++ b/packages/vkui/src/components/SegmentedControl/SegmentedControl.module.css @@ -28,7 +28,9 @@ transition: transform 150ms; transform-origin: 0 0; border-radius: inherit; - box-shadow: inset 0 0 0 0.5px var(--vkui--color_image_border_alpha), 0 3px 8px rgba(0, 0, 0, 0.12), + box-shadow: + inset 0 0 0 0.5px var(--vkui--color_image_border_alpha), + 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); } diff --git a/packages/vkui/src/components/TabsItem/TabsItem.module.css b/packages/vkui/src/components/TabsItem/TabsItem.module.css index da33c273fa..ca45305bcf 100644 --- a/packages/vkui/src/components/TabsItem/TabsItem.module.css +++ b/packages/vkui/src/components/TabsItem/TabsItem.module.css @@ -66,7 +66,9 @@ /* mode="accent" */ .TabsItem--mode-accent { - transition: background-color 150ms ease-out, box-shadow 150ms ease-out; + transition: + background-color 150ms ease-out, + box-shadow 150ms ease-out; } .TabsItem--selected.TabsItem--mode-accent { diff --git a/packages/vkui/src/components/Touch/Touch.test.tsx b/packages/vkui/src/components/Touch/Touch.test.tsx index 97bc5ec94a..14f97b0881 100644 --- a/packages/vkui/src/components/Touch/Touch.test.tsx +++ b/packages/vkui/src/components/Touch/Touch.test.tsx @@ -13,7 +13,7 @@ import { Touch } from './Touch'; // Настоящего Touch нет в jsdom: https://github.com/jsdom/jsdom/issues/1508 const asClientPos = ([clientX = 0, clientY = 0] = []): Touch & MouseEvent => - ({ clientX, clientY } as any); + ({ clientX, clientY }) as any; function fireMouseSwipe( e: HTMLElement, diff --git a/packages/vkui/src/components/View/Readme.md b/packages/vkui/src/components/View/Readme.md index 124f8d3574..c37d307fc6 100644 --- a/packages/vkui/src/components/View/Readme.md +++ b/packages/vkui/src/components/View/Readme.md @@ -309,8 +309,8 @@ const Content = () => { {direction === 'forwards' ? 'вперёд' : direction === 'backwards' - ? 'назад' - : 'не определено'} + ? 'назад' + : 'не определено'} {spinner} diff --git a/packages/vkui/src/components/View/View.tsx b/packages/vkui/src/components/View/View.tsx index 317da33690..07398dec10 100644 --- a/packages/vkui/src/components/View/View.tsx +++ b/packages/vkui/src/components/View/View.tsx @@ -472,8 +472,8 @@ export const View = ({ iOSSwipeBackSimulationEnabled ? handleTouchMoveXForIOSSwipeBackSimulation : platform === 'ios' - ? handleTouchMoveXForNativeIOSSwipeBackOrSwipeNext - : undefined + ? handleTouchMoveXForNativeIOSSwipeBackOrSwipeNext + : undefined } onEnd={iOSSwipeBackSimulationEnabled ? handleTouchEndForIOSSwipeBackSimulation : undefined} > diff --git a/packages/vkui/src/components/View/ViewInfinite.tsx b/packages/vkui/src/components/View/ViewInfinite.tsx index 2cc1de3542..52e8cc97af 100644 --- a/packages/vkui/src/components/View/ViewInfinite.tsx +++ b/packages/vkui/src/components/View/ViewInfinite.tsx @@ -613,8 +613,8 @@ class ViewInfiniteComponent extends React.Component< iOSSwipeBackSimulationEnabled ? this.handleTouchMoveXForIOSSwipeBackSimulation : platform === 'ios' - ? this.handleTouchMoveXForNativeIOSSwipeBackOrSwipeNext - : undefined + ? this.handleTouchMoveXForNativeIOSSwipeBackOrSwipeNext + : undefined } onEnd={ iOSSwipeBackSimulationEnabled ? this.handleTouchEndForIOSSwipeBackSimulation : undefined diff --git a/packages/vkui/src/hooks/useAdaptivityConditionalRender/helpers.ts b/packages/vkui/src/hooks/useAdaptivityConditionalRender/helpers.ts index 3a78017019..2ab528eef4 100644 --- a/packages/vkui/src/hooks/useAdaptivityConditionalRender/helpers.ts +++ b/packages/vkui/src/hooks/useAdaptivityConditionalRender/helpers.ts @@ -25,14 +25,14 @@ export const getAdaptiveSizeType = ( type === undefined ? compactClassNames.mq : type === 'compact' - ? compactClassNames[type] - : false, + ? compactClassNames[type] + : false, regular: type === undefined ? regularClassNames.mq : type === 'regular' - ? regularClassNames[type] - : false, + ? regularClassNames[type] + : false, }; }; @@ -45,14 +45,14 @@ export const getAdaptiveViewWidth = ( viewWidth === undefined ? viewWidthClassNames.tabletMinus.mq : viewWidth < ViewWidth.TABLET - ? viewWidthClassNames.tabletMinus.forced - : false, + ? viewWidthClassNames.tabletMinus.forced + : false, tabletPlus: viewWidth === undefined ? viewWidthClassNames.tabletPlus.mq : viewWidth >= ViewWidth.TABLET - ? viewWidthClassNames.tabletPlus.forced - : false, + ? viewWidthClassNames.tabletPlus.forced + : false, }; }; diff --git a/packages/vkui/src/hooks/useFocusVisible.test.tsx b/packages/vkui/src/hooks/useFocusVisible.test.tsx index 42466822d2..1d3b6d3ff5 100644 --- a/packages/vkui/src/hooks/useFocusVisible.test.tsx +++ b/packages/vkui/src/hooks/useFocusVisible.test.tsx @@ -9,17 +9,16 @@ import { useFocusVisible } from './useFocusVisible'; const wrapper = (keyboardInput: boolean) => - ({ children }: { children?: React.ReactNode }) => - ( - - {children} - - ); + ({ children }: { children?: React.ReactNode }) => ( + + {children} + + ); describe('useFocusVisible', () => { it('Sets focusVisible: true onFocus', () => { diff --git a/packages/vkui/src/hooks/usePatchChildren.ts b/packages/vkui/src/hooks/usePatchChildren.ts index 169fa02fad..7a16a4c101 100644 --- a/packages/vkui/src/hooks/usePatchChildren.ts +++ b/packages/vkui/src/hooks/usePatchChildren.ts @@ -82,8 +82,8 @@ export const usePatchChildren = ( const props = shouldUseRef ? { ref: childRef, ...injectProps, ...mergedEventsByInjectProps } : isValidElementResult - ? { getRootRef: childRef, ...injectProps, ...mergedEventsByInjectProps } - : undefined; + ? { getRootRef: childRef, ...injectProps, ...mergedEventsByInjectProps } + : undefined; useEffectDev(() => { if (!childRef.current) { diff --git a/packages/vkui/src/lib/dom.tsx b/packages/vkui/src/lib/dom.tsx index e244769219..36eb73e130 100644 --- a/packages/vkui/src/lib/dom.tsx +++ b/packages/vkui/src/lib/dom.tsx @@ -151,8 +151,8 @@ export const getNearestOverflowAncestor = (childEl: Node): HTMLElement | Window return isBody(foundAncestor) ? getWindow(foundAncestor) : isHTMLElement(childEl) - ? foundAncestor - : null; + ? foundAncestor + : null; }; export const getScrollHeight = (node: Element | Window) => { diff --git a/packages/vkui/src/testing/e2e/ComponentPlayground.tsx b/packages/vkui/src/testing/e2e/ComponentPlayground.tsx index f771910093..59b8ea43cf 100644 --- a/packages/vkui/src/testing/e2e/ComponentPlayground.tsx +++ b/packages/vkui/src/testing/e2e/ComponentPlayground.tsx @@ -48,8 +48,8 @@ export const ComponentPlayground = < const wrapperWidth = adaptivityProviderProps.viewWidth ? getAdaptivePxWidth(adaptivityProviderProps.viewWidth) : isVKCOM - ? 'auto' - : BREAKPOINTS.MOBILE; + ? 'auto' + : BREAKPOINTS.MOBILE; return ( diff --git a/stylelint.config.js b/stylelint.config.js index e43749a4c4..7a06c23ae6 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -8,8 +8,10 @@ module.exports = { 'stylelint-media-use-custom-media', 'stylelint-value-no-unknown-custom-properties', 'stylelint-use-logical', + 'stylelint-prettier', ], rules: { + 'prettier/prettier': true, 'block-no-empty': null, 'declaration-block-no-redundant-longhand-properties': null, 'comment-empty-line-before': null, diff --git a/tools/storybook-addon-cartesian/src/Tool.tsx b/tools/storybook-addon-cartesian/src/Tool.tsx index 066151e905..82dc549fd4 100644 --- a/tools/storybook-addon-cartesian/src/Tool.tsx +++ b/tools/storybook-addon-cartesian/src/Tool.tsx @@ -13,8 +13,8 @@ const getOptionsFromArgTypes = (argTypes: ArgTypes) => typeof argValue.control === 'string' ? argValue.control : typeof argValue.control === 'object' - ? argValue.control.type - : undefined; + ? argValue.control.type + : undefined; const hasOptions = argValue.options && argValue.options.length > 0; if ('boolean' === controlType || hasOptions) { diff --git a/yarn.lock b/yarn.lock index 65f28cdf64..fac9d442cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5366,7 +5366,7 @@ __metadata: postcss-logical: ^7.0.1 postcss-modules: ^6.0.0 postcss-value-parser: ^4.2.0 - prettier: ^2.8.8 + prettier: ^3.3.2 process: ^0.11.10 react: ^18.3.1 react-dom: ^18.3.1 @@ -5377,6 +5377,7 @@ __metadata: stylelint: ^16.6.1 stylelint-config-standard: ^36.0.0 stylelint-media-use-custom-media: ^4.0.0 + stylelint-prettier: ^5.0.0 stylelint-use-logical: ^2.1.2 stylelint-value-no-unknown-custom-properties: ^6.0.1 swc-loader: ^0.2.6 @@ -14815,12 +14816,12 @@ __metadata: languageName: node linkType: hard -"prettier-fallback@npm:prettier@^3, prettier@npm:^3.1.1": - version: 3.2.5 - resolution: "prettier@npm:3.2.5" +"prettier-fallback@npm:prettier@^3, prettier@npm:^3.1.1, prettier@npm:^3.3.2": + version: 3.3.2 + resolution: "prettier@npm:3.3.2" bin: prettier: bin/prettier.cjs - checksum: 2ee4e1417572372afb7a13bb446b34f20f1bf1747db77cf6ccaf57a9be005f2f15c40f903d41a6b79eec3f57fff14d32a20fb6dee1f126da48908926fe43c311 + checksum: 5557d8caed0b182f68123c2e1e370ef105251d1dd75800fadaece3d061daf96b1389141634febf776050f9d732c7ae8fd444ff0b4a61b20535e7610552f32c69 languageName: node linkType: hard @@ -14833,15 +14834,6 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.8": - version: 2.8.8 - resolution: "prettier@npm:2.8.8" - bin: - prettier: bin-prettier.js - checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8 - languageName: node - linkType: hard - "pretty-error@npm:^4.0.0": version: 4.0.0 resolution: "pretty-error@npm:4.0.0" @@ -17167,6 +17159,18 @@ __metadata: languageName: node linkType: hard +"stylelint-prettier@npm:^5.0.0": + version: 5.0.0 + resolution: "stylelint-prettier@npm:5.0.0" + dependencies: + prettier-linter-helpers: ^1.0.0 + peerDependencies: + prettier: ">=3.0.0" + stylelint: ">=16.0.0" + checksum: 757b677f0e4345de1eab62b0e1a8d6ff50d968e2c541bae7ac7b5595157a49ee033c8911f92056d2bdfb0a2945faa5509814cb13170e48336bfc2c4c3b3ee9c2 + languageName: node + linkType: hard + "stylelint-use-logical@npm:^2.1.2": version: 2.1.2 resolution: "stylelint-use-logical@npm:2.1.2"