Skip to content

Commit 25af683

Browse files
authored
ci: Fix Prettier bracket lines (#2073)
* Use bracketSameLine instead of deprecated jsxBracketSameLine * Run prettier
1 parent febcd65 commit 25af683

Some content is hidden

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

46 files changed

+179
-322
lines changed

.prettierrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
trailingComma: "es5"
1+
trailingComma: 'es5'
22
semi: false
33
singleQuote: true
4-
jsxBracketSameLine: true
4+
bracketSameLine: true

src/components/Accordion/Accordion.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ export const AccordionItem = ({
4545
aria-expanded={expanded}
4646
aria-controls={id}
4747
data-testid={`accordionButton_${id}`}
48-
onClick={handleToggle}
49-
>
48+
onClick={handleToggle}>
5049
{title}
5150
</button>
5251
</Heading>
5352
<div
5453
id={id}
5554
data-testid={`accordionItem_${id}`}
5655
className={contentClasses}
57-
hidden={!expanded}
58-
>
56+
hidden={!expanded}>
5957
{content}
6058
</div>
6159
</>
@@ -102,8 +100,7 @@ export const Accordion = ({
102100
<div
103101
className={classes}
104102
data-testid="accordion"
105-
aria-multiselectable={multiselectable || undefined}
106-
>
103+
aria-multiselectable={multiselectable || undefined}>
107104
{items.map((item, i) => (
108105
<AccordionItem
109106
key={`accordionItem_${i}`}

src/components/Alert/Alert.stories.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ export const withCTA = (): React.ReactElement => (
118118
<Button type="button" outline>
119119
Click here
120120
</Button>
121-
}
122-
>
121+
}>
123122
{testText}
124123
</Alert>
125124
)

src/components/Button/Button.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export const Button = ({
4848
className={classes}
4949
onClick={onClick}
5050
data-testid="button"
51-
{...defaultProps}
52-
>
51+
{...defaultProps}>
5352
{children}
5453
</button>
5554
)

src/components/Collection/Collection.stories.tsx

+5-10
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
116116
<CollectionItem
117117
variantComponent={
118118
<CollectionThumbnail src={gearsImage} alt="Alt text" />
119-
}
120-
>
119+
}>
121120
<CollectionHeading headingLevel="h3">
122121
<Link href="https://www.performance.gov/presidents-winners-press-release/">
123122
Gears of Government President’s Award winners
@@ -144,8 +143,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
144143
<CollectionItem
145144
variantComponent={
146145
<CollectionThumbnail src={wosb1Image} alt="Alt text" />
147-
}
148-
>
146+
}>
149147
<CollectionHeading headingLevel="h3">
150148
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
151149
Women-owned small business dashboard
@@ -168,8 +166,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => (
168166
<CollectionItem
169167
variantComponent={
170168
<CollectionThumbnail src={septImage} alt="Alt text" />
171-
}
172-
>
169+
}>
173170
<CollectionHeading headingLevel="h3">
174171
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
175172
September 2020 updates show progress on cross-agency and agency
@@ -294,8 +291,7 @@ export const collectionWithMixedItems = (): React.ReactElement => (
294291
<CollectionItem
295292
variantComponent={
296293
<CollectionThumbnail src={wosb1Image} alt="Alt text" />
297-
}
298-
>
294+
}>
299295
<CollectionHeading headingLevel="h3">
300296
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
301297
Women-owned small business dashboard
@@ -328,8 +324,7 @@ export const collectionWithMixedItems = (): React.ReactElement => (
328324
<CollectionItem
329325
variantComponent={
330326
<CollectionCalendarDate datetime="2020-09-17T12:00:00+01:00" />
331-
}
332-
>
327+
}>
333328
<CollectionHeading headingLevel="h3">
334329
<Link href="https://www.performance.gov/sba-wosb-dashboard/">
335330
September 2020 updates show progress on cross-agency and agency

src/components/Identifier/Identifier/Identifier.stories.tsx

+24-23
Original file line numberDiff line numberDiff line change
@@ -311,26 +311,27 @@ export const taxDisclaimerSpanish = (): React.ReactElement => (
311311
</Identifier>
312312
)
313313

314-
export const taxDisclaimerAndMultipleParentsAndLogos = (): React.ReactElement => (
315-
<Identifier>
316-
<IdentifierMasthead aria-label="Agency identifier">
317-
<IdentifierLogos>
318-
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
319-
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
320-
</IdentifierLogos>
321-
<IdentifierIdentity domain="domain.edu.mil.gov">
322-
{`An official website of the `}
323-
<Link href="#">Test Agency Name</Link>
324-
{` and the `}
325-
<Link href="#">Other Test Agency Name</Link>
326-
{`. Produced and published at taxpayer expense.`}
327-
</IdentifierIdentity>
328-
</IdentifierMasthead>
329-
<IdentifierLinks navProps={{ 'aria-label': 'Important links' }}>
330-
{testLinks}
331-
</IdentifierLinks>
332-
<IdentifierGov aria-label="U.S. government information and services">
333-
{testIdentifierGovContent}
334-
</IdentifierGov>
335-
</Identifier>
336-
)
314+
export const taxDisclaimerAndMultipleParentsAndLogos =
315+
(): React.ReactElement => (
316+
<Identifier>
317+
<IdentifierMasthead aria-label="Agency identifier">
318+
<IdentifierLogos>
319+
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
320+
<IdentifierLogo href="#">{testIdentifierLogo}</IdentifierLogo>
321+
</IdentifierLogos>
322+
<IdentifierIdentity domain="domain.edu.mil.gov">
323+
{`An official website of the `}
324+
<Link href="#">Test Agency Name</Link>
325+
{` and the `}
326+
<Link href="#">Other Test Agency Name</Link>
327+
{`. Produced and published at taxpayer expense.`}
328+
</IdentifierIdentity>
329+
</IdentifierMasthead>
330+
<IdentifierLinks navProps={{ 'aria-label': 'Important links' }}>
331+
{testLinks}
332+
</IdentifierLinks>
333+
<IdentifierGov aria-label="U.S. government information and services">
334+
{testIdentifierGovContent}
335+
</IdentifierGov>
336+
</Identifier>
337+
)

src/components/Modal/Modal.stories.tsx

+10-20
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ export const defaultModal = (): React.ReactElement => {
5757
ref={modalRef}
5858
id="example-modal-1"
5959
aria-labelledby="modal-1-heading"
60-
aria-describedby="modal-1-description"
61-
>
60+
aria-describedby="modal-1-description">
6261
<ModalHeading id="modal-1-heading">
6362
Are you sure you want to continue?
6463
</ModalHeading>
@@ -76,8 +75,7 @@ export const defaultModal = (): React.ReactElement => {
7675
modalRef={modalRef}
7776
closer
7877
unstyled
79-
className="padding-105 text-center"
80-
>
78+
className="padding-105 text-center">
8179
Go back
8280
</ModalToggleButton>
8381
</ButtonGroup>
@@ -101,8 +99,7 @@ export const largeModal = (): React.ReactElement => {
10199
isLarge
102100
aria-labelledby="modal-2-heading"
103101
aria-describedby="modal-2-description"
104-
id="example-modal-2"
105-
>
102+
id="example-modal-2">
106103
<ModalHeading id="modal-2-heading">
107104
Are you sure you want to continue?
108105
</ModalHeading>
@@ -120,8 +117,7 @@ export const largeModal = (): React.ReactElement => {
120117
modalRef={modalRef}
121118
closer
122119
unstyled
123-
className="padding-105 text-center"
124-
>
120+
className="padding-105 text-center">
125121
Go back
126122
</ModalToggleButton>
127123
</ButtonGroup>
@@ -144,8 +140,7 @@ export const forceActionModal = (): React.ReactElement => {
144140
forceAction
145141
aria-labelledby="modal-3-heading"
146142
aria-describedby="modal-3-description"
147-
id="example-modal-3"
148-
>
143+
id="example-modal-3">
149144
<ModalHeading id="modal-3-heading">
150145
Your session will end soon.
151146
</ModalHeading>
@@ -165,8 +160,7 @@ export const forceActionModal = (): React.ReactElement => {
165160
modalRef={modalRef}
166161
closer
167162
unstyled
168-
className="padding-105 text-center"
169-
>
163+
className="padding-105 text-center">
170164
Sign out
171165
</ModalToggleButton>
172166
</ButtonGroup>
@@ -188,8 +182,7 @@ export const customFocusElementModal = (): React.ReactElement => {
188182
ref={modalRef}
189183
id="example-modal-1"
190184
aria-labelledby="modal-1-heading"
191-
aria-describedby="modal-1-description"
192-
>
185+
aria-describedby="modal-1-description">
193186
<ModalHeading id="modal-1-heading">
194187
Are you sure you want to continue?
195188
</ModalHeading>
@@ -211,8 +204,7 @@ export const customFocusElementModal = (): React.ReactElement => {
211204
modalRef={modalRef}
212205
closer
213206
unstyled
214-
className="padding-105 text-center"
215-
>
207+
className="padding-105 text-center">
216208
Go back
217209
</ModalToggleButton>
218210
</ButtonGroup>
@@ -236,8 +228,7 @@ export const initiallyOpenModal = (): React.ReactElement => {
236228
id="example-modal-1"
237229
aria-labelledby="modal-1-heading"
238230
aria-describedby="modal-1-description"
239-
isInitiallyOpen
240-
>
231+
isInitiallyOpen>
241232
<ModalHeading id="modal-1-heading">
242233
Are you sure you want to continue?
243234
</ModalHeading>
@@ -255,8 +246,7 @@ export const initiallyOpenModal = (): React.ReactElement => {
255246
modalRef={modalRef}
256247
closer
257248
unstyled
258-
className="padding-105 text-center"
259-
>
249+
className="padding-105 text-center">
260250
Go back
261251
</ModalToggleButton>
262252
</ButtonGroup>

src/components/Modal/Modal.test.tsx

+7-14
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ const ExampleModal = ({
6464
aria-labelledby="modal-1-heading"
6565
aria-describedby="modal-1-description"
6666
forceAction={forceAction}
67-
modalRoot="#modal-root"
68-
>
67+
modalRoot="#modal-root">
6968
<ModalHeading id="modal-1-heading">
7069
Are you sure you want to continue?
7170
</ModalHeading>
@@ -79,17 +78,15 @@ const ExampleModal = ({
7978
<Button
8079
type="button"
8180
data-close-modal
82-
onClick={(e) => modalRef.current?.toggleModal(e, false)}
83-
>
81+
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
8482
Continue without saving
8583
</Button>
8684
<Button
8785
type="button"
8886
data-close-modal
8987
unstyled
9088
className="padding-105 text-center"
91-
onClick={(e) => modalRef.current?.toggleModal(e, false)}
92-
>
89+
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
9390
Go back
9491
</Button>
9592
</ButtonGroup>
@@ -112,8 +109,7 @@ const ExampleModalWithFocusElement = (): React.ReactElement => {
112109
id="example-modal-1"
113110
aria-labelledby="modal-1-heading"
114111
aria-describedby="modal-1-description"
115-
modalRoot="#modal-root"
116-
>
112+
modalRoot="#modal-root">
117113
<ModalHeading id="modal-1-heading">
118114
Are you sure you want to continue?
119115
</ModalHeading>
@@ -130,17 +126,15 @@ const ExampleModalWithFocusElement = (): React.ReactElement => {
130126
<Button
131127
type="button"
132128
data-close-modal
133-
onClick={(e) => modalRef.current?.toggleModal(e, false)}
134-
>
129+
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
135130
Continue without saving
136131
</Button>
137132
<Button
138133
type="button"
139134
data-close-modal
140135
unstyled
141136
className="padding-105 text-center"
142-
onClick={(e) => modalRef.current?.toggleModal(e, false)}
143-
>
137+
onClick={(e) => modalRef.current?.toggleModal(e, false)}>
144138
Go back
145139
</Button>
146140
</ButtonGroup>
@@ -191,8 +185,7 @@ describe('Modal component', () => {
191185
<Modal
192186
id={testModalId}
193187
aria-labelledby="modal-label"
194-
aria-describedby="modal-description"
195-
>
188+
aria-describedby="modal-description">
196189
Test modal
197190
</Modal>
198191
)

src/components/Modal/Modal.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,15 @@ export const ModalForwardRef: React.ForwardRefRenderFunction<
172172
data-force-action={forceAction}
173173
isVisible={isOpen}
174174
handleClose={closeModal}
175-
forceAction={forceAction}
176-
>
175+
forceAction={forceAction}>
177176
<ModalWindow
178177
modalId={id}
179178
{...divProps}
180179
ref={modalEl}
181180
isLarge={isLarge}
182181
forceAction={forceAction}
183182
tabIndex={-1}
184-
handleClose={closeModal}
185-
>
183+
handleClose={closeModal}>
186184
{children}
187185
</ModalWindow>
188186
</ModalWrapper>

src/components/Modal/ModalCloseButton/ModalCloseButton.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export const ModalCloseButton = ({
1818
aria-label="Close this window"
1919
onClick={handleClose}
2020
data-close-modal
21-
type="button"
22-
>
21+
type="button">
2322
<Icon.Close aria-hidden="true" />
2423
</Button>
2524
)

src/components/Modal/ModalOpenLink.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ describe('ModalOpenLink', () => {
103103
<ModalOpenLink<CustomLinkProps>
104104
to="#testModal"
105105
asCustom={CustomLink}
106-
modalRef={modalRef}
107-
>
106+
modalRef={modalRef}>
108107
Open modal
109108
</ModalOpenLink>
110109
)

src/components/Modal/ModalToggleButton.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ export const ModalToggleButton = ({
5353
{...dataProps}
5454
type="button"
5555
aria-controls={modalRef?.current?.modalId}
56-
onClick={handleClick}
57-
>
56+
onClick={handleClick}>
5857
{children}
5958
</Button>
6059
)

src/components/Modal/ModalWindow/ModalWindow.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export const ModalWindowForwardRef: React.ForwardRefRenderFunction<
4141
data-testid="modalWindow"
4242
className={classes}
4343
ref={ref}
44-
data-force-action={forceAction}
45-
>
44+
data-force-action={forceAction}>
4645
<div className="usa-modal__content">
4746
<div className="usa-modal__main">{children}</div>
4847
{!forceAction && (

src/components/Modal/ModalWrapper/ModalWrapper.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ describe('ModalWrapper component', () => {
1010
id="testModal"
1111
isVisible={false}
1212
forceAction={false}
13-
handleClose={jest.fn()}
14-
>
13+
handleClose={jest.fn()}>
1514
children
1615
</ModalWrapper>
1716
)

0 commit comments

Comments
 (0)