Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add jsx-curly-brace-presence #17078

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
'no-case-declarations': 'warn',
'prefer-regex-literals': 'warn',
'react/prop-types': 'warn',
'react/jsx-curly-brace-presence': 'warn',

// Enforce notification hooks
'no-restricted-imports': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function AlphanumericKeyboard({
return (
<Keyboard
keyboardRef={r => (keyboardRef.current = r)}
theme={'hg-theme-default oddTheme1 alphanumericKeyboard'}
theme="hg-theme-default oddTheme1 alphanumericKeyboard"
onChange={onChange}
onKeyPress={onKeyPress}
layoutName={layoutName}
Expand Down
2 changes: 1 addition & 1 deletion app/src/atoms/SoftwareKeyboard/FullKeyboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function FullKeyboard({
return (
<Keyboard
keyboardRef={r => (keyboardRef.current = r)}
theme={'hg-theme-default oddTheme1'}
theme="hg-theme-default oddTheme1"
onChange={onChange}
onKeyPress={onKeyPress}
layoutName={layoutName}
Expand Down
2 changes: 1 addition & 1 deletion app/src/atoms/SoftwareKeyboard/IndividualKey/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function IndividualKey({
*/
<Keyboard
keyboardRef={r => (keyboardRef.current = r)}
theme={'hg-theme-default oddTheme1 individual-key'}
theme="hg-theme-default oddTheme1 individual-key"
onChange={onChange}
layoutName="default"
display={customDisplay}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function NumericalKeyboard({
*/
<Keyboard
keyboardRef={r => (keyboardRef.current = r)}
theme={'hg-theme-default oddTheme1 numerical-keyboard'}
theme="hg-theme-default oddTheme1 numerical-keyboard"
onInit={keyboard => {
keyboard.setInput(initialValue)
}}
Expand Down
2 changes: 1 addition & 1 deletion app/src/molecules/InstrumentCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function InstrumentCard(props: InstrumentCardProps): JSX.Element {
pipetteSpecs={instrumentDiagramProps.pipetteSpecs}
mount={instrumentDiagramProps.mount}
transform="scale(0.3)"
transformOrigin={'-5% 52%'}
transformOrigin="-5% 52%"
/>
</Flex>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function ModalContentMixedSpinner(
return (
<Box
marginBottom={SPACING.spacing16}
width={'80px'}
width="80px"
css={`
@media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} {
width: 100px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Image({ imageUrl }: ImageProps): JSX.Element | null {
const hasComponent =
imageUrl != null && imageUrl.length > 0 && imageUrl[0].length > 0
return hasComponent ? (
<img src={new URL(imageUrl[0], import.meta.url).href} width={'100%'} />
<img src={new URL(imageUrl[0], import.meta.url).href} width="100%" />
) : null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('InterventionModal', () => {
it('renders headline', () => {
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{ label: 'first button', value: 'first' }}
secondButton={{ label: 'second button', value: 'second' }}
/>
Expand All @@ -27,7 +27,7 @@ describe('InterventionModal', () => {
it('renders buttons', () => {
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{ label: 'first button', value: 'first' }}
secondButton={{ label: 'second button', value: 'second' }}
furtherButtons={[
Expand All @@ -44,7 +44,7 @@ describe('InterventionModal', () => {
it('enforces single-item selection', () => {
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{ label: 'first button', value: 'first' }}
secondButton={{ label: 'second button', value: 'second' }}
furtherButtons={[{ label: 'third button', value: 'third' }]}
Expand All @@ -68,11 +68,11 @@ describe('InterventionModal', () => {
it('can start with a button selected', () => {
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{ label: 'first button', value: 'first' }}
secondButton={{ label: 'second button', value: 'second' }}
furtherButtons={[{ label: 'third button', value: 'third' }]}
initialSelected={'second'}
initialSelected="second"
/>
)
expect(inputElForButtonFromButtonText('first button').checked).toBeFalsy()
Expand All @@ -84,7 +84,7 @@ describe('InterventionModal', () => {
const onChange = vi.fn()
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{
label: 'first button',
value: 'first',
Expand All @@ -110,7 +110,7 @@ describe('InterventionModal', () => {
const onSelect = vi.fn()
render(
<ModalContentOneColSimpleButtons
headline={'headline'}
headline="headline"
firstButton={{ label: 'first button', value: 'first' }}
secondButton={{ label: 'second button', value: 'second' }}
furtherButtons={[{ label: 'third button', value: 'third' }]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function StandInContent({
}): JSX.Element {
return (
<Box
border={'4px dashed #A864FFFF'}
border="4px dashed #A864FFFF"
borderRadius={BORDERS.borderRadius8}
height="104px"
backgroundColor="#A864FF19"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -108,7 +108,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -133,7 +133,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -158,7 +158,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -182,7 +182,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -206,7 +206,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -228,7 +228,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand All @@ -253,7 +253,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand Down Expand Up @@ -281,7 +281,7 @@ describe('CalibrationTaskList', () => {
rerender(
<MemoryRouter>
<CalibrationTaskList
robotName={'otie'}
robotName="otie"
pipOffsetCalLauncher={mockPipOffsetCalLauncher}
tipLengthCalLauncher={mockTipLengthCalLauncher}
deckCalLauncher={mockDeckCalLauncher}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export function ChooseProtocolSlideoutComponent(
<LinkComponent
color={COLORS.blue55}
role="button"
to={''}
to=""
/>
),
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ export function AddFixtureModal({
}}
aria-label="back"
paddingX={SPACING.spacing16}
marginTop={'1.44rem'}
marginBottom={'0.56rem'}
marginTop="1.44rem"
marginBottom="0.56rem"
>
<LegacyStyledText css={GO_BACK_BUTTON_STYLE}>
{t('shared:go_back')}
Expand Down
6 changes: 3 additions & 3 deletions app/src/organisms/ODD/NetworkSettings/FailedToConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function FailedToConnect({
name="ot-alert"
size="3rem"
color={COLORS.red50}
aria-label={'failed_to_connect_invalidPassword'}
aria-label="failed_to_connect_invalidPassword"
/>
<Flex
flexDirection={DIRECTION_COLUMN}
Expand Down Expand Up @@ -83,13 +83,13 @@ export function FailedToConnect({
</Flex>
<Flex gridGap={SPACING.spacing8}>
<MediumButton
flex={'1'}
flex="1"
buttonType="secondary"
buttonText={t('change_network')}
onClick={handleChangeNetwork}
/>
<MediumButton
flex={'1'}
flex="1"
buttonText={i18n.format(t('shared:try_again'), 'capitalize')}
onClick={handleTryAgain}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const render = (longPress: UseLongPressResult) => {
<MemoryRouter>
<LongPressModal
longpress={longPress}
protocolId={'mockProtocol1'}
protocolId="mockProtocol1"
setShowDeleteConfirmationModal={mockFunc}
setTargetProtocolId={mockSetTargetProtocolId}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const render = (longPress: UseLongPressResult) => {
<MemoryRouter>
<LongPressModal
longpress={longPress}
transferId={'mockProtocol1'}
transferId="mockProtocol1"
setShowDeleteConfirmationModal={mockFunc}
setTargetTransferId={mockSetTargetTransferId}
/>
Expand Down
2 changes: 1 addition & 1 deletion opentrons-ai-client/src/molecules/Accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function Accordion({
<Icon
name={OT_CHECK}
color={COLORS.green50}
size={'20px'}
size="1.25rem"
data-testid={`${id}-${OT_CHECK}`}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions opentrons-ai-client/src/molecules/ChatDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,14 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element {
setInputFieldToCorrespondingRequest()
}}
>
<StyledIcon size={SPACING.spacing20} name={'reload'} />
<StyledIcon size={SPACING.spacing20} name="reload" />
</HoverShadow>
<HoverShadow
onClick={() => {
setShowFeedbackModal(true)
}}
>
<StyledIcon size={SPACING.spacing20} name={'thumbs-down'} />
<StyledIcon size={SPACING.spacing20} name="thumbs-down" />
</HoverShadow>
<HoverShadow
onClick={async () => {
Expand All @@ -229,7 +229,7 @@ export function ChatDisplay({ chat, chatId }: ChatDisplayProps): JSX.Element {
handleFileDownload()
}}
>
<StyledIcon size={SPACING.spacing20} name={'download'} />
<StyledIcon size={SPACING.spacing20} name="download" />
</HoverShadow>
</Flex>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function ControlledRadioButtonGroup({
<RadioButton
key={index}
{...radioButton}
radioButtonType={'small'}
radioButtonType="small"
isSelected={field.value === radioButton.buttonValue}
onChange={e => {
field.onChange(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const meta: Meta<typeof PromptPreview> = {
<Flex
backgroundColor={COLORS.grey10}
padding={SPACING.spacing40}
width={'596px'}
width="596px"
>
<Story />
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function PromptPreviewSection({
key={`item-tag-${index}`}
itemMaxWidth={itemMaxWidth}
>
<Tag text={item} type={'default'} />
<Tag text={item} type="default" />
</TagItemWrapper>
)
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function LabwareLiquidsSection(): JSX.Element | null {
setDisplayLabwareModal(true)
}}
text={t('add_opentrons_labware')}
textAlignment={'left'}
textAlignment="left"
iconName="plus"
/>

Expand Down Expand Up @@ -77,7 +77,7 @@ export function LabwareLiquidsSection(): JSX.Element | null {
setValue(LIQUIDS_FIELD_NAME, [...liquids, ''])
}}
text={t('add_opentrons_liquid')}
textAlignment={'left'}
textAlignment="left"
iconName="plus"
/>

Expand Down
4 changes: 2 additions & 2 deletions opentrons-ai-client/src/organisms/LabwareModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ export function LabwareModal({
<ListButton
key={`ListButton_${category}`}
type="noActive"
maxWidth={'100% !important'}
maxWidth="100% !important"
onClick={() => {
handleCategoryClick(category)
}}
>
<Flex id={`${category}`} width={'100%'}>
<Flex id={`${category}`} width="100%">
<ListButtonAccordion
mainHeadline={t(`${category}`)}
isExpanded={category === selectedCategory}
Expand Down
2 changes: 1 addition & 1 deletion opentrons-ai-client/src/organisms/StepsSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function StepsSection(): JSX.Element | null {
setValue(STEPS_FIELD_NAME, [...steps, ''])
}}
text={t('add_step')}
textAlignment={'left'}
textAlignment="left"
iconName="plus"
/>

Expand Down
Loading
Loading