diff --git a/.prettierrc b/.prettierrc index 7724d947e6..bc5f8fdd51 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,4 @@ -trailingComma: "es5" +trailingComma: 'es5' semi: false singleQuote: true -jsxBracketSameLine: true +bracketSameLine: true diff --git a/src/components/Accordion/Accordion.tsx b/src/components/Accordion/Accordion.tsx index 24d5ff0d8d..63b315eab2 100644 --- a/src/components/Accordion/Accordion.tsx +++ b/src/components/Accordion/Accordion.tsx @@ -45,8 +45,7 @@ export const AccordionItem = ({ aria-expanded={expanded} aria-controls={id} data-testid={`accordionButton_${id}`} - onClick={handleToggle} - > + onClick={handleToggle}> {title} @@ -54,8 +53,7 @@ export const AccordionItem = ({ id={id} data-testid={`accordionItem_${id}`} className={contentClasses} - hidden={!expanded} - > + hidden={!expanded}> {content} @@ -102,8 +100,7 @@ export const Accordion = ({
+ aria-multiselectable={multiselectable || undefined}> {items.map((item, i) => ( ( - } - > + }> {testText} ) diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 4596adecf4..26f4b2cc72 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -48,8 +48,7 @@ export const Button = ({ className={classes} onClick={onClick} data-testid="button" - {...defaultProps} - > + {...defaultProps}> {children} ) diff --git a/src/components/Collection/Collection.stories.tsx b/src/components/Collection/Collection.stories.tsx index c2269b8310..f577d0b128 100644 --- a/src/components/Collection/Collection.stories.tsx +++ b/src/components/Collection/Collection.stories.tsx @@ -116,8 +116,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => ( - } - > + }> Gears of Government President’s Award winners @@ -144,8 +143,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => ( - } - > + }> Women-owned small business dashboard @@ -168,8 +166,7 @@ export const collectionWithThumbnailItems = (): React.ReactElement => ( - } - > + }> September 2020 updates show progress on cross-agency and agency @@ -294,8 +291,7 @@ export const collectionWithMixedItems = (): React.ReactElement => ( - } - > + }> Women-owned small business dashboard @@ -328,8 +324,7 @@ export const collectionWithMixedItems = (): React.ReactElement => ( - } - > + }> September 2020 updates show progress on cross-agency and agency diff --git a/src/components/Identifier/Identifier/Identifier.stories.tsx b/src/components/Identifier/Identifier/Identifier.stories.tsx index b70dd90a3b..5a122101e6 100644 --- a/src/components/Identifier/Identifier/Identifier.stories.tsx +++ b/src/components/Identifier/Identifier/Identifier.stories.tsx @@ -311,26 +311,27 @@ export const taxDisclaimerSpanish = (): React.ReactElement => ( ) -export const taxDisclaimerAndMultipleParentsAndLogos = (): React.ReactElement => ( - - - - {testIdentifierLogo} - {testIdentifierLogo} - - - {`An official website of the `} - Test Agency Name - {` and the `} - Other Test Agency Name - {`. Produced and published at taxpayer expense.`} - - - - {testLinks} - - - {testIdentifierGovContent} - - -) +export const taxDisclaimerAndMultipleParentsAndLogos = + (): React.ReactElement => ( + + + + {testIdentifierLogo} + {testIdentifierLogo} + + + {`An official website of the `} + Test Agency Name + {` and the `} + Other Test Agency Name + {`. Produced and published at taxpayer expense.`} + + + + {testLinks} + + + {testIdentifierGovContent} + + + ) diff --git a/src/components/Modal/Modal.stories.tsx b/src/components/Modal/Modal.stories.tsx index 87fd9b83ca..47ab3fa517 100644 --- a/src/components/Modal/Modal.stories.tsx +++ b/src/components/Modal/Modal.stories.tsx @@ -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"> Are you sure you want to continue? @@ -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 @@ -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"> Are you sure you want to continue? @@ -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 @@ -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"> Your session will end soon. @@ -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 @@ -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"> Are you sure you want to continue? @@ -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 @@ -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> Are you sure you want to continue? @@ -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 diff --git a/src/components/Modal/Modal.test.tsx b/src/components/Modal/Modal.test.tsx index 248860104b..ccd3d1922d 100644 --- a/src/components/Modal/Modal.test.tsx +++ b/src/components/Modal/Modal.test.tsx @@ -64,8 +64,7 @@ const ExampleModal = ({ aria-labelledby="modal-1-heading" aria-describedby="modal-1-description" forceAction={forceAction} - modalRoot="#modal-root" - > + modalRoot="#modal-root"> Are you sure you want to continue? @@ -79,8 +78,7 @@ const ExampleModal = ({ @@ -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"> Are you sure you want to continue? @@ -130,8 +126,7 @@ const ExampleModalWithFocusElement = (): React.ReactElement => { @@ -191,8 +185,7 @@ describe('Modal component', () => { + aria-describedby="modal-description"> Test modal ) diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index 1261085f6c..de840f4dbb 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -172,8 +172,7 @@ export const ModalForwardRef: React.ForwardRefRenderFunction< data-force-action={forceAction} isVisible={isOpen} handleClose={closeModal} - forceAction={forceAction} - > + forceAction={forceAction}> + handleClose={closeModal}> {children} diff --git a/src/components/Modal/ModalCloseButton/ModalCloseButton.tsx b/src/components/Modal/ModalCloseButton/ModalCloseButton.tsx index 331a59e339..fb1843caf9 100644 --- a/src/components/Modal/ModalCloseButton/ModalCloseButton.tsx +++ b/src/components/Modal/ModalCloseButton/ModalCloseButton.tsx @@ -18,8 +18,7 @@ export const ModalCloseButton = ({ aria-label="Close this window" onClick={handleClose} data-close-modal - type="button" - > + type="button">
diff --git a/src/components/Modal/OpenModal.stories.tsx b/src/components/Modal/OpenModal.stories.tsx index c7a0882f08..ed0408289d 100644 --- a/src/components/Modal/OpenModal.stories.tsx +++ b/src/components/Modal/OpenModal.stories.tsx @@ -44,13 +44,11 @@ export const defaultModal = ( handleClose={argTypes.handleClose} forceAction={false} aria-labelledby="modal-1-heading" - aria-describedby="modal-1-description" - > + aria-describedby="modal-1-description"> + handleClose={argTypes.handleClose}> Are you sure you want to continue? @@ -68,8 +66,7 @@ export const defaultModal = ( type="button" onClick={argTypes.handleClose} unstyled - className="padding-105 text-center" - > + className="padding-105 text-center"> Go back @@ -90,14 +87,12 @@ export const largeModal = ( handleClose={argTypes.handleClose} forceAction={false} aria-labelledby="modal-2-heading" - aria-describedby="modal-2-description" - > + aria-describedby="modal-2-description"> + handleClose={argTypes.handleClose}> Are you sure you want to continue? @@ -115,8 +110,7 @@ export const largeModal = ( type="button" onClick={argTypes.handleClose} unstyled - className="padding-105 text-center" - > + className="padding-105 text-center"> Go back @@ -137,14 +131,12 @@ export const forceActionModal = ( handleClose={argTypes.handleClose} forceAction={true} aria-labelledby="modal-3-heading" - aria-describedby="modal-3-description" - > + aria-describedby="modal-3-description"> + handleClose={argTypes.handleClose}> Your session will end soon. @@ -164,8 +156,7 @@ export const forceActionModal = ( type="button" onClick={argTypes.handleClose} unstyled - className="padding-105 text-center" - > + className="padding-105 text-center"> Sign out diff --git a/src/components/Search/Search.test.tsx b/src/components/Search/Search.test.tsx index 0df96e4af6..37381deed3 100644 --- a/src/components/Search/Search.test.tsx +++ b/src/components/Search/Search.test.tsx @@ -39,8 +39,7 @@ describe('Search component', () => { + i18n={sampleLocalization}> ) expect(queryByLabelText('Buscar')).toBeInTheDocument() diff --git a/src/components/Search/Search.tsx b/src/components/Search/Search.tsx index 3f5fd19aad..e6c16a1429 100644 --- a/src/components/Search/Search.tsx +++ b/src/components/Search/Search.tsx @@ -50,8 +50,7 @@ export const Search = ({ className={classes} role="search" search={true} - {...formProps} - > + {...formProps}> diff --git a/src/components/SiteAlert/SiteAlert.stories.tsx b/src/components/SiteAlert/SiteAlert.stories.tsx index 8f29d46310..935f4bfea7 100644 --- a/src/components/SiteAlert/SiteAlert.stories.tsx +++ b/src/components/SiteAlert/SiteAlert.stories.tsx @@ -126,8 +126,7 @@ export const emergencyAlertWithList = (): React.ReactElement => ( + aria-label="Site alert"> {emergencyWithList} ) @@ -150,8 +149,7 @@ export const alertWithCustomControls = ( + variant={argTypes.variant}> {shortAlertContent} ) diff --git a/src/components/Tooltip/Tooltip.stories.tsx b/src/components/Tooltip/Tooltip.stories.tsx index 924fcc1af9..f23d9cdefa 100644 --- a/src/components/Tooltip/Tooltip.stories.tsx +++ b/src/components/Tooltip/Tooltip.stories.tsx @@ -74,8 +74,7 @@ export const tooltipWithUtilityClass = (): React.ReactElement => ( + label="Right"> Show on right @@ -104,8 +103,7 @@ export const CustomComponent = (): React.ReactElement => { label="Follow Link" asCustom={CustomLink} - to="http://www.truss.works" - > + to="http://www.truss.works"> This  is a custom component link. @@ -147,8 +145,7 @@ export const tooltipBottomRightWrap = (): React.ReactElement => ( left: '0', paddingRight: '32px', textAlign: 'right', - }} - > + }}> Default diff --git a/src/components/Tooltip/Tooltip.test.tsx b/src/components/Tooltip/Tooltip.test.tsx index db1aa891a9..0918e723ab 100644 --- a/src/components/Tooltip/Tooltip.test.tsx +++ b/src/components/Tooltip/Tooltip.test.tsx @@ -188,8 +188,7 @@ describe('Tooltip component', () => { label="Click me" asCustom={CustomLink} to="http://www.truss.works" - className="customTriggerClass" - > + className="customTriggerClass"> This is a custom link tooltip ) diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index b052994f20..22649e432e 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -238,8 +238,7 @@ export function Tooltip( className={tooltipBodyClasses} role="tooltip" aria-hidden={!isVisible} - style={positionStyles} - > + style={positionStyles}> {label} @@ -269,8 +268,7 @@ export function Tooltip( onFocus={showTooltip} onMouseLeave={hideTooltip} onBlur={hideTooltip} - onKeyDown={hideTooltip} - > + onKeyDown={hideTooltip}> {children} ( className={tooltipBodyClasses} role="tooltip" aria-hidden={!isVisible} - style={positionStyles} - > + style={positionStyles}> {label} // the span that wraps the element with have the tooltip class diff --git a/src/components/forms/CharacterCount/CharacterCount.tsx b/src/components/forms/CharacterCount/CharacterCount.tsx index 96b3369d26..ff88bc44dd 100644 --- a/src/components/forms/CharacterCount/CharacterCount.tsx +++ b/src/components/forms/CharacterCount/CharacterCount.tsx @@ -110,12 +110,8 @@ export const CharacterCount = ({ let InputComponent: React.ReactElement if (isTextArea) { - const { - onBlur, - onChange, - inputRef, - ...textAreaProps - } = remainingProps as Partial + const { onBlur, onChange, inputRef, ...textAreaProps } = + remainingProps as Partial InputComponent = (