Skip to content

Commit

Permalink
ci: Fix Prettier bracket lines (#2073)
Browse files Browse the repository at this point in the history
* Use bracketSameLine instead of deprecated jsxBracketSameLine

* Run prettier
  • Loading branch information
brandonlenz authored May 13, 2022
1 parent febcd65 commit 25af683
Show file tree
Hide file tree
Showing 46 changed files with 179 additions and 322 deletions.
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
trailingComma: "es5"
trailingComma: 'es5'
semi: false
singleQuote: true
jsxBracketSameLine: true
bracketSameLine: true
9 changes: 3 additions & 6 deletions src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,15 @@ export const AccordionItem = ({
aria-expanded={expanded}
aria-controls={id}
data-testid={`accordionButton_${id}`}
onClick={handleToggle}
>
onClick={handleToggle}>
{title}
</button>
</Heading>
<div
id={id}
data-testid={`accordionItem_${id}`}
className={contentClasses}
hidden={!expanded}
>
hidden={!expanded}>
{content}
</div>
</>
Expand Down Expand Up @@ -102,8 +100,7 @@ export const Accordion = ({
<div
className={classes}
data-testid="accordion"
aria-multiselectable={multiselectable || undefined}
>
aria-multiselectable={multiselectable || undefined}>
{items.map((item, i) => (
<AccordionItem
key={`accordionItem_${i}`}
Expand Down
3 changes: 1 addition & 2 deletions src/components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ export const withCTA = (): React.ReactElement => (
<Button type="button" outline>
Click here
</Button>
}
>
}>
{testText}
</Alert>
)
3 changes: 1 addition & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export const Button = ({
className={classes}
onClick={onClick}
data-testid="button"
{...defaultProps}
>
{...defaultProps}>
{children}
</button>
)
Expand Down
15 changes: 5 additions & 10 deletions src/components/Collection/Collection.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
<CollectionItem
variantComponent={
<CollectionThumbnail src={gearsImage} alt="Alt text" />
}
>
}>
<CollectionHeading headingLevel="h3">
<Link href="https://www.performance.gov/presidents-winners-press-release/">
Gears of Government President’s Award winners
Expand All @@ -144,8 +143,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
<CollectionItem
variantComponent={
<CollectionThumbnail src={wosb1Image} alt="Alt text" />
}
>
}>
<CollectionHeading headingLevel="h3">
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
Women-owned small business dashboard
Expand All @@ -168,8 +166,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
<CollectionItem
variantComponent={
<CollectionThumbnail src={septImage} alt="Alt text" />
}
>
}>
<CollectionHeading headingLevel="h3">
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
September 2020 updates show progress on cross-agency and agency
Expand Down Expand Up @@ -294,8 +291,7 @@ export const collectionWithMixedItems = (): React.ReactElement => (
<CollectionItem
variantComponent={
<CollectionThumbnail src={wosb1Image} alt="Alt text" />
}
>
}>
<CollectionHeading headingLevel="h3">
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
Women-owned small business dashboard
Expand Down Expand Up @@ -328,8 +324,7 @@ export const collectionWithMixedItems = (): React.ReactElement => (
<CollectionItem
variantComponent={
<CollectionCalendarDate datetime="2020-09-17T12:00:00+01:00" />
}
>
}>
<CollectionHeading headingLevel="h3">
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
September 2020 updates show progress on cross-agency and agency
Expand Down
47 changes: 24 additions & 23 deletions src/components/Identifier/Identifier/Identifier.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,26 +311,27 @@ export const taxDisclaimerSpanish = (): React.ReactElement => (
</Identifier>
)

export const taxDisclaimerAndMultipleParentsAndLogos = (): React.ReactElement => (
<Identifier>
<IdentifierMasthead aria-label="Agency identifier">
<IdentifierLogos>
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
</IdentifierLogos>
<IdentifierIdentity domain="domain.edu.mil.gov">
{`An official website of the `}
<Link href="#">Test Agency Name</Link>
{` and the `}
<Link href="#">Other Test Agency Name</Link>
{`. Produced and published at taxpayer expense.`}
</IdentifierIdentity>
</IdentifierMasthead>
<IdentifierLinks navProps={{ 'aria-label': 'Important links' }}>
{testLinks}
</IdentifierLinks>
<IdentifierGov aria-label="U.S. government information and services">
{testIdentifierGovContent}
</IdentifierGov>
</Identifier>
)
export const taxDisclaimerAndMultipleParentsAndLogos =
(): React.ReactElement => (
<Identifier>
<IdentifierMasthead aria-label="Agency identifier">
<IdentifierLogos>
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
</IdentifierLogos>
<IdentifierIdentity domain="domain.edu.mil.gov">
{`An official website of the `}
<Link href="#">Test Agency Name</Link>
{` and the `}
<Link href="#">Other Test Agency Name</Link>
{`. Produced and published at taxpayer expense.`}
</IdentifierIdentity>
</IdentifierMasthead>
<IdentifierLinks navProps={{ 'aria-label': 'Important links' }}>
{testLinks}
</IdentifierLinks>
<IdentifierGov aria-label="U.S. government information and services">
{testIdentifierGovContent}
</IdentifierGov>
</Identifier>
)
30 changes: 10 additions & 20 deletions src/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ export const defaultModal = (): React.ReactElement => {
ref={modalRef}
id="example-modal-1"
aria-labelledby="modal-1-heading"
aria-describedby="modal-1-description"
>
aria-describedby="modal-1-description">
<ModalHeading id="modal-1-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -76,8 +75,7 @@ export const defaultModal = (): React.ReactElement => {
modalRef={modalRef}
closer
unstyled
className="padding-105 text-center"
>
className="padding-105 text-center">
Go back
</ModalToggleButton>
</ButtonGroup>
Expand All @@ -101,8 +99,7 @@ export const largeModal = (): React.ReactElement => {
isLarge
aria-labelledby="modal-2-heading"
aria-describedby="modal-2-description"
id="example-modal-2"
>
id="example-modal-2">
<ModalHeading id="modal-2-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -120,8 +117,7 @@ export const largeModal = (): React.ReactElement => {
modalRef={modalRef}
closer
unstyled
className="padding-105 text-center"
>
className="padding-105 text-center">
Go back
</ModalToggleButton>
</ButtonGroup>
Expand All @@ -144,8 +140,7 @@ export const forceActionModal = (): React.ReactElement => {
forceAction
aria-labelledby="modal-3-heading"
aria-describedby="modal-3-description"
id="example-modal-3"
>
id="example-modal-3">
<ModalHeading id="modal-3-heading">
Your session will end soon.
</ModalHeading>
Expand All @@ -165,8 +160,7 @@ export const forceActionModal = (): React.ReactElement => {
modalRef={modalRef}
closer
unstyled
className="padding-105 text-center"
>
className="padding-105 text-center">
Sign out
</ModalToggleButton>
</ButtonGroup>
Expand All @@ -188,8 +182,7 @@ export const customFocusElementModal = (): React.ReactElement => {
ref={modalRef}
id="example-modal-1"
aria-labelledby="modal-1-heading"
aria-describedby="modal-1-description"
>
aria-describedby="modal-1-description">
<ModalHeading id="modal-1-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -211,8 +204,7 @@ export const customFocusElementModal = (): React.ReactElement => {
modalRef={modalRef}
closer
unstyled
className="padding-105 text-center"
>
className="padding-105 text-center">
Go back
</ModalToggleButton>
</ButtonGroup>
Expand All @@ -236,8 +228,7 @@ export const initiallyOpenModal = (): React.ReactElement => {
id="example-modal-1"
aria-labelledby="modal-1-heading"
aria-describedby="modal-1-description"
isInitiallyOpen
>
isInitiallyOpen>
<ModalHeading id="modal-1-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -255,8 +246,7 @@ export const initiallyOpenModal = (): React.ReactElement => {
modalRef={modalRef}
closer
unstyled
className="padding-105 text-center"
>
className="padding-105 text-center">
Go back
</ModalToggleButton>
</ButtonGroup>
Expand Down
21 changes: 7 additions & 14 deletions src/components/Modal/Modal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ const ExampleModal = ({
aria-labelledby="modal-1-heading"
aria-describedby="modal-1-description"
forceAction={forceAction}
modalRoot="#modal-root"
>
modalRoot="#modal-root">
<ModalHeading id="modal-1-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -79,17 +78,15 @@ const ExampleModal = ({
<Button
type="button"
data-close-modal
onClick={(e) => modalRef.current?.toggleModal(e, false)}
>
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
Continue without saving
</Button>
<Button
type="button"
data-close-modal
unstyled
className="padding-105 text-center"
onClick={(e) => modalRef.current?.toggleModal(e, false)}
>
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
Go back
</Button>
</ButtonGroup>
Expand All @@ -112,8 +109,7 @@ const ExampleModalWithFocusElement = (): React.ReactElement => {
id="example-modal-1"
aria-labelledby="modal-1-heading"
aria-describedby="modal-1-description"
modalRoot="#modal-root"
>
modalRoot="#modal-root">
<ModalHeading id="modal-1-heading">
Are you sure you want to continue?
</ModalHeading>
Expand All @@ -130,17 +126,15 @@ const ExampleModalWithFocusElement = (): React.ReactElement => {
<Button
type="button"
data-close-modal
onClick={(e) => modalRef.current?.toggleModal(e, false)}
>
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
Continue without saving
</Button>
<Button
type="button"
data-close-modal
unstyled
className="padding-105 text-center"
onClick={(e) => modalRef.current?.toggleModal(e, false)}
>
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
Go back
</Button>
</ButtonGroup>
Expand Down Expand Up @@ -191,8 +185,7 @@ describe('Modal component', () => {
<Modal
id={testModalId}
aria-labelledby="modal-label"
aria-describedby="modal-description"
>
aria-describedby="modal-description">
Test modal
</Modal>
)
Expand Down
6 changes: 2 additions & 4 deletions src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,15 @@ export const ModalForwardRef: React.ForwardRefRenderFunction<
data-force-action={forceAction}
isVisible={isOpen}
handleClose={closeModal}
forceAction={forceAction}
>
forceAction={forceAction}>
<ModalWindow
modalId={id}
{...divProps}
ref={modalEl}
isLarge={isLarge}
forceAction={forceAction}
tabIndex={-1}
handleClose={closeModal}
>
handleClose={closeModal}>
{children}
</ModalWindow>
</ModalWrapper>
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ModalCloseButton/ModalCloseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export const ModalCloseButton = ({
aria-label="Close this window"
onClick={handleClose}
data-close-modal
type="button"
>
type="button">
<Icon.Close aria-hidden="true" />
</Button>
)
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ModalOpenLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ describe('ModalOpenLink', () => {
<ModalOpenLink<CustomLinkProps>
to="#testModal"
asCustom={CustomLink}
modalRef={modalRef}
>
modalRef={modalRef}>
Open modal
</ModalOpenLink>
)
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ModalToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export const ModalToggleButton = ({
{...dataProps}
type="button"
aria-controls={modalRef?.current?.modalId}
onClick={handleClick}
>
onClick={handleClick}>
{children}
</Button>
)
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ModalWindow/ModalWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export const ModalWindowForwardRef: React.ForwardRefRenderFunction<
data-testid="modalWindow"
className={classes}
ref={ref}
data-force-action={forceAction}
>
data-force-action={forceAction}>
<div className="usa-modal__content">
<div className="usa-modal__main">{children}</div>
{!forceAction && (
Expand Down
3 changes: 1 addition & 2 deletions src/components/Modal/ModalWrapper/ModalWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ describe('ModalWrapper component', () => {
id="testModal"
isVisible={false}
forceAction={false}
handleClose={jest.fn()}
>
handleClose={jest.fn()}>
children
</ModalWrapper>
)
Expand Down
Loading

0 comments on commit 25af683

Please sign in to comment.