]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21164 - Add prettier into design system build
authorKevin Silva <kevin.silva@sonarsource.com>
Fri, 1 Dec 2023 11:56:34 +0000 (12:56 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 1 Dec 2023 20:02:43 +0000 (20:02 +0000)
64 files changed:
server/sonar-web/design-system/package.json
server/sonar-web/design-system/src/components/Accordion.tsx
server/sonar-web/design-system/src/components/Breadcrumbs.tsx
server/sonar-web/design-system/src/components/BubbleChart.tsx
server/sonar-web/design-system/src/components/CodeSnippet.tsx
server/sonar-web/design-system/src/components/InteractiveIcon.tsx
server/sonar-web/design-system/src/components/LocationMarker.tsx
server/sonar-web/design-system/src/components/NavBarTabs.tsx
server/sonar-web/design-system/src/components/NavLink.tsx
server/sonar-web/design-system/src/components/SelectionCard.tsx
server/sonar-web/design-system/src/components/Tooltip.tsx
server/sonar-web/design-system/src/components/__tests__/Banner-test.tsx
server/sonar-web/design-system/src/components/__tests__/BarChart-test.tsx
server/sonar-web/design-system/src/components/__tests__/Breadcrumbs-test.tsx
server/sonar-web/design-system/src/components/__tests__/BubbleChart-test.tsx
server/sonar-web/design-system/src/components/__tests__/Card-test.tsx
server/sonar-web/design-system/src/components/__tests__/CodeSnippet-test.tsx
server/sonar-web/design-system/src/components/__tests__/CodeSyntaxHighlighter-test.tsx
server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx
server/sonar-web/design-system/src/components/__tests__/DuplicationsIndicator-test.tsx
server/sonar-web/design-system/src/components/__tests__/ExecutionFlowAccordion-test.tsx
server/sonar-web/design-system/src/components/__tests__/FacetBox-test.tsx
server/sonar-web/design-system/src/components/__tests__/FacetItem-test.tsx
server/sonar-web/design-system/src/components/__tests__/FavoriteButton-test.tsx
server/sonar-web/design-system/src/components/__tests__/HotspotRating-test.tsx
server/sonar-web/design-system/src/components/__tests__/LineCoverage-test.tsx
server/sonar-web/design-system/src/components/__tests__/LineFinding-test.tsx
server/sonar-web/design-system/src/components/__tests__/LineNumber-test.tsx
server/sonar-web/design-system/src/components/__tests__/LineWrapper-test.tsx
server/sonar-web/design-system/src/components/__tests__/MainAppBar-test.tsx
server/sonar-web/design-system/src/components/__tests__/MenuItem-test.tsx
server/sonar-web/design-system/src/components/__tests__/NavBarTabs-test.tsx
server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx
server/sonar-web/design-system/src/components/__tests__/QualityGateIndicator-test.tsx
server/sonar-web/design-system/src/components/__tests__/SelectionCard-test.tsx
server/sonar-web/design-system/src/components/__tests__/Table-test.tsx
server/sonar-web/design-system/src/components/__tests__/ToggleButton-test.tsx
server/sonar-web/design-system/src/components/__tests__/Tooltip-test.tsx
server/sonar-web/design-system/src/components/__tests__/TreeMap-test.tsx
server/sonar-web/design-system/src/components/__tests__/TutorialStep-test.tsx
server/sonar-web/design-system/src/components/avatar/__tests__/Avatar-test.tsx
server/sonar-web/design-system/src/components/buttons/Button.tsx
server/sonar-web/design-system/src/components/code-line/LineFinding.tsx
server/sonar-web/design-system/src/components/code-line/LineIssuePointer.tsx
server/sonar-web/design-system/src/components/code-line/LineMarker.tsx
server/sonar-web/design-system/src/components/icons/__tests__/Icon-test.tsx
server/sonar-web/design-system/src/components/input/SearchSelect.tsx
server/sonar-web/design-system/src/components/input/__tests__/DiscreetSelect-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/FormField-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/InputSearch-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/MultiSelectMenu-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/RadioButton-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/SearchSelectControlledInput-test.tsx
server/sonar-web/design-system/src/components/input/__tests__/SearchSelectDropdown-test.tsx
server/sonar-web/design-system/src/components/lists/__tests__/NumberedList-test.tsx
server/sonar-web/design-system/src/components/lists/__tests__/UnorderedList-test.tsx
server/sonar-web/design-system/src/components/modal/__tests__/Modal-test.tsx
server/sonar-web/design-system/src/components/subnavigation/__tests__/SubnavigationAccordion-test.tsx
server/sonar-web/design-system/src/components/subnavigation/__tests__/SubnavigationItem-test.tsx
server/sonar-web/design-system/src/helpers/__tests__/theme-test.ts
server/sonar-web/design-system/src/helpers/keyboard.ts
server/sonar-web/design-system/src/helpers/positioning.ts
server/sonar-web/design-system/src/helpers/theme.ts
server/sonar-web/yarn.lock

index d31534e8f3a065542e596faa127e1cc841d4770d..77cfdaf9ddc2803f9ac51bbbbe6f6bad419ee836 100644 (file)
@@ -4,6 +4,8 @@
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "scripts": {
+    "format": "prettier --write --list-different \"src/**/*.{ts,tsx}\"",
+    "format-check": "prettier --list-different \"src/**/*.{ts,tsx}\"",
     "build": "yarn lint && yarn ts-check && vite build",
     "build:no-checks": "vite build",
     "build-release": "yarn install --immutable && yarn build",
@@ -11,7 +13,7 @@
     "lint-report-ci": "yarn install --immutable && eslint --ext js,ts,tsx -f json -o eslint-report/eslint-report.json src  || yarn lint",
     "test": "jest",
     "ts-check": "tsc --noEmit",
-    "validate-ci": "yarn install --immutable && yarn ts-check && yarn test --coverage --ci"
+    "validate-ci": "yarn install --immutable && yarn ts-check && yarn format-check && yarn test --coverage --ci"
   },
   "devDependencies": {
     "@babel/core": "7.23.2",
@@ -44,6 +46,7 @@
     "postcss": "8.4.31",
     "postcss-calc": "9.0.1",
     "postcss-custom-properties": "12.1.11",
+    "prettier": "^3.1.0",
     "twin.macro": "3.4.0",
     "typescript": "5.2.2",
     "vite": "4.5.0",
index 22c49a3b362d7f473bf5d7586eee8b1825213c02..08573eb9056a3beab057a8ac937d481ff81e20ba 100644 (file)
@@ -78,7 +78,9 @@ const accordionStyle = (props: ThemedProps) => css`
   border: ${themeBorder('default', 'buttonSecondaryBorder')(props)};
   color: ${themeContrast('buttonSecondary')(props)};
   background-color: ${themeColor('buttonSecondary')(props)};
-  transition: background-color 0.2s ease, outline 0.2s ease;
+  transition:
+    background-color 0.2s ease,
+    outline 0.2s ease;
 
   & > button {
     ${tw`sw-body-sm-highlight`}
index 2bc0a92d81d43096962be03c1c21c18fbc38e5b9..66cf0aa319358bb4c07656f7d1275dac3675333b 100644 (file)
@@ -122,7 +122,7 @@ export function Breadcrumbs(props: Props) {
             overlay={modifiedChildren[index].props.children as React.ReactNode}
           >
             {modifiedChildren[index]}
-          </Tooltip>
+          </Tooltip>,
         );
       } else if (
         isLastBreadcrumb ||
index e1bd883e04d4378489d41afba4a0a1b0761f6118..a583615e38461bb12c3196a364390158b50e3d85 100644 (file)
@@ -121,7 +121,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
         k,
       });
     },
-    [padding]
+    [padding],
   );
 
   const boundNode = React.useCallback(
@@ -130,7 +130,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
       zoomRef.current = zoom().scaleExtent([1, 10]).on('zoom', zoomed);
       select(nodeRef.current).call(zoomRef.current);
     },
-    [zoomed]
+    [zoomed],
   );
 
   const resetZoom = React.useCallback((e: React.MouseEvent<HTMLButtonElement>) => {
@@ -150,7 +150,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
       const dMaxX = maxX > x2 ? maxX - x2 : 0;
       return [dMinX, availableWidth - dMaxX];
     },
-    [items]
+    [items],
   );
 
   const getYRange = React.useCallback(
@@ -162,7 +162,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
       const dMaxY = maxY > y1 ? maxY - y1 : 0;
       return [availableHeight - dMaxY, dMinY];
     },
-    [items]
+    [items],
   );
 
   const getTicks = React.useCallback(
@@ -176,7 +176,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
           : TICKS_COUNT * zoomAmount;
       return scale.ticks(ticksCount);
     },
-    [transform]
+    [transform],
   );
 
   const renderXGrid = React.useCallback(
@@ -202,7 +202,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
 
       return <g>{lines}</g>;
     },
-    [transform, displayXGrid]
+    [transform, displayXGrid],
   );
 
   const renderYGrid = React.useCallback(
@@ -228,7 +228,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
 
       return <g>{lines}</g>;
     },
-    [displayYGrid, transform]
+    [displayYGrid, transform],
   );
 
   const renderXTicks = React.useCallback(
@@ -252,7 +252,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
 
       return <g>{ticks}</g>;
     },
-    [displayXTicks, formatXTick, transform]
+    [displayXTicks, formatXTick, transform],
   );
 
   const renderYTicks = React.useCallback(
@@ -283,7 +283,7 @@ export function BubbleChart<T>(props: BubbleChartProps<T>) {
 
       return <g>{ticks}</g>;
     },
-    [displayYTicks, formatYTick, transform]
+    [displayYTicks, formatYTick, transform],
   );
 
   const renderChart = (width: number) => {
@@ -406,7 +406,7 @@ function Bubble<T>(props: BubbleProps<T>) {
       event.preventDefault();
       onClick?.(data);
     },
-    [data, onClick]
+    [data, onClick],
   );
 
   const circle = (
index fcb8532c4877ab35e1e6f8c6cbca591bb50d32c3..8281a1242f9e82a016036101f82f941b9ba88884 100644 (file)
@@ -70,7 +70,7 @@ export function CodeSnippet(props: Props) {
           'code-snippet-simple-oneline': isSimpleOneLine,
         },
         className,
-        'fs-mask'
+        'fs-mask',
       )}
     >
       {!noCopy && copyButton}
index f00a59a6f64d47991999b8a0a3b309e193d25d5a..6f5d5e418bb6fd444276a4a92e26d4dac66f8bd8 100644 (file)
@@ -107,7 +107,10 @@ const buttonIconStyle = (props: ThemedProps & { size: InteractiveIconSize }) =>
   text-decoration: none;
   color: var(--color);
   background-color: var(--background);
-  transition: background-color 0.2s ease, outline 0.2s ease, color 0.2s ease;
+  transition:
+    background-color 0.2s ease,
+    outline 0.2s ease,
+    color 0.2s ease;
 
   ${tw`sw-inline-flex sw-items-center sw-justify-center`}
   ${tw`sw-cursor-pointer`}
@@ -158,11 +161,10 @@ export const InteractiveIcon: React.FC<React.PropsWithChildren<InteractiveIconPr
   --focus: ${themeColor('interactiveIconFocus', OPACITY_20_PERCENT)};
 `;
 
-export const DiscreetInteractiveIcon: React.FC<
-  React.PropsWithChildren<InteractiveIconProps>
-> = styled(InteractiveIcon)`
-  --color: ${themeColor('discreetInteractiveIcon')};
-`;
+export const DiscreetInteractiveIcon: React.FC<React.PropsWithChildren<InteractiveIconProps>> =
+  styled(InteractiveIcon)`
+    --color: ${themeColor('discreetInteractiveIcon')};
+  `;
 
 export const DestructiveIcon: React.FC<React.PropsWithChildren<InteractiveIconProps>> = styled(
   InteractiveIconBase,
@@ -174,14 +176,13 @@ export const DestructiveIcon: React.FC<React.PropsWithChildren<InteractiveIconPr
   --focus: ${themeColor('destructiveIconFocus', OPACITY_20_PERCENT)};
 `;
 
-export const DismissProductNewsIcon: React.FC<
-  React.PropsWithChildren<InteractiveIconProps>
-> = styled(InteractiveIcon)`
-  --background: ${themeColor('productNews')};
-  --backgroundHover: ${themeColor('productNewsHover')};
-  --color: ${themeContrast('productNews')};
-  --colorHover: ${themeContrast('productNewsHover')};
-  --focus: ${themeColor('interactiveIconFocus', OPACITY_20_PERCENT)};
+export const DismissProductNewsIcon: React.FC<React.PropsWithChildren<InteractiveIconProps>> =
+  styled(InteractiveIcon)`
+    --background: ${themeColor('productNews')};
+    --backgroundHover: ${themeColor('productNewsHover')};
+    --color: ${themeContrast('productNews')};
+    --colorHover: ${themeContrast('productNewsHover')};
+    --focus: ${themeColor('interactiveIconFocus', OPACITY_20_PERCENT)};
 
-  height: 28px;
-`;
+    height: 28px;
+  `;
index 1ce611447ea090f1fe5cdf08805ba5128edf10e3..c02a366d037a19c8a751260bf017275ddbbf9333 100644 (file)
@@ -34,7 +34,7 @@ interface Props {
 
 function InternalLocationMarker(
   { className, onClick, text, selected }: Props,
-  ref: LegacyRef<HTMLDivElement>
+  ref: LegacyRef<HTMLDivElement>,
 ) {
   return (
     <StyledMarker
index 8865016006dc2f6893b1531551dfe83ffaac56f6..03f2458eeb6e42b5ec6e9a201710a92071c1de2c 100644 (file)
@@ -58,7 +58,7 @@ export function NavBarTabLink(props: NavBarTabLinkProps) {
           classNames(
             'sw-flex sw-items-center',
             { active: isDefined(active) ? active : isActive },
-            className
+            className,
           )
         }
         {...linkProps}
index 8075c5e182c6c189a1a79ff3e1e366a519e61c17..b56f2714cfdd69e415bbb30d4150a890d4088e28 100644 (file)
@@ -60,7 +60,7 @@ function NavLinkWithRef(props: NavLinkProps, ref: React.ForwardedRef<HTMLAnchorE
         onClick(event);
       }
     },
-    [onClick, blurAfterClick, preventDefault, stopPropagation, disabled]
+    [onClick, blurAfterClick, preventDefault, stopPropagation, disabled],
   );
 
   return (
index 088432fc90b11b165d937e8c4a20bcab34133089..fe5518c405500ae74ec080250a282e354d0540b4 100644 (file)
@@ -68,7 +68,7 @@ export function SelectionCard(props: SelectionCardProps) {
           disabled,
           selected,
         },
-        className
+        className,
       )}
       onClick={isActionable && !disabled && !selected ? onClick : undefined}
       role={isActionable ? 'radio' : 'presentation'}
index 1b5a763dec2890b22dc9af7db33eda457862aaba..7394b7eaebf7ac8a59ee4e3ad39d95a8c2c42606 100644 (file)
@@ -128,7 +128,7 @@ export class TooltipInner extends React.Component<TooltipProps, State> {
             // position (which is no longer correct).
             this.positionTooltip();
           }
-        }
+        },
       );
     }
   }
@@ -195,7 +195,7 @@ export class TooltipInner extends React.Component<TooltipProps, State> {
 
   adjustArrowPosition = (
     placement: PopupPlacement,
-    { leftFix, topFix, height, width }: Measurements
+    { leftFix, topFix, height, width }: Measurements,
   ) => {
     switch (placement) {
       case PopupPlacement.Left:
@@ -223,7 +223,7 @@ export class TooltipInner extends React.Component<TooltipProps, State> {
       const { height, left, leftFix, top, topFix, width } = popupPositioning(
         toggleNode,
         this.tooltipNode,
-        this.getPlacement()
+        this.getPlacement(),
       );
 
       // save width and height (and later set in `render`) to avoid resizing the popup element,
@@ -253,18 +253,21 @@ export class TooltipInner extends React.Component<TooltipProps, State> {
   };
 
   handlePointerEnter = () => {
-    this.mouseEnterTimeout = window.setTimeout(() => {
-      // for some reason even after the `this.mouseEnterTimeout` is cleared, it still triggers
-      // to workaround this issue, check that its value is not `undefined`
-      // (if it's `undefined`, it means the timer has been reset)
-      if (
-        this.mounted &&
-        this.props.visible === undefined &&
-        this.mouseEnterTimeout !== undefined
-      ) {
-        this.setState({ visible: true });
-      }
-    }, (this.props.mouseEnterDelay ?? 0) * MILLISECONDS_IN_A_SECOND);
+    this.mouseEnterTimeout = window.setTimeout(
+      () => {
+        // for some reason even after the `this.mouseEnterTimeout` is cleared, it still triggers
+        // to workaround this issue, check that its value is not `undefined`
+        // (if it's `undefined`, it means the timer has been reset)
+        if (
+          this.mounted &&
+          this.props.visible === undefined &&
+          this.mouseEnterTimeout !== undefined
+        ) {
+          this.setState({ visible: true });
+        }
+      },
+      (this.props.mouseEnterDelay ?? 0) * MILLISECONDS_IN_A_SECOND,
+    );
 
     if (this.props.onShow) {
       this.props.onShow();
@@ -278,11 +281,14 @@ export class TooltipInner extends React.Component<TooltipProps, State> {
     }
 
     if (!this.mouseIn) {
-      this.mouseLeaveTimeout = window.setTimeout(() => {
-        if (this.mounted && this.props.visible === undefined && !this.mouseIn) {
-          this.setState({ visible: false });
-        }
-      }, (this.props.mouseLeaveDelay ?? 0) * MILLISECONDS_IN_A_SECOND);
+      this.mouseLeaveTimeout = window.setTimeout(
+        () => {
+          if (this.mounted && this.props.visible === undefined && !this.mouseIn) {
+            this.setState({ visible: false });
+          }
+        },
+        (this.props.mouseLeaveDelay ?? 0) * MILLISECONDS_IN_A_SECOND,
+      );
 
       if (this.props.onHide) {
         this.props.onHide();
index 7f8acf474b560921a362862775723b9073b4411a..94d4ce8c9cd8c5068bc687d63e953e67aaf2c95c 100644 (file)
@@ -29,13 +29,13 @@ it('should render with close button', async () => {
   expect(
     screen.getByRole('button', {
       name: 'dismiss',
-    })
+    }),
   ).toBeVisible();
 
   await user.click(
     screen.getByRole('button', {
       name: 'dismiss',
-    })
+    }),
   );
 
   expect(onDismiss).toHaveBeenCalledTimes(1);
@@ -45,6 +45,6 @@ function setupWithProps(props: Partial<FCProps<typeof Banner>> = {}) {
   return renderWithContext(
     <Banner {...props} variant="warning">
       <Note className="sw-body-sm">{props.children ?? 'Test Message'}</Note>
-    </Banner>
+    </Banner>,
   );
 }
index 128eb11fe3390b7e3bc7b51bb0717dfecb2b959d..86c4edd1e75c5428dbf0d0da5acb2bbf18a7e942 100644 (file)
@@ -58,6 +58,6 @@ function renderChart(overrides: Partial<FCProps<typeof BarChart>> = {}) {
       onBarClick={jest.fn()}
       width={200}
       {...overrides}
-    />
+    />,
   );
 }
index ed6ab3444472b9b5dbd708a697a63369ab878e61..86fc3ec40e603f4cf1aef145560219d2b3fe496f 100644 (file)
@@ -33,7 +33,7 @@ it('should display three breadcrumbs correctly', () => {
       <HoverLink to="/first">first</HoverLink>
       <HoverLink to="/second">second</HoverLink>
       <HoverLink to="/third">third</HoverLink>
-    </BreadcrumbsFullWidth>
+    </BreadcrumbsFullWidth>,
   );
 
   expect(screen.getAllByRole('link').length).toBe(3);
index cdbe8cb268615cd50bae9921731b556a5ec46dd4..441617c7856567e61359e6cba7eb26c75b750f40 100644 (file)
@@ -86,6 +86,6 @@ function renderBubbleChart(props: Partial<FCProps<typeof BubbleChart>> = {}) {
       ]}
       padding={[0, 0, 0, 0]}
       {...props}
-    />
+    />,
   );
 }
index c71f6e9a8332d35e09ed85cbf6944fd813407141..eb2c4c216ee25eee79bc16ef5b10a41f02e1f2ea 100644 (file)
@@ -35,7 +35,7 @@ it('renders card correctly with classNames', () => {
   render(
     <Card className="sw-bg-black sw-border-8" role="tabpanel">
       Hello
-    </Card>
+    </Card>,
   );
   const cardContent = screen.getByText('Hello');
   expect(cardContent).toHaveClass('sw-bg-black sw-border-8');
@@ -46,7 +46,7 @@ it('renders grey card correctly with classNames', () => {
   render(
     <GreyCard className="sw-bg-black sw-border-8" role="tabpanel">
       Hello
-    </GreyCard>
+    </GreyCard>,
   );
   const cardContent = screen.getByText('Hello');
   expect(cardContent).toHaveClass('sw-bg-black sw-border-8');
index 13d0a5bde5792d569356d9345f4b77b638e9d817..42f4702db3e4861222919df542ccd5744668a058 100644 (file)
@@ -46,6 +46,6 @@ function setupWithProps(props: Partial<FCProps<typeof CodeSnippet>> = {}) {
   return renderWithContext(
     <HelmetProvider>
       <CodeSnippet snippet={'foo\nbar'} {...props} />
-    </HelmetProvider>
+    </HelmetProvider>,
   );
 }
index 5728f784a4ddb39b793172e738c7639e2009e93a..5b496640d2de2c27b3953be864e83a56e11e02cf 100644 (file)
@@ -29,7 +29,7 @@ it('renders correctly with no code', () => {
 
         <p>There's no code here.</p>
       `}
-    />
+    />,
   );
 
   // eslint-disable-next-line testing-library/no-node-access
@@ -45,7 +45,7 @@ it('renders correctly with code', () => {
         <p>There's some <code>"code"</code> here.</p>
      `}
       language="typescript"
-    />
+    />,
   );
 
   // eslint-disable-next-line testing-library/no-node-access
@@ -61,7 +61,7 @@ it('handles html code snippets', () => {
       htmlAsString={
         '\u003ch4\u003eNoncompliant code example\u003c/h4\u003e\n\u003cpre data-diff-id\u003d"1" data-diff-type\u003d"noncompliant"\u003e\npublic void Method(MyObject myObject)\n{\n    if (myObject is null)\n    {\n        new MyObject(); // Noncompliant\n    }\n\n    if (myObject.IsCorrupted)\n    {\n        new ArgumentException($"{nameof(myObject)} is corrupted"); // Noncompliant\n    }\n\n    // ...\n}\n\u003c/pre\u003e\n\u003ch4\u003eCompliant solution\u003c/h4\u003e\n\u003cpre data-diff-id\u003d"1" data-diff-type\u003d"compliant"\u003e\npublic void Method(MyObject myObject)\n{\n    if (myObject is null)\n    {\n        myObject \u003d new MyObject(); // Compliant\n    }\n\n    if (myObject.IsCorrupted)\n    {\n        throw new ArgumentException($"{nameof(myObject)} is corrupted"); // Compliant\n    }\n\n    // ...\n}\n\u003c/pre\u003e'
       }
-    />
+    />,
   );
 
   expect(container.querySelectorAll('pre')).toHaveLength(2);
index 131e881e4e6e9ae2900b5d0f9303134f580b5537..8406825e95650bc64c25481db532a7ca2a017494 100644 (file)
@@ -57,7 +57,7 @@ it('menu items should work with tooltips', async () => {
       <ItemButton onClick={jest.fn()}>button</ItemButton>
     </Tooltip>,
     {},
-    { delay: null }
+    { delay: null },
   );
 
   expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();
@@ -103,6 +103,6 @@ function renderDropdownMenu() {
       <ItemRadioButton checked={false} onCheck={noop} value="radios">
         Radio item
       </ItemRadioButton>
-    </DropdownMenu>
+    </DropdownMenu>,
   );
 }
index c491f942829d4f28809b9216471407ac0eae74f0..c295b9b847d841a0227957335d393e153a40de3f 100644 (file)
@@ -35,7 +35,7 @@ it.each(['A', 'B', 'C', 'D', 'E', 'F'])(
   (variant: DuplicationLabel) => {
     setupWithProps({ rating: variant });
     expect(screen.getByRole('img', { hidden: true })).toMatchSnapshot();
-  }
+  },
 );
 
 function setupWithProps(props: Partial<FCProps<typeof DuplicationsIndicator>> = {}) {
index e17f074e5792e747176c5b18d1a44a3843cdb7ad..dce2aadc8d7bcfe2f18c828ea8355d49f94a7b02 100644 (file)
@@ -33,11 +33,11 @@ it('should render correctly expanded', () => {
 
 function renderExecutionFlowAccordion(
   props: Partial<FCProps<typeof ExecutionFlowAccordion>> = {},
-  children?: React.ReactNode
+  children?: React.ReactNode,
 ) {
   return render(
     <ExecutionFlowAccordion header="header" id="id" {...props}>
       {children}
-    </ExecutionFlowAccordion>
+    </ExecutionFlowAccordion>,
   );
 }
index 9d8981cc02b319e6fe6035ca1c54a93fdeb74548..a39245c209dd2f7e652f6e223931b768befa7df9 100644 (file)
@@ -69,6 +69,6 @@ function renderComponent({ children, ...props }: Partial<FacetBoxProps> = {}) {
   return renderWithContext(
     <FacetBox name="Test FacetBox" {...props}>
       {children}
-    </FacetBox>
+    </FacetBox>,
   );
 }
index a6f69d720d93ca0352bb85d6e3cfbabd88f702a0..8feb189168e18d437b9ad94fc2d9dd41171de710 100644 (file)
@@ -70,6 +70,6 @@ it('should not add an aria label if the name is not a string', () => {
 
 function renderComponent(props: Partial<FacetItemProps> = {}) {
   return render(
-    <BaseFacetItem name="Test facet item" onClick={jest.fn()} value="Value" {...props} />
+    <BaseFacetItem name="Test facet item" onClick={jest.fn()} value="Value" {...props} />,
   );
 }
index 20c45fae6f38c9fb92c2ebeb0ff7b3364650688b..71fac4629fccf8814e330abe2e54c97c6277ce9e 100644 (file)
@@ -45,6 +45,6 @@ it('should toggle favorite', async () => {
 
 function renderFavoriteButton(props: Partial<FCProps<typeof FavoriteButton>> = {}) {
   return render(
-    <FavoriteButton favorite overlay="label-info" toggleFavorite={jest.fn()} {...props} />
+    <FavoriteButton favorite overlay="label-info" toggleFavorite={jest.fn()} {...props} />,
   );
 }
index e3cd43931b5447809c92ef0c62645a5f6e578505..42ff311c0b8b2669ec667ec40a371c496088ab09 100644 (file)
@@ -32,7 +32,7 @@ it.each(Object.values(HotspotRatingEnum))(
   (rating) => {
     renderHotspotRating(rating, 'label');
     expect(screen.getByLabelText('label')).toMatchSnapshot();
-  }
+  },
 );
 
 function renderHotspotRating(rating?: HotspotRatingEnum, label?: string) {
index 5fa1bc69eb42b035e66adeeb11b65b8a7c74cb68..d1388bea090fbae1c65633351829a18cb078497c 100644 (file)
@@ -27,7 +27,7 @@ it('should render correctly when covered', () => {
 
 it('should render correctly when uncovered', () => {
   expect(
-    setupWithProps({ lineNumber: 16, coverageStatus: 'uncovered' }).container
+    setupWithProps({ lineNumber: 16, coverageStatus: 'uncovered' }).container,
   ).toMatchSnapshot();
 });
 
@@ -36,7 +36,7 @@ it('should render correctly when partially covered without conditions', () => {
     setupWithProps({
       lineNumber: 16,
       coverageStatus: 'partially-covered',
-    }).container
+    }).container,
   ).toMatchSnapshot();
 });
 
@@ -45,7 +45,7 @@ it('should render correctly when partially covered with 5/10 conditions', () =>
     setupWithProps({
       lineNumber: 16,
       coverageStatus: 'partially-covered',
-    }).container
+    }).container,
   ).toMatchSnapshot();
 });
 
index 2d05bd33cd68008f0f13f093ac48abfddd54f2b8..400f9671bb821b019e1f85ec405011508c3cdc2a 100644 (file)
@@ -41,6 +41,6 @@ it('should be clickable when onIssueSelect is provided', async () => {
 
 function setupWithProps(props?: Partial<FCProps<typeof LineFinding>>) {
   return render(
-    <LineFinding issueKey="key" message="message" onIssueSelect={jest.fn()} {...props} />
+    <LineFinding issueKey="key" message="message" onIssueSelect={jest.fn()} {...props} />,
   );
 }
index 510934f46f45995c8776deed077b1cd907bc9fdb..e5ea779d44f4240b693e0a541a36ef367d1e00d9 100644 (file)
@@ -40,6 +40,6 @@ function setupWithProps(props: Partial<FCProps<typeof LineNumber>> = {}) {
       lineNumber={16}
       popup={<div>Popup</div>}
       {...props}
-    />
+    />,
   );
 }
index d994e0c09186b557ab419c166aa6010f5e23a3b6..efefc2b476cbbb6f55a16df2418d91d3879a15ee 100644 (file)
@@ -34,7 +34,7 @@ it('should properly setup css grid columns', () => {
   });
   expect(
     setupWithProps({ displayCoverage: false, displaySCM: false, duplicationsCount: 0 }).container
-      .firstChild
+      .firstChild,
   ).toHaveStyle({ '--columns': '44px 26px 1fr' });
 });
 
@@ -45,12 +45,6 @@ it('should set a highlighted background color in css props', () => {
 
 function setupWithProps(props: Partial<FCProps<typeof LineWrapper>> = {}) {
   return render(
-    <LineWrapper
-      displayCoverage
-      displaySCM
-      duplicationsCount={2}
-      highlighted={false}
-      {...props}
-    />
+    <LineWrapper displayCoverage displaySCM duplicationsCount={2} highlighted={false} {...props} />,
   );
 }
index 7a8672844620f53a5e384584d5fa0240979c2f6a..d1d8f799feaed219ff2469794bc5e6d1d2f1f771 100644 (file)
@@ -49,13 +49,13 @@ it('should render the logo', () => {
 function setupWithProps(
   props: FCProps<typeof MainAppBar> = {
     Logo: () => <img alt="logo" src="http://example.com/logo.png" />,
-  }
+  },
 ) {
   return render(
     <MemoryRouter initialEntries={['/']}>
       <Routes>
         <Route element={<MainAppBar {...props} />} path="/" />
       </Routes>
-    </MemoryRouter>
+    </MemoryRouter>,
   );
 }
index 562613e9ea8d33e914ea31bd7c5a699ee68ed2bd..bfdbed93150c04768fe960f4e10ba89ef12ae4a5 100644 (file)
@@ -28,7 +28,7 @@ it('should render default', () => {
   render(
     <MainMenuItem>
       <a>Hi</a>
-    </MainMenuItem>
+    </MainMenuItem>,
   );
 
   expect(screen.getByText('Hi')).toHaveStyle({
@@ -41,7 +41,7 @@ it('should render active link', () => {
   render(
     <MainMenuItem>
       <a className="active">Hi</a>
-    </MainMenuItem>
+    </MainMenuItem>,
   );
 
   expect(screen.getByText('Hi')).toHaveStyle({
@@ -54,7 +54,7 @@ it('should render hovered link', () => {
   render(
     <MainMenuItem>
       <a className="hover">Hi</a>
-    </MainMenuItem>
+    </MainMenuItem>,
   );
 
   expect(screen.getByText('Hi')).toHaveStyle({
index 0c2a64c124d29f421e6d722b87cbf6f8d3a94b1d..a8bf405d655748b6fbb9c7c4b433b3a4e7d76b3b 100644 (file)
@@ -37,7 +37,7 @@ describe('NewNavBarTabs', () => {
     return renderWithRouter(
       <NavBarTabs>
         <NavBarTabLink text="test" to="/summary/new_code" />
-      </NavBarTabs>
+      </NavBarTabs>,
     );
   }
 });
index 16e69510b566d0d8dbb0cdec5c2a276a2b581d19..40691c9a5656684a45b7448b9abb98500ae0ed58 100644 (file)
@@ -60,7 +60,7 @@ it('should stop propagation when stopPropagation is true', async () => {
   const { user } = setupWithMemoryRouter(
     <button onClick={buttonOnClick} type="button">
       <NavLink stopPropagation to="/second" />
-    </button>
+    </button>,
   );
 
   await user.click(screen.getByRole('link'));
@@ -71,7 +71,7 @@ it('should stop propagation when stopPropagation is true', async () => {
 it('should call onClick when one is passed', async () => {
   const onClick = jest.fn();
   const { user } = setupWithMemoryRouter(
-    <NavLink onClick={onClick} stopPropagation to="/second" />
+    <NavLink onClick={onClick} stopPropagation to="/second" />,
   );
 
   await user.click(screen.getByRole('link'));
@@ -108,6 +108,6 @@ const setupWithMemoryRouter = (component: JSX.Element, initialEntries = ['/initi
         />
         <Route element={<ShowPath />} path="/second" />
       </Routes>
-    </MemoryRouter>
+    </MemoryRouter>,
   );
 };
index 4dfa80ac5af4f5b8b12c40b8659452822b35a1d2..c4e7bdaad2b3dbaf92b2f5b4ccc9ef0082a0a70d 100644 (file)
@@ -44,7 +44,7 @@ it.each([
     setupWithProps({ status, size });
 
     expect(screen.getByRole('status')).toHaveAttribute('width', SIZE_VS_WIDTH[size]);
-  }
+  },
 );
 
 it('should display tooltip', () => {
index 9a48c7fbe72d24759333e2dcd5f64845a6ce349b..b98747653e4150ca354651f0b9078c675acb3d4e 100644 (file)
@@ -74,6 +74,6 @@ function renderSelectionCard(props: Partial<FCProps<typeof SelectionCard>> = {})
       title="Selection Card"
       titleInfo="info"
       {...props}
-    />
+    />,
   );
 }
index ecf8c99712c4e709357d2b9620d69f07940c613d..0febc0afbaae1e2b65126b674b3b451517033149 100644 (file)
@@ -68,38 +68,38 @@ it('check that the html structure and style is correct for a regular table', ()
 
   // Rows should have accessible attributes
   expect(
-    screen.getByRole('row', { name: 'ContentCellHeader NumericalCellHeader CheckboxCellHeader' })
+    screen.getByRole('row', { name: 'ContentCellHeader NumericalCellHeader CheckboxCellHeader' }),
   ).toBeInTheDocument();
   expect(
     screen.getByRole('row', {
       name: 'ContentCell 1 NumericalCell 1 CheckboxCell 1',
-    })
+    }),
   ).toBeInTheDocument();
   expect(
     screen.getByRole('row', {
       name: 'ContentCell 1 NumericalCell 1 CheckboxCell 1',
-    })
+    }),
   ).not.toHaveAttribute('aria-selected');
   expect(
     screen.getByRole('row', {
       selected: true,
       name: 'ContentCell 2 NumericalCell 2 CheckboxCell 2',
-    })
+    }),
   ).toBeInTheDocument();
   expect(
     screen.getByRole('row', {
       name: 'NumericalCell 4 CheckboxCell 4',
-    })
+    }),
   ).toBeInTheDocument();
 
   // Cells should have accessible attributes
   expect(screen.getByRole('cell', { name: 'NumericalCell 4' })).toHaveAttribute(
     'aria-colindex',
-    '2'
+    '2',
   );
   expect(screen.getByRole('cell', { name: 'CheckboxCell 4' })).toHaveAttribute(
     'aria-colindex',
-    '3'
+    '3',
   );
 });
 
index b34ae78d4b8c1ad164e9da8dc327bcc954048a8a..709d8792b43d4e1ef55318081f6cf35c931a0914 100644 (file)
@@ -57,7 +57,7 @@ it('should work in tablist mode', () => {
   expect(screen.getAllByRole('tab')).toHaveLength(3);
   expect(screen.getByRole('tab', { name: 'second' })).toHaveAttribute(
     'aria-controls',
-    getTabPanelId(2)
+    getTabPanelId(2),
   );
 });
 
index 72b493f6cc648ea538e80aa801b71587c3c8bf0f..dc592398efbd4d0688bcdd045edeb98cba35fec7 100644 (file)
@@ -49,7 +49,7 @@ describe('TooltipInner', () => {
     const onPointerLeave = jest.fn();
     const { user } = setupWithProps(
       { onHide, onShow },
-      <div onPointerEnter={onPointerEnter} onPointerLeave={onPointerLeave} role="note" />
+      <div onPointerEnter={onPointerEnter} onPointerLeave={onPointerLeave} role="note" />,
     );
 
     await user.hover(screen.getByRole('note'));
@@ -93,12 +93,12 @@ describe('TooltipInner', () => {
 
   function setupWithProps(
     props: Partial<TooltipInner['props']> = {},
-    children = <div role="note" />
+    children = <div role="note" />,
   ) {
     return render(
       <TooltipInner mouseLeaveDelay={0} overlay={<span id="overlay" />} {...props}>
         {children}
-      </TooltipInner>
+      </TooltipInner>,
     );
   }
 });
@@ -124,12 +124,12 @@ describe('Tooltip', () => {
 
   function setupWithProps(
     props: Partial<FCProps<typeof Tooltip>> = {},
-    children = <div role="note" />
+    children = <div role="note" />,
   ) {
     return render(
       <Tooltip overlay={<span id="overlay" />} {...props}>
         {children}
-      </Tooltip>
+      </Tooltip>,
     );
   }
 });
index 1f0121c3b18dcd05f07f4c788a33dbc90bad1b86..dc22d6e729f84d56d41ebf8dfed33044c166a674 100644 (file)
@@ -60,6 +60,6 @@ it('should render correctly and forward click event', async () => {
 
 function renderTreeMap(props: Partial<TreeMapProps<unknown>>) {
   return render(
-    <TreeMap height={100} items={[]} onRectangleClick={jest.fn()} width={100} {...props} />
+    <TreeMap height={100} items={[]} onRectangleClick={jest.fn()} width={100} {...props} />,
   );
 }
index 23e3f8e3f927e2623ba1e33114754af9cb5b542e..9036e36e02c026d138218ea7e48559d77c7d5df6 100644 (file)
@@ -33,6 +33,6 @@ function renderTutorialStep() {
   return render(
     <TutorialStepList>
       <TutorialStep title="This is title">These are children</TutorialStep>
-    </TutorialStepList>
+    </TutorialStepList>,
   );
 }
index 2d845c0e7520e9a42d0fad947e452fec1c1e172f..139c2a498646ccad22605f0d6c252f6807a918ea 100644 (file)
@@ -36,7 +36,7 @@ it('should be able to render with hash only', () => {
   setupWithProps({ hash: '7daf6c79d4802916d83f6266e24850af' });
   expect(screen.getByRole('img')).toHaveAttribute(
     'src',
-    'http://example.com/7daf6c79d4802916d83f6266e24850af.jpg?s=48'
+    'http://example.com/7daf6c79d4802916d83f6266e24850af.jpg?s=48',
   );
 });
 
@@ -64,6 +64,6 @@ it('should display organization avatar correctly', () => {
 
 function setupWithProps(props: Partial<FCProps<typeof Avatar>> = {}) {
   return render(
-    <Avatar enableGravatar gravatarServerUrl={gravatarServerUrl} name="foo" {...props} />
+    <Avatar enableGravatar gravatarServerUrl={gravatarServerUrl} name="foo" {...props} />,
   );
 }
index bfcf1788f66c4721252fa0900eb0c681e1bd960d..7177717e0fdfc7fe0cde8b217721b40ce3b3a412 100644 (file)
@@ -112,7 +112,9 @@ export const buttonStyle = (props: ThemedProps) => css`
   border: var(--border);
   color: var(--color);
   background-color: var(--background);
-  transition: background-color 0.2s ease, outline 0.2s ease;
+  transition:
+    background-color 0.2s ease,
+    outline 0.2s ease;
 
   ${tw`sw-inline-flex sw-items-center`}
   ${tw`sw-h-control`}
index 742c478b197b43573e6904594019393e23e19e6a..dbd0bf9af467cc56f9b488fb49fe99df5e2c778a 100644 (file)
@@ -33,7 +33,7 @@ interface Props {
 
 function LineFindingFunc(
   { message, issueKey, selected = true, className, onIssueSelect }: Props,
-  ref: Ref<HTMLButtonElement>
+  ref: Ref<HTMLButtonElement>,
 ) {
   return (
     <LineFindingStyled
index bf0e7ac1639b8ff7c8346ea20c14e0dba365b0d6..53d47a48a46b7ef8d60e7a7c534e3411af75de43 100644 (file)
@@ -37,7 +37,7 @@ export function LineIssuePointer({ issueFindingRef }: Props) {
     if (pointerRef.current && issueFindingRef?.current) {
       setDistance(
         issueFindingRef.current.getBoundingClientRect().top -
-          pointerRef.current.getBoundingClientRect().bottom
+          pointerRef.current.getBoundingClientRect().bottom,
       );
     }
   }, [pointerRef, issueFindingRef]);
index 856392516884d34589eb5d8844e1136285e0168a..c0deef2b96dd5680e4c470e6b994d7d2fdfef1a7 100644 (file)
@@ -35,7 +35,7 @@ interface Props {
 
 function LineMarkerFunc(
   { hideLocationIndex, index, leading, message, onLocationSelect, selected }: Props,
-  ref: Ref<HTMLElement>
+  ref: Ref<HTMLElement>,
 ) {
   const element = useRef<HTMLDivElement | null>(null);
   const elementMessage = useRef<HTMLDivElement | null>(null);
index 4d25af63048a3d150ae8db984d4eb609f0a7f2af..484a40e95c5e8fc8efe17852d406f92ae93a3e22 100644 (file)
@@ -26,7 +26,7 @@ it('should render custom icon correctly', () => {
   render(
     <CustomIcon>
       <path d="test" />
-    </CustomIcon>
+    </CustomIcon>,
   );
 
   expect(screen.queryByRole('img')).not.toBeInTheDocument();
@@ -37,7 +37,7 @@ it('should not be hidden when aria-label is set', () => {
   render(
     <CustomIcon aria-label="test">
       <path d="test" />
-    </CustomIcon>
+    </CustomIcon>,
   );
 
   expect(screen.getByRole('img')).toBeVisible();
index 7ed1c6fd88a9d50ec179d2b051172adb96febcaa..8f3ccd78d7a6fe319b79f08bb0934f5b8acd7090 100644 (file)
@@ -32,14 +32,14 @@ type SearchSelectProps<
   V,
   Option extends LabelValueSelectOption<V>,
   IsMulti extends boolean = false,
-  Group extends GroupBase<Option> = GroupBase<Option>
+  Group extends GroupBase<Option> = GroupBase<Option>,
 > = SelectProps<V, Option, IsMulti, Group> & AsyncProps<Option, IsMulti, Group>;
 
 export function SearchSelect<
   V,
   Option extends LabelValueSelectOption<V>,
   IsMulti extends boolean = false,
-  Group extends GroupBase<Option> = GroupBase<Option>
+  Group extends GroupBase<Option> = GroupBase<Option>,
 >({
   size = 'full',
   selectRef,
@@ -57,7 +57,7 @@ export function SearchSelect<
         control: ({ isDisabled }) =>
           classNames(
             'sw-border-0 sw-rounded-2 sw-outline-none sw-shadow-none',
-            isDisabled && 'sw-pointer-events-none sw-cursor-not-allowed'
+            isDisabled && 'sw-pointer-events-none sw-cursor-not-allowed',
           ),
         indicatorsContainer: () => 'sw-hidden',
         input: () => `sw-flex sw-w-full sw-p-0 sw-m-0`,
@@ -85,7 +85,7 @@ export function SearchSelectInput<
   V,
   Option extends LabelValueSelectOption<V>,
   IsMulti extends boolean = false,
-  Group extends GroupBase<Option> = GroupBase<Option>
+  Group extends GroupBase<Option> = GroupBase<Option>,
 >(props: InputProps<Option, IsMulti, Group>) {
   const {
     selectProps: { placeholder, isLoading, inputValue, minLength },
index 7db557af2a0bd877ef0cc6c71303e7b719a8654f..536da3f238426ecf329cdbf88bca7cc9ee44af4f 100644 (file)
@@ -54,6 +54,6 @@ function setupWithProps(props: Partial<FCProps<typeof DiscreetSelect>>) {
       setValue={jest.fn()}
       value="foo"
       {...props}
-    />
+    />,
   );
 }
index a8a4faeb02501593565e2627329abba1dbe26720..d68db6d5c36eae1438a29e75cb98c9195cab9bb5 100644 (file)
@@ -36,11 +36,11 @@ it('should render with required and description', () => {
 
 function renderFormField(
   props: Partial<FCProps<typeof FormField>> = {},
-  children: any = <div>Fake input</div>
+  children: any = <div>Fake input</div>,
 ) {
   return render(
     <FormField htmlFor="input" label="Hello" {...props}>
       {children}
-    </FormField>
+    </FormField>,
   );
 }
index 79339d6a0d8c735611f51ff5a4767382b5eccc2e..2729f5f6b0f867e775a3397c455a6854659de0ab 100644 (file)
@@ -83,6 +83,6 @@ function setupWithProps(props: Partial<FCProps<typeof InputSearch>> = {}) {
       searchInputAriaLabel=""
       value="foo"
       {...props}
-    />
+    />,
   );
 }
index 5f572df9b5120d5f02b5e8008015ce2d04c6255e..5094d89f6322f5ebac44f142bd538d1d341a4536 100644 (file)
@@ -109,6 +109,6 @@ function renderMultiselect(props: Partial<MultiSelectMenu['props']> = {}) {
       searchInputAriaLabel="search"
       selectedElements={[]}
       {...props}
-    />
+    />,
   );
 }
index b84f0bc377ee6649647544068b5e7bc23e2ecfd0..888e0939608ae8503cf7f9051fca1f28541ae532 100644 (file)
@@ -57,6 +57,6 @@ function setupWithProps(props?: Partial<FCProps<typeof RadioButton>>) {
   return render(
     <RadioButton checked={false} onCheck={jest.fn()} value="value" {...props}>
       foo
-    </RadioButton>
+    </RadioButton>,
   );
 }
index 86ac616a2525017da0edb15dafa9f1c3a1804e01..289dd96b1e3b28716ff1f24f8e6742a5fee4d375 100644 (file)
@@ -52,6 +52,6 @@ function setupWithProps(props: Partial<FCProps<typeof InputSearch>> = {}) {
       searchInputAriaLabel=""
       value="foo"
       {...props}
-    />
+    />,
   );
 }
index a48cb517340e09bf35fab70f5f007f57e445bee3..e0ae78bf93e9d639528883b97e36a0617f4f8eb6 100644 (file)
@@ -31,7 +31,7 @@ const defaultOptions = [
 
 const loadOptions = (
   query: string,
-  cb: (options: Array<LabelValueSelectOption<string>>) => void
+  cb: (options: Array<LabelValueSelectOption<string>>) => void,
 ) => {
   cb(defaultOptions.filter((o) => o.label.includes(query)));
 };
@@ -94,6 +94,6 @@ function renderSearchSelectDropdown(props: Partial<FCProps<typeof SearchSelectDr
       loadOptions={loadOptions}
       placeholder="search for things"
       {...props}
-    />
+    />,
   );
 }
index ecd4d374aab9882daed9b2c6055723ff25ad3716..086947b746c28517a89f137e541d75ae494a895a 100644 (file)
@@ -27,7 +27,7 @@ it('renders correctly', () => {
     <NumberedList>
       <NumberedListItem>First item</NumberedListItem>
       <NumberedListItem>Second item</NumberedListItem>
-    </NumberedList>
+    </NumberedList>,
   );
   expect(screen.getAllByRole('listitem')).toHaveLength(2);
 });
index 29bc188ff6e5de9ff29bf4e47f015c92c6ff6931..d76a800893a9336d103c14a129a63fcb9901d4eb 100644 (file)
@@ -27,7 +27,7 @@ it('renders correctly', () => {
     <UnorderedList>
       <ListItem>First item</ListItem>
       <ListItem>Second item</ListItem>
-    </UnorderedList>
+    </UnorderedList>,
   );
   expect(screen.getAllByRole('listitem')).toHaveLength(2);
 });
index 185f69f006bacbb872f816605402056805848c51..88a8637901f562ef38e2fcb5fd7cbd4700b5e6f0 100644 (file)
@@ -68,7 +68,7 @@ function setupPredefinedContent(props: Partial<PropsWithSections> = {}) {
       onClose={jest.fn()}
       secondaryButtonLabel="Close"
       {...props}
-    />
+    />,
   );
 }
 
@@ -76,7 +76,7 @@ function setupLooseContent(props: Partial<PropsWithChildren> = {}, children = <d
   return renderWithContext(
     <Modal onClose={jest.fn()} {...props}>
       {children}
-    </Modal>
+    </Modal>,
   );
 }
 
@@ -85,6 +85,6 @@ function setupLooseContentWithMultipleChildren(props: Partial<PropsWithChildren>
     <Modal onClose={jest.fn()} {...props}>
       <div>Hello there!</div>
       <div>How are you?</div>
-    </Modal>
+    </Modal>,
   );
 }
index 884fd13db3b0fdf1ceb8caeabb1c08c9c6673ce2..de61e543abb183104a80fa533c06550285de0adb 100644 (file)
@@ -70,6 +70,6 @@ function setupWithProps(props: Partial<FCProps<typeof SubnavigationAccordion>> =
   return render(
     <SubnavigationAccordion header="Header" id="test" {...props}>
       <span>Foo</span>
-    </SubnavigationAccordion>
+    </SubnavigationAccordion>,
   );
 }
index 17fb3e4e51dba01453f00ccbe3ec83689f0aa5a2..fde60881a3df05161478f4788ad172d388d9c636 100644 (file)
@@ -34,6 +34,6 @@ function setupWithProps(props: Partial<FCProps<typeof SubnavigationItem>> = {})
   return render(
     <SubnavigationItem active={false} onClick={jest.fn()} value="foo" {...props}>
       <button type="button">Foo</button>
-    </SubnavigationItem>
+    </SubnavigationItem>,
   );
 }
index 66f1b97ce0530c69413e5bd4ab7a489bdd69b63c..f82544e8712ca4811f66cec0732e9e4528992800 100644 (file)
@@ -33,13 +33,13 @@ describe('getProp', () => {
 describe('themeColor', () => {
   it('should work for light theme', () => {
     expect(ThemeHelper.themeColor('backgroundPrimary')({ theme: lightTheme })).toEqual(
-      'rgb(252,252,253)'
+      'rgb(252,252,253)',
     );
   });
 
   it('should work with a theme-defined opacity', () => {
     expect(ThemeHelper.themeColor('bannerIconHover')({ theme: lightTheme })).toEqual(
-      'rgba(217,45,32,0.2)'
+      'rgba(217,45,32,0.2)',
     );
   });
 
@@ -53,13 +53,13 @@ describe('themeColor', () => {
       ThemeHelper.themeColor(ThemeHelper.themeContrast('backgroundPrimary')({ theme: lightTheme }))(
         {
           theme: lightTheme,
-        }
-      )
+        },
+      ),
     ).toEqual('rgb(8,9,12)');
     expect(
       ThemeHelper.themeColor(ThemeHelper.themeAvatarColor('luke')({ theme: lightTheme }))({
         theme: lightTheme,
-      })
+      }),
     ).toEqual('rgb(209,215,254)');
   });
 });
@@ -67,7 +67,7 @@ describe('themeColor', () => {
 describe('themeContrast', () => {
   it('should work for light theme', () => {
     expect(ThemeHelper.themeContrast('backgroundPrimary')({ theme: lightTheme })).toEqual(
-      'rgb(8,9,12)'
+      'rgb(8,9,12)',
     );
   });
 
@@ -75,19 +75,19 @@ describe('themeContrast', () => {
     expect(ThemeHelper.themeContrast('var(--test)')({ theme: lightTheme })).toEqual('var(--test)');
     expect(ThemeHelper.themeContrast('rgb(0,0,0)')({ theme: lightTheme })).toEqual('rgb(0,0,0)');
     expect(ThemeHelper.themeContrast('rgba(0,0,0,1)')({ theme: lightTheme })).toEqual(
-      'rgba(0,0,0,1)'
+      'rgba(0,0,0,1)',
     );
     expect(
       ThemeHelper.themeContrast(ThemeHelper.themeColor('backgroundPrimary')({ theme: lightTheme }))(
         {
           theme: lightTheme,
-        }
-      )
+        },
+      ),
     ).toEqual('rgb(252,252,253)');
     expect(
       ThemeHelper.themeContrast(ThemeHelper.themeAvatarColor('luke')({ theme: lightTheme }))({
         theme: lightTheme,
-      })
+      }),
     ).toEqual('rgb(209,215,254)');
     expect(
       ThemeHelper.themeContrast('backgroundPrimary')({
@@ -95,7 +95,7 @@ describe('themeContrast', () => {
           ...lightTheme,
           contrasts: { ...lightTheme.contrasts, backgroundPrimary: 'inherit' },
         },
-      })
+      }),
     ).toEqual('inherit');
   });
 });
@@ -106,17 +106,17 @@ describe('themeBorder', () => {
   });
   it('should allow to override the color of the border', () => {
     expect(ThemeHelper.themeBorder('focus', 'primaryLight')({ theme: lightTheme })).toEqual(
-      '4px solid rgba(123,135,217,0.2)'
+      '4px solid rgba(123,135,217,0.2)',
     );
   });
   it('should allow to override the opacity of the border', () => {
     expect(ThemeHelper.themeBorder('focus', undefined, 0.5)({ theme: lightTheme })).toEqual(
-      '4px solid rgba(197,205,223,0.5)'
+      '4px solid rgba(197,205,223,0.5)',
     );
   });
   it('should allow to pass a CSS prop as color name', () => {
     expect(
-      ThemeHelper.themeBorder('focus', 'var(--outlineColor)', 0.5)({ theme: lightTheme })
+      ThemeHelper.themeBorder('focus', 'var(--outlineColor)', 0.5)({ theme: lightTheme }),
     ).toEqual('4px solid var(--outlineColor)');
   });
 });
@@ -124,25 +124,25 @@ describe('themeBorder', () => {
 describe('themeShadow', () => {
   it('should work for light theme', () => {
     expect(ThemeHelper.themeShadow('xs')({ theme: lightTheme })).toEqual(
-      '0px 1px 2px 0px rgba(29,33,47,0.05)'
+      '0px 1px 2px 0px rgba(29,33,47,0.05)',
     );
   });
   it('should allow to override the color of the shadow', () => {
     expect(ThemeHelper.themeShadow('xs', 'backgroundPrimary')({ theme: lightTheme })).toEqual(
-      '0px 1px 2px 0px rgba(252,252,253,0.05)'
+      '0px 1px 2px 0px rgba(252,252,253,0.05)',
     );
     expect(ThemeHelper.themeShadow('xs', 'transparent')({ theme: lightTheme })).toEqual(
-      '0px 1px 2px 0px transparent'
+      '0px 1px 2px 0px transparent',
     );
   });
   it('should allow to override the opacity of the shadow', () => {
     expect(ThemeHelper.themeShadow('xs', 'backgroundPrimary', 0.8)({ theme: lightTheme })).toEqual(
-      '0px 1px 2px 0px rgba(252,252,253,0.8)'
+      '0px 1px 2px 0px rgba(252,252,253,0.8)',
     );
   });
   it('should allow to pass a CSS prop as color name', () => {
     expect(ThemeHelper.themeShadow('xs', 'var(--shadowColor)')({ theme: lightTheme })).toEqual(
-      '0px 1px 2px 0px var(--shadowColor)'
+      '0px 1px 2px 0px var(--shadowColor)',
     );
   });
 });
index dd6f1c9a515e4b0d0f96f01063d74b0c6decd53d..6ab67e514961c59306022c6ddb104d12746bf434 100644 (file)
@@ -55,7 +55,7 @@ export function isInput(event: KeyboardEvent): boolean {
 }
 
 export function isTextarea(
-  event: KeyboardEvent
+  event: KeyboardEvent,
 ): event is KeyboardEvent & { target: HTMLTextAreaElement } {
   return event.target instanceof HTMLTextAreaElement;
 }
index 47afd6b3f49963a05df51b65efba739fcca3e947..a918b0d90963fd106b8f4505623a9cf4d4913231 100644 (file)
@@ -80,7 +80,7 @@ const MARGIN_TO_EDGE = 4;
 export function popupPositioning(
   toggleNode: Element,
   popupNode: Element,
-  placement: PopupPlacement = PopupPlacement.Bottom
+  placement: PopupPlacement = PopupPlacement.Bottom,
 ) {
   const toggleRect = toggleNode.getBoundingClientRect();
   const popupRect = popupNode.getBoundingClientRect();
@@ -136,12 +136,12 @@ export function popupPositioning(
 
   const inBoundariesLeft = Math.min(
     Math.max(left, getMinLeftPlacement(toggleRect)),
-    getMaxLeftPlacement(toggleRect, popupRect)
+    getMaxLeftPlacement(toggleRect, popupRect),
   );
 
   const inBoundariesTop = Math.min(
     Math.max(top, getMinTopPlacement(toggleRect)),
-    getMaxTopPlacement(toggleRect, popupRect)
+    getMaxTopPlacement(toggleRect, popupRect),
   );
 
   return {
@@ -157,27 +157,27 @@ export function popupPositioning(
 function getMinLeftPlacement(toggleRect: DOMRect) {
   return Math.min(
     MARGIN_TO_EDGE, // Left edge of the sceen
-    toggleRect.left + toggleRect.width / 2 // Left edge of the screen when scrolled
+    toggleRect.left + toggleRect.width / 2, // Left edge of the screen when scrolled
   );
 }
 
 function getMaxLeftPlacement(toggleRect: DOMRect, popupRect: DOMRect) {
   return Math.max(
     document.documentElement.clientWidth - popupRect.width - MARGIN_TO_EDGE, // Right edge of the screen
-    toggleRect.left + toggleRect.width / 2 - popupRect.width // Right edge of the screen when scrolled
+    toggleRect.left + toggleRect.width / 2 - popupRect.width, // Right edge of the screen when scrolled
   );
 }
 
 function getMinTopPlacement(toggleRect: DOMRect) {
   return Math.min(
     MARGIN_TO_EDGE, // Top edge of the sceen
-    toggleRect.top + toggleRect.height / 2 // Top edge of the screen when scrolled
+    toggleRect.top + toggleRect.height / 2, // Top edge of the screen when scrolled
   );
 }
 
 function getMaxTopPlacement(toggleRect: DOMRect, popupRect: DOMRect) {
   return Math.max(
     document.documentElement.clientHeight - popupRect.height - MARGIN_TO_EDGE, // Bottom edge of the screen
-    toggleRect.top + toggleRect.height / 2 - popupRect.height // Bottom edge of the screen when scrolled
+    toggleRect.top + toggleRect.height / 2 - popupRect.height, // Bottom edge of the screen when scrolled
   );
 }
index 77048771012bd68f07e946986143886bf3158c66..989347fe27fe84f4ee6bf29efeb41dd310cacdbf 100644 (file)
@@ -39,7 +39,7 @@ export function themeContrast(name: ThemeColors | CSSColor) {
 export function themeBorder(
   name: keyof Theme['borders'] = 'default',
   color?: ThemeColors | CSSColor,
-  opacity?: number
+  opacity?: number,
 ) {
   return function ({ theme }: ThemedProps) {
     const [width, style, ...rgba] = theme.borders[name];
@@ -50,7 +50,7 @@ export function themeBorder(
 export function themeShadow(
   name: keyof Theme['shadows'],
   color?: ThemeColors | CSSColor,
-  opacity?: number
+  opacity?: number,
 ) {
   return function ({ theme }: ThemedProps) {
     const shadows = theme.shadows[name];
@@ -89,7 +89,7 @@ function getColor(
   theme: Theme,
   [r, g, b, a]: number[],
   colorOverride?: ThemeColors | CSSColor,
-  opacityOverride?: number
+  opacityOverride?: number,
 ) {
   // Custom CSS property or rgb(a) color, return it directly
   if (
index 362693b0d174be2e880f65025fabe96bd01c72d1..649f11deef48a6f674e4f67fd3d32d7ad847c08a 100644 (file)
@@ -6940,6 +6940,7 @@ __metadata:
     postcss: 8.4.31
     postcss-calc: 9.0.1
     postcss-custom-properties: 12.1.11
+    prettier: ^3.1.0
     react-toastify: 8.2.0
     twin.macro: 3.4.0
     typescript: 5.2.2
@@ -11538,6 +11539,15 @@ __metadata:
   languageName: node
   linkType: hard
 
+"prettier@npm:^3.1.0":
+  version: 3.1.0
+  resolution: "prettier@npm:3.1.0"
+  bin:
+    prettier: bin/prettier.cjs
+  checksum: 44b556bd56f74d7410974fbb2418bb4e53a894d3e7b42f6f87779f69f27a6c272fa7fc27cec0118cd11730ef3246478052e002cbd87e9a253f9cd04a56aa7d9b
+  languageName: node
+  linkType: hard
+
 "pretty-format@npm:^27.0.0, pretty-format@npm:^27.4.6":
   version: 27.4.6
   resolution: "pretty-format@npm:27.4.6"