Skip to content

Commit 593bccc

Browse files
committed
enable prettier rules
1 parent 2723218 commit 593bccc

File tree

110 files changed

+578
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+578
-478
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ module.exports = {
363363
'react/prop-types': 'off',
364364
'import/order': 'off',
365365
'prefer-const': 'off',
366-
'prettier/prettier': 'off',
367366
'prefer-destructuring': 'off',
368367
// REDUNDANT: These are OFF by default in newer Airbnb config
369368
// 'react/jsx-boolean-value': 'off',

redisinsight/ui/src/components/auto-refresh/AutoRefresh.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,9 @@ const AutoRefresh = ({
299299
anchorPosition="downCenter"
300300
isOpen={isPopoverOpen}
301301
anchorClassName={styles.anchorWrapper}
302-
panelClassName={cx(
303-
styles.popoverWrapper,
304-
{
305-
[styles.popoverWrapperEditing]: editingRate,
306-
},
307-
)}
302+
panelClassName={cx(styles.popoverWrapper, {
303+
[styles.popoverWrapperEditing]: editingRate,
304+
})}
308305
closePopover={closePopover}
309306
button={
310307
<AutoRefreshConfigButton
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React, { ComponentProps } from 'react'
2-
import { FormField as RedisFormField, TooltipProvider } from '@redis-ui/components'
2+
import {
3+
FormField as RedisFormField,
4+
TooltipProvider,
5+
} from '@redis-ui/components'
36

47
export type RedisFormFieldProps = ComponentProps<typeof RedisFormField> & {
58
infoIconProps?: any
@@ -8,9 +11,11 @@ export type RedisFormFieldProps = ComponentProps<typeof RedisFormField> & {
811
export function FormField(props: RedisFormFieldProps) {
912
// eslint-disable-next-line react/destructuring-assignment
1013
if (props.infoIconProps) {
11-
return <TooltipProvider>
12-
<RedisFormField {...props} />
13-
</TooltipProvider>
14+
return (
15+
<TooltipProvider>
16+
<RedisFormField {...props} />
17+
</TooltipProvider>
18+
)
1419
}
1520
return <RedisFormField {...props} />
1621
}

redisinsight/ui/src/components/base/forms/select/RiSelect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import type { SelectOption, SelectValueRender } from '@redis-ui/components'
33
import React from 'react'
44

55
export { Select as RiSelect } from '@redis-ui/components'
6-
export type { SelectOption, SelectValueRender, SelectValueRenderParams } from '@redis-ui/components'
6+
export type {
7+
SelectOption,
8+
SelectValueRender,
9+
SelectValueRenderParams,
10+
} from '@redis-ui/components'
711

812
// Define our extended type
913
export type RiSelectOption = SelectOption & {

redisinsight/ui/src/components/base/inputs/TextInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { Input as RedisInput, TooltipProvider } from '@redis-ui/components'
44

55
export type RedisInputProps = ComponentProps<typeof RedisInput>
66

7-
const TextInput = forwardRef<React.ElementRef<typeof RedisInput>, RedisInputProps>((props, ref) => {
7+
const TextInput = forwardRef<
8+
React.ElementRef<typeof RedisInput>,
9+
RedisInputProps
10+
>((props, ref) => {
811
// eslint-disable-next-line react/destructuring-assignment
912
if (props.error) {
1013
return (

redisinsight/ui/src/components/base/layout/empty-prompt/RiEmptyPrompt.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import styled from 'styled-components'
33
import { useTheme } from '@redis-ui/styles'
44
import { Spacer } from '../spacer'
55

6-
interface RiEmptyPromptProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
6+
interface RiEmptyPromptProps
7+
extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
78
body?: React.ReactNode
89
title?: React.ReactNode
910
icon?: React.ReactNode
@@ -19,23 +20,23 @@ const StyledEmptyPrompt = styled.div`
1920
const RiEmptyPrompt = ({ body, title, icon, ...rest }: RiEmptyPromptProps) => {
2021
const theme = useTheme()
2122

22-
return (<StyledEmptyPrompt {...rest}>
23-
{icon}
24-
{title && (
25-
<>
26-
<Spacer size={theme.core.space.space100} />
27-
{title}
28-
</>
29-
)}
30-
{body && (
31-
<>
32-
<Spacer size={theme.core.space.space100} />
33-
{body}
34-
</>
35-
)}
36-
</StyledEmptyPrompt>
23+
return (
24+
<StyledEmptyPrompt {...rest}>
25+
{icon}
26+
{title && (
27+
<>
28+
<Spacer size={theme.core.space.space100} />
29+
{title}
30+
</>
31+
)}
32+
{body && (
33+
<>
34+
<Spacer size={theme.core.space.space100} />
35+
{body}
36+
</>
37+
)}
38+
</StyledEmptyPrompt>
3739
)
3840
}
39-
4041

4142
export default RiEmptyPrompt

redisinsight/ui/src/components/base/layout/horizontal-spacer/HorizontalSpacer.spec.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { HorizontalSpacer } from './horizontal-spacer'
55
describe('HorizontalSpacer', () => {
66
it('should render with different sizes correctly', () => {
77
const sizes = ['xs', 's', 'm', 'l', 'xl', 'xxl'] as const
8-
9-
sizes.forEach(size => {
8+
9+
sizes.forEach((size) => {
1010
const { container } = render(<HorizontalSpacer size={size} />)
11-
const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement
12-
11+
const spacer = container.querySelector(
12+
'.RI-horizontal-spacer',
13+
) as HTMLElement
14+
1315
if (size === 'xl') {
1416
expect(spacer).toHaveStyle('width: calc(var(--base) * 2.25)')
1517
} else {
@@ -22,7 +24,7 @@ describe('HorizontalSpacer', () => {
2224
const { getByText } = render(
2325
<HorizontalSpacer size="s">
2426
<span>Test content</span>
25-
</HorizontalSpacer>
27+
</HorizontalSpacer>,
2628
)
2729
const content = getByText('Test content')
2830
expect(content).toBeInTheDocument()
@@ -31,19 +33,23 @@ describe('HorizontalSpacer', () => {
3133

3234
it('should apply custom className', () => {
3335
const { container } = render(<HorizontalSpacer className="custom-class" />)
34-
const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement
35-
36+
const spacer = container.querySelector(
37+
'.RI-horizontal-spacer',
38+
) as HTMLElement
39+
3640
expect(spacer).toHaveClass('RI-horizontal-spacer')
3741
expect(spacer).toHaveClass('custom-class')
3842
})
3943

4044
it('should pass through custom props', () => {
4145
const { container } = render(
42-
<HorizontalSpacer data-testid="my-spacer" id="spacer-id" />
46+
<HorizontalSpacer data-testid="my-spacer" id="spacer-id" />,
4347
)
44-
const spacer = container.querySelector('.RI-horizontal-spacer') as HTMLElement
45-
48+
const spacer = container.querySelector(
49+
'.RI-horizontal-spacer',
50+
) as HTMLElement
51+
4652
expect(spacer).toHaveAttribute('data-testid', 'my-spacer')
4753
expect(spacer).toHaveAttribute('id', 'spacer-id')
4854
})
49-
})
55+
})

redisinsight/ui/src/components/base/layout/horizontal-spacer/horizontal-spacer.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ export const StyledHorizontalSpacer = styled.div<HorizontalSpacerProps>`
2323
flex-shrink: 0;
2424
width: ${({ size = 'l' }) => horizontalSpacerStyles[size]};
2525
display: inline-block;
26-
`
26+
`

redisinsight/ui/src/components/base/layout/horizontal-spacer/horizontal-spacer.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ import {
55
StyledHorizontalSpacer,
66
} from './horizontal-spacer.styles'
77

8-
export const HorizontalSpacer = ({ className, children, ...rest }: HorizontalSpacerProps) => (
9-
<StyledHorizontalSpacer {...rest} className={cx('RI-horizontal-spacer', className)}>
8+
export const HorizontalSpacer = ({
9+
className,
10+
children,
11+
...rest
12+
}: HorizontalSpacerProps) => (
13+
<StyledHorizontalSpacer
14+
{...rest}
15+
className={cx('RI-horizontal-spacer', className)}
16+
>
1017
{children}
1118
</StyledHorizontalSpacer>
12-
)
19+
)
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
export { HorizontalSpacer } from './horizontal-spacer'
2-
export type { HorizontalSpacerSize, HorizontalSpacerProps } from './horizontal-spacer.styles'
2+
export type {
3+
HorizontalSpacerSize,
4+
HorizontalSpacerProps,
5+
} from './horizontal-spacer.styles'

0 commit comments

Comments
 (0)