diff --git a/package.json b/package.json index c86f1088b39..b37758eea4b 100644 --- a/package.json +++ b/package.json @@ -115,9 +115,9 @@ "pm2": "^5.3.0", "postcss": "^8.4.21", "postcss-loader": "^7.0.2", - "prettier": "^2.8.8", - "prettier-plugin-organize-imports": "^2.3.4", - "prettier-plugin-tailwindcss": "^0.2.1", + "prettier": "^3.2.5", + "prettier-plugin-organize-imports": "^3.2.4", + "prettier-plugin-tailwindcss": "^0.5.13", "raw-loader": "^4.0.2", "relay-compiler": "^14.1.0", "relay-config": "^12.0.0", diff --git a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx index d0721f72af5..1d335f21a90 100644 --- a/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx +++ b/packages/client/components/ActivityLibrary/ActivityDetailsSidebar.tsx @@ -122,9 +122,9 @@ const ActivityDetailsSidebar = (props: Props) => { selectedTemplate.scope === 'PUBLIC' ? teams : selectedTemplate.scope === 'ORGANIZATION' - ? teams.filter((team) => team.orgId === selectedTemplate.orgId) - : // it is a team-scoped template, templateTeam must exist - [templateTeam!] + ? teams.filter((team) => team.orgId === selectedTemplate.orgId) + : // it is a team-scoped template, templateTeam must exist + [templateTeam!] const availableTeamsRef = useRef(availableTeams) @@ -246,12 +246,12 @@ const ActivityDetailsSidebar = (props: Props) => { type === 'retrospective' ? 'Retro' : type === 'teamPrompt' - ? 'Standup' - : type === 'poker' - ? 'Poker' - : type === 'action' - ? 'Check-in' - : 'Meeting' + ? 'Standup' + : type === 'poker' + ? 'Poker' + : type === 'action' + ? 'Check-in' + : 'Meeting' const withRecurrence = type === 'teamPrompt' || (selectedTeam.organization.featureFlags.recurringRetros && type === 'retrospective') diff --git a/packages/client/components/ActivityLibrary/ActivityLibrary.tsx b/packages/client/components/ActivityLibrary/ActivityLibrary.tsx index 2bf9f7cb5ab..2c84540e135 100644 --- a/packages/client/components/ActivityLibrary/ActivityLibrary.tsx +++ b/packages/client/components/ActivityLibrary/ActivityLibrary.tsx @@ -173,19 +173,22 @@ const mapRetroSubCategories = (templates: readonly Template[]) => { const mapTeamCategories = (templates: readonly Template[]) => { // list public templates last const publicTemplates = [] as Template[] - const mapped = templates.reduce((acc, template) => { - const {team, scope} = template - if (scope === 'PUBLIC') { - publicTemplates.push(template) - } else { - const {name} = team - if (!acc[name]) { - acc[name] = [] + const mapped = templates.reduce( + (acc, template) => { + const {team, scope} = template + if (scope === 'PUBLIC') { + publicTemplates.push(template) + } else { + const {name} = team + if (!acc[name]) { + acc[name] = [] + } + acc[name]!.push(template) } - acc[name]!.push(template) - } - return acc - }, {} as Record) + return acc + }, + {} as Record + ) mapped['Parabol'] = publicTemplates return mapped @@ -245,8 +248,8 @@ export const ActivityLibrary = (props: Props) => { categoryId === QUICK_START_CATEGORY_ID ? template.isRecommended : categoryId === CUSTOM_CATEGORY_ID - ? template.scope !== 'PUBLIC' - : template.category === categoryId + ? template.scope !== 'PUBLIC' + : template.category === categoryId ) }, [searchQuery, filteredTemplates, categoryId]) diff --git a/packages/client/components/AvatarListUser.tsx b/packages/client/components/AvatarListUser.tsx index af6234b5a4e..e3f6a7d14a3 100644 --- a/packages/client/components/AvatarListUser.tsx +++ b/packages/client/components/AvatarListUser.tsx @@ -25,13 +25,13 @@ const StyledAvatar = styled(Avatar)<{ opacity: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 0 - : 1, + ? 0 + : 1, transform: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 'scale(0)' - : 'scale(1)', + ? 'scale(0)' + : 'scale(1)', transition: `all 300ms ${BezierCurve.DECELERATE}` })) diff --git a/packages/client/components/AzureDevOpsScopingSelectAllIssues.tsx b/packages/client/components/AzureDevOpsScopingSelectAllIssues.tsx index 24c42792294..bec857e9393 100644 --- a/packages/client/components/AzureDevOpsScopingSelectAllIssues.tsx +++ b/packages/client/components/AzureDevOpsScopingSelectAllIssues.tsx @@ -86,7 +86,7 @@ const AzureDevOpsScopingSelectAllIssues = (props: Props) => { service: 'azureDevOps', serviceTaskId, action - } as const) + }) as const ) const variables = { diff --git a/packages/client/components/BaseButton.tsx b/packages/client/components/BaseButton.tsx index 8fa371483f8..b505e4af7af 100644 --- a/packages/client/components/BaseButton.tsx +++ b/packages/client/components/BaseButton.tsx @@ -13,28 +13,33 @@ interface Root { size: 'small' | 'medium' | 'large' } -const ButtonRoot = styled(PlainButton)( - ({disabled, elevationResting, elevationHovered, elevationPressed, pressedDown, size}) => { - return { - // size is easy to override, it adds: fontSize, lineHeight, padding - ...(ui.buttonSizeStyles[size] as any), - alignItems: 'center', - border: '1px solid transparent', - boxShadow: disabled ? undefined : pressedDown ? elevationPressed : elevationResting, - display: 'flex', - flexShrink: 0, - justifyContent: 'center', - textAlign: 'center', - transition: `box-shadow 100ms ease-in`, - userSelect: 'none', - whiteSpace: 'nowrap', - ':hover,:focus,:active': { - boxShadow: disabled ? undefined : pressedDown ? elevationPressed : elevationHovered, - outline: pressedDown && 0 - } +const ButtonRoot = styled(PlainButton)(({ + disabled, + elevationResting, + elevationHovered, + elevationPressed, + pressedDown, + size +}) => { + return { + // size is easy to override, it adds: fontSize, lineHeight, padding + ...(ui.buttonSizeStyles[size] as any), + alignItems: 'center', + border: '1px solid transparent', + boxShadow: disabled ? undefined : pressedDown ? elevationPressed : elevationResting, + display: 'flex', + flexShrink: 0, + justifyContent: 'center', + textAlign: 'center', + transition: `box-shadow 100ms ease-in`, + userSelect: 'none', + whiteSpace: 'nowrap', + ':hover,:focus,:active': { + boxShadow: disabled ? undefined : pressedDown ? elevationPressed : elevationHovered, + outline: pressedDown && 0 } } -) +}) export interface BaseButtonProps extends PlainButtonProps { 'aria-label'?: string diff --git a/packages/client/components/BottomNavControl.tsx b/packages/client/components/BottomNavControl.tsx index 79c4aa58880..4d99fa1de24 100644 --- a/packages/client/components/BottomNavControl.tsx +++ b/packages/client/components/BottomNavControl.tsx @@ -25,8 +25,8 @@ const BottomNavControl = styled(FlatButton)((props) => { opacity: confirming ? 0.5 : status === TransitionStatus.MOUNTED || status === TransitionStatus.EXITING - ? 0 - : 1, + ? 0 + : 1, padding: 0, transformOrigin: 'center bottom', transition: `all 300ms ${BezierCurve.DECELERATE}`, diff --git a/packages/client/components/DeckActivityAvatars.tsx b/packages/client/components/DeckActivityAvatars.tsx index 034f09894d6..dbe21bd9462 100644 --- a/packages/client/components/DeckActivityAvatars.tsx +++ b/packages/client/components/DeckActivityAvatars.tsx @@ -25,8 +25,8 @@ const PeekingAvatar = styled(AvatarListUser)<{status?: TransitionStatus}>(({stat status === TransitionStatus.MOUNTED ? `translate(64px)` : status === TransitionStatus.EXITING - ? 'scale(0)' - : undefined + ? 'scale(0)' + : undefined })) interface Props { diff --git a/packages/client/components/EstimatePhaseArea.tsx b/packages/client/components/EstimatePhaseArea.tsx index a643b072273..ca0e6a12d0d 100644 --- a/packages/client/components/EstimatePhaseArea.tsx +++ b/packages/client/components/EstimatePhaseArea.tsx @@ -55,8 +55,8 @@ const innerStyle = (isDesktop: boolean, hasSingleDimension: boolean): React.CSSP ? '12px 8px 0' : '4px 4px 0' : isDesktop - ? '8px 40px 0' - : '8px 16px 0', + ? '8px 40px 0' + : '8px 16px 0', width: '100%', overflow: 'visible' } diff --git a/packages/client/components/GitHubScopingSelectAllIssues.tsx b/packages/client/components/GitHubScopingSelectAllIssues.tsx index 7430ba523f1..2c9599eab2c 100644 --- a/packages/client/components/GitHubScopingSelectAllIssues.tsx +++ b/packages/client/components/GitHubScopingSelectAllIssues.tsx @@ -72,7 +72,7 @@ const GitHubScopingSelectAllIssues = (props: Props) => { service: 'github', serviceTaskId, action - } as const) + }) as const ) const variables = { diff --git a/packages/client/components/GitLabScopingSelectAllIssues.tsx b/packages/client/components/GitLabScopingSelectAllIssues.tsx index 27271bf7fc8..1ad0082e02a 100644 --- a/packages/client/components/GitLabScopingSelectAllIssues.tsx +++ b/packages/client/components/GitLabScopingSelectAllIssues.tsx @@ -70,7 +70,7 @@ const GitLabScopingSelectAllIssues = (props: Props) => { service: 'gitlab', serviceTaskId, action - } as const) + }) as const ) const variables = { diff --git a/packages/client/components/JiraScopingSelectAllIssues.tsx b/packages/client/components/JiraScopingSelectAllIssues.tsx index c8c248cb982..bbba141580e 100644 --- a/packages/client/components/JiraScopingSelectAllIssues.tsx +++ b/packages/client/components/JiraScopingSelectAllIssues.tsx @@ -67,7 +67,7 @@ const JiraScopingSelectAllIssues = (props: Props) => { service: 'jira', serviceTaskId, action - } as const) + }) as const ) const variables = { diff --git a/packages/client/components/MiniPokerCard.tsx b/packages/client/components/MiniPokerCard.tsx index b380aa4bc04..cb85637e81d 100644 --- a/packages/client/components/MiniPokerCard.tsx +++ b/packages/client/components/MiniPokerCard.tsx @@ -17,8 +17,8 @@ const MiniPokerCardPlaceholder = styled('div')<{ border: color ? 0 : isFinal - ? `1px solid ${PALETTE.SLATE_400}` - : `1px dashed ${PALETTE.SLATE_600}`, + ? `1px solid ${PALETTE.SLATE_400}` + : `1px dashed ${PALETTE.SLATE_600}`, borderRadius: 2, color: color ? '#fff' : PALETTE.SLATE_600, cursor: onClick || canEdit ? 'pointer' : 'default', diff --git a/packages/client/components/OverflowAvatar.tsx b/packages/client/components/OverflowAvatar.tsx index ce914f71115..3d404c16d4d 100644 --- a/packages/client/components/OverflowAvatar.tsx +++ b/packages/client/components/OverflowAvatar.tsx @@ -30,14 +30,14 @@ const OverflowCount = styled('div')<{ opacity: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 0 - : 1, + ? 0 + : 1, overflow: 'hidden', transform: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 'scale(0)' - : 'scale(1)', + ? 'scale(0)' + : 'scale(1)', transition: `all 300ms ${BezierCurve.DECELERATE}`, userSelect: 'none', width diff --git a/packages/client/components/ParabolScopingSelectAllTasks.tsx b/packages/client/components/ParabolScopingSelectAllTasks.tsx index 58ea715b2e1..23406f7e8db 100644 --- a/packages/client/components/ParabolScopingSelectAllTasks.tsx +++ b/packages/client/components/ParabolScopingSelectAllTasks.tsx @@ -56,7 +56,7 @@ const ParabolScopingSelectAllTasks = (props: Props) => { service: 'PARABOL', serviceTaskId, action - } as const) + }) as const ) const variables = { meetingId, diff --git a/packages/client/components/PokerCard.tsx b/packages/client/components/PokerCard.tsx index 4c42aafd8db..418eecd46c9 100644 --- a/packages/client/components/PokerCard.tsx +++ b/packages/client/components/PokerCard.tsx @@ -40,41 +40,39 @@ const getRotation = ( return `translate(${x}px, ${y + selectedOffset}px)rotate(${rotation}deg)` } -const CardBase = styled('div')( - ({ - color, - isCollapsed, - isDesktop, - isSelected, - leftEdge, - radius, - rotation, - yOffset, - showTransition - }) => { - const transform = getRotation(isSelected, isCollapsed, leftEdge, radius, rotation, yOffset) - const hoverTransform = `${transform} translateY(-8px)` - return { - background: getPokerCardBackground(color), - borderRadius: 6, - cursor: 'pointer', - display: 'flex', - height: PokerCards.HEIGHT, - justifyContent: 'center', - position: 'absolute', - transform, - transition: showTransition - ? `transform ${isCollapsed ? COLLAPSE_DUR : EXPAND_DUR}ms ${BezierCurve.DECELERATE}` - : undefined, - userSelect: 'none', - width: PokerCards.WIDTH, - zIndex: isSelected && isCollapsed ? 1 : undefined, - '&:hover': { - transform: isCollapsed ? undefined : isDesktop ? hoverTransform : undefined - } +const CardBase = styled('div')(({ + color, + isCollapsed, + isDesktop, + isSelected, + leftEdge, + radius, + rotation, + yOffset, + showTransition +}) => { + const transform = getRotation(isSelected, isCollapsed, leftEdge, radius, rotation, yOffset) + const hoverTransform = `${transform} translateY(-8px)` + return { + background: getPokerCardBackground(color), + borderRadius: 6, + cursor: 'pointer', + display: 'flex', + height: PokerCards.HEIGHT, + justifyContent: 'center', + position: 'absolute', + transform, + transition: showTransition + ? `transform ${isCollapsed ? COLLAPSE_DUR : EXPAND_DUR}ms ${BezierCurve.DECELERATE}` + : undefined, + userSelect: 'none', + width: PokerCards.WIDTH, + zIndex: isSelected && isCollapsed ? 1 : undefined, + '&:hover': { + transform: isCollapsed ? undefined : isDesktop ? hoverTransform : undefined } } -) +}) const UpperLeftCardValue = styled('div')({ color: '#fff', diff --git a/packages/client/components/RaisedButton.tsx b/packages/client/components/RaisedButton.tsx index 08985122ca8..bf9a9cd36c8 100644 --- a/packages/client/components/RaisedButton.tsx +++ b/packages/client/components/RaisedButton.tsx @@ -17,19 +17,19 @@ const paletteColors = { const buttonLightThemes = ['white', 'gray'] -const StyledBaseButton = styled(BaseButton)<{palette?: keyof typeof paletteColors}>( - ({palette = 'gray'}) => { - const backgroundColor = paletteColors[palette] - const color = buttonLightThemes.includes(palette) ? PALETTE.SLATE_700 : '#FFFFFF' - return { - backgroundColor, - borderRadius: Radius.BUTTON_PILL, - color, - fontWeight: 600, - outline: 0 - } +const StyledBaseButton = styled(BaseButton)<{palette?: keyof typeof paletteColors}>(({ + palette = 'gray' +}) => { + const backgroundColor = paletteColors[palette] + const color = buttonLightThemes.includes(palette) ? PALETTE.SLATE_700 : '#FFFFFF' + return { + backgroundColor, + borderRadius: Radius.BUTTON_PILL, + color, + fontWeight: 600, + outline: 0 } -) +}) export interface RaisedButtonProps extends BaseButtonProps { palette?: keyof typeof paletteColors diff --git a/packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx b/packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx index e3e82f88859..355d4137c9b 100644 --- a/packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx +++ b/packages/client/components/Recurrence/UpdateRecurrenceSettingsModal.tsx @@ -115,8 +115,8 @@ export const UpdateRecurrenceSettingsModal = (props: Props) => { meetingType === 'teamPrompt' ? 'Standup' : meetingType === 'retrospective' - ? 'Retrospective' - : 'Meeting' + ? 'Retrospective' + : 'Meeting' const currentRecurrenceRule = meeting.meetingSeries?.recurrenceRule const atmosphere = useAtmosphere() const isMeetingSeriesActive = meeting.meetingSeries?.cancelledAt === null diff --git a/packages/client/components/ReflectionGroup/RemoteReflection.tsx b/packages/client/components/ReflectionGroup/RemoteReflection.tsx index abda2bda207..522533d3f7d 100644 --- a/packages/client/components/ReflectionGroup/RemoteReflection.tsx +++ b/packages/client/components/ReflectionGroup/RemoteReflection.tsx @@ -58,8 +58,8 @@ const RemoteReflectionModal = styled('div')<{ animation: animation ? animation : isSpotlight && !isDropping - ? `${circleAnimation(transform)} 3s ease infinite;` - : undefined, + ? `${circleAnimation(transform)} 3s ease infinite;` + : undefined, zIndex: isInViewerSpotlightResults ? ZIndex.REFLECTION_IN_FLIGHT_SPOTLIGHT : ZIndex.REFLECTION_IN_FLIGHT @@ -117,10 +117,10 @@ const getHeaderTransform = (ref: RefObject, topPadding = 18) => headerTop === maxTop ? 'arrow_downward' : headerLeft === maxLeft - ? 'arrow_forward' - : headerLeft === minLeft - ? 'arrow_back' - : ('arrow_upward' as RemoteReflectionArrow) + ? 'arrow_forward' + : headerLeft === minLeft + ? 'arrow_back' + : ('arrow_upward' as RemoteReflectionArrow) return { arrow, headerTransform: `translate(${headerLeft}px,${headerTop}px)` @@ -234,8 +234,8 @@ const RemoteReflection = (props: Props) => { remoteDrag?.isSpotlight ? Times.REFLECTION_SPOTLIGHT_DRAG_STALE_TIMEOUT : localPhase.phaseType === VOTE - ? 0 - : Times.REFLECTION_DRAG_STALE_TIMEOUT + ? 0 + : Times.REFLECTION_DRAG_STALE_TIMEOUT ) return () => { window.clearTimeout(timeoutRef.current) diff --git a/packages/client/components/ReflectionGroupVoting.tsx b/packages/client/components/ReflectionGroupVoting.tsx index 3e57244b5a8..0797172425e 100644 --- a/packages/client/components/ReflectionGroupVoting.tsx +++ b/packages/client/components/ReflectionGroupVoting.tsx @@ -63,8 +63,8 @@ const Votes = styled('span')<{voteCount: number; isExpanded: boolean}>( ? PALETTE.SLATE_200 : '#fff' : voteCount === 0 - ? PALETTE.SLATE_700 - : PALETTE.SKY_500, + ? PALETTE.SLATE_700 + : PALETTE.SKY_500, fontWeight: 600, padding: '0 4px', display: 'flex', diff --git a/packages/client/components/SwipeableDashSidebar.tsx b/packages/client/components/SwipeableDashSidebar.tsx index 9eab7a71a54..f59b6294c86 100644 --- a/packages/client/components/SwipeableDashSidebar.tsx +++ b/packages/client/components/SwipeableDashSidebar.tsx @@ -78,8 +78,8 @@ const updateIsSwipe = (clientX: number, clientY: number, isRightDrawer: boolean) ? swipingRight : swipingLeft : isRightDrawer - ? swipingLeft - : swipingRight + ? swipingLeft + : swipingRight } } diff --git a/packages/client/components/TaskEditor/useLinks.tsx b/packages/client/components/TaskEditor/useLinks.tsx index 81f103396a0..70cab4436e1 100644 --- a/packages/client/components/TaskEditor/useLinks.tsx +++ b/packages/client/components/TaskEditor/useLinks.tsx @@ -314,8 +314,8 @@ const useLinks = (editorState: EditorState, setEditorState: SetEditorState, hand renderModal: linkViewerData ? renderViewerModal : linkChangerData - ? renderChangerModal - : renderModal, + ? renderChangerModal + : renderModal, removeModal: linkViewerData || linkChangerData ? onRemoveModal : removeModal } } diff --git a/packages/client/components/TeamPrompt/TeamPromptOverflowAvatar.tsx b/packages/client/components/TeamPrompt/TeamPromptOverflowAvatar.tsx index adb79ceaa8e..b970988fdf5 100644 --- a/packages/client/components/TeamPrompt/TeamPromptOverflowAvatar.tsx +++ b/packages/client/components/TeamPrompt/TeamPromptOverflowAvatar.tsx @@ -29,14 +29,14 @@ const OverflowCount = styled('div')<{ opacity: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 0 - : 1, + ? 0 + : 1, overflow: 'hidden', transform: !isAnimated ? undefined : status === TransitionStatus.EXITING || status === TransitionStatus.MOUNTED - ? 'scale(0)' - : 'scale(1)', + ? 'scale(0)' + : 'scale(1)', transition: `all 300ms ${BezierCurve.DECELERATE}`, userSelect: 'none', width diff --git a/packages/client/hooks/useDraggableReflectionCard.tsx b/packages/client/hooks/useDraggableReflectionCard.tsx index fd04ccb23c8..8d4d0e2df69 100644 --- a/packages/client/hooks/useDraggableReflectionCard.tsx +++ b/packages/client/hooks/useDraggableReflectionCard.tsx @@ -261,8 +261,8 @@ const useDragAndDrop = ( targetGroupId && reflectionGroupId !== targetGroupId ? 'REFLECTION_GROUP' : !targetGroupId && reflectionCount > 0 && !isReflectionInSpotlightResults - ? 'REFLECTION_GRID' - : null + ? 'REFLECTION_GRID' + : null handleDrop(atmosphere, reflectionId, drag, targetType, targetGroupId) if (spotlightGroup?.id) { const event = isReflectionInSpotlightResults diff --git a/packages/client/hooks/useUnusedRecords.ts b/packages/client/hooks/useUnusedRecords.ts index 9ad347d83fd..57a65d52fba 100644 --- a/packages/client/hooks/useUnusedRecords.ts +++ b/packages/client/hooks/useUnusedRecords.ts @@ -14,8 +14,8 @@ const useUnusedRecords = ( unusedServiceTaskIds.length === 0 || usedServiceTaskIds.size === Threshold.MAX_POKER_STORIES ? true : unusedServiceTaskIds.length === serviceTaskIds.length - ? false - : null + ? false + : null return [unusedServiceTaskIds, allSelected] }, [serviceTaskIds, usedServiceTaskIds]) } diff --git a/packages/client/modules/admin/containers/Graphql/GraphqlContainer.tsx b/packages/client/modules/admin/containers/Graphql/GraphqlContainer.tsx index 36a2757d828..69217cf5b4c 100644 --- a/packages/client/modules/admin/containers/Graphql/GraphqlContainer.tsx +++ b/packages/client/modules/admin/containers/Graphql/GraphqlContainer.tsx @@ -35,8 +35,8 @@ const GraphqlContainer = () => { setMode === 'dark' ? true : setMode === 'light' - ? false - : window.matchMedia('(prefers-color-scheme: dark)').matches + ? false + : window.matchMedia('(prefers-color-scheme: dark)').matches setIsDarkMode(nextTheme) }) diff --git a/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/QuickStats.tsx b/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/QuickStats.tsx index ce147e9e4b3..67b3e25f034 100644 --- a/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/QuickStats.tsx +++ b/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/QuickStats.tsx @@ -19,7 +19,7 @@ const statLabel = (idx: number, len: number) => fontSize: 36, lineHeight: '40px', paddingTop: 12 - } as React.CSSProperties) + }) as React.CSSProperties const descriptionLabel = (idx: number, len: number) => ({ @@ -31,7 +31,7 @@ const descriptionLabel = (idx: number, len: number) => fontWeight: 600, paddingBottom: 12, textTransform: 'uppercase' - } as React.CSSProperties) + }) as React.CSSProperties const tableStyle = { borderSpacing: '2px 0', diff --git a/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/RetroTopic.tsx b/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/RetroTopic.tsx index abbfc8a2e67..15eb9aeb052 100644 --- a/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/RetroTopic.tsx +++ b/packages/client/modules/email/components/SummaryEmail/MeetingSummaryEmail/RetroTopic.tsx @@ -130,8 +130,8 @@ const RetroTopic = (props: Props) => { commentCount === 0 ? 'No Comments' : commentCount >= 101 - ? 'See 100+ Comments' - : `See ${commentCount} ${plural(commentCount, 'Comment')}` + ? 'See 100+ Comments' + : `See ${commentCount} ${plural(commentCount, 'Comment')}` const commentLinkStyle = commentCount === 0 ? noCommentLinkStyle : someCommentsLinkStyle const corsOptions = isEmail ? EMAIL_CORS_OPTIONS : APP_CORS_OPTIONS return ( diff --git a/packages/client/modules/meeting/components/TemplateSharing.tsx b/packages/client/modules/meeting/components/TemplateSharing.tsx index 6bc08889246..874fbe3b3a1 100644 --- a/packages/client/modules/meeting/components/TemplateSharing.tsx +++ b/packages/client/modules/meeting/components/TemplateSharing.tsx @@ -122,8 +122,8 @@ export const UnstyledTemplateSharing = (props: Props) => { scope === 'TEAM' ? `Only visible to ${teamName}` : scope === 'ORGANIZATION' - ? `Sharing with ${orgName}` - : 'Sharing publicly' + ? `Sharing with ${orgName}` + : 'Sharing publicly' return ( <> { const channelState = activeChannel ? ChannelState.ready : localChannelId && isTokenValid - ? ChannelState.loading - : ChannelState.error + ? ChannelState.loading + : ChannelState.error const activeText = activeChannel ? activeChannel.name : channelState === ChannelState.loading - ? '' - : 'Token Expired! Click to renew' + ? '' + : 'Token Expired! Click to renew' const {togglePortal, menuPortal, originRef, menuProps} = useMenu( MenuPosition.UPPER_RIGHT, { diff --git a/packages/client/modules/userDashboard/components/OrgBilling/OrgPlan.tsx b/packages/client/modules/userDashboard/components/OrgBilling/OrgPlan.tsx index 93f2d865896..f7df386a5b6 100644 --- a/packages/client/modules/userDashboard/components/OrgBilling/OrgPlan.tsx +++ b/packages/client/modules/userDashboard/components/OrgBilling/OrgPlan.tsx @@ -93,8 +93,8 @@ const Plan = styled('div')<{tier: TierEnum; isTablet: boolean; isActive: boolean ? tier === 'starter' ? `2px solid ${PALETTE.GRAPE_500}` : tier === 'team' - ? `2px solid ${PALETTE.AQUA_400}` - : `2px solid ${PALETTE.TOMATO_400}` + ? `2px solid ${PALETTE.AQUA_400}` + : `2px solid ${PALETTE.TOMATO_400}` : '2px solid transparent', transition: 'all ease 0.5s', '&:hover': { @@ -102,8 +102,8 @@ const Plan = styled('div')<{tier: TierEnum; isTablet: boolean; isActive: boolean tier === 'starter' ? PALETTE.GRAPE_500 : tier === 'team' - ? PALETTE.AQUA_400 - : PALETTE.TOMATO_500 + ? PALETTE.AQUA_400 + : PALETTE.TOMATO_500 }` }, '&:last-of-type': { @@ -125,14 +125,14 @@ const CTAButton = styled(BaseButton)<{ buttonStyle === 'primary' ? PALETTE.GRADIENT_TOMATO_600_ROSE_500 : buttonStyle === 'secondary' - ? PALETTE.WHITE - : PALETTE.SLATE_300, + ? PALETTE.WHITE + : PALETTE.SLATE_300, color: buttonStyle === 'primary' ? PALETTE.WHITE : buttonStyle === 'secondary' - ? PALETTE.SLATE_900 - : PALETTE.SLATE_600, + ? PALETTE.SLATE_900 + : PALETTE.SLATE_600, border: buttonStyle === 'secondary' ? `1px solid ${PALETTE.SLATE_600}` : 'none', transition: 'all ease 0.5s', ':hover': { @@ -141,8 +141,8 @@ const CTAButton = styled(BaseButton)<{ buttonStyle === 'primary' ? PALETTE.GRADIENT_TOMATO_700_ROSE_600 : buttonStyle === 'secondary' - ? PALETTE.SLATE_300 - : PALETTE.SLATE_300 + ? PALETTE.SLATE_300 + : PALETTE.SLATE_300 } })) diff --git a/packages/client/modules/userDashboard/containers/UserColumns/UserColumnsContainer.tsx b/packages/client/modules/userDashboard/containers/UserColumns/UserColumnsContainer.tsx index dace313f1f2..72aebf89936 100644 --- a/packages/client/modules/userDashboard/containers/UserColumns/UserColumnsContainer.tsx +++ b/packages/client/modules/userDashboard/containers/UserColumns/UserColumnsContainer.tsx @@ -77,8 +77,8 @@ const UserColumnsContainer = (props: Props) => { return teamFiltered && inTeam }) : teamIds - ? teams.filter(({id}) => teamIds.includes(id)) - : teams + ? teams.filter(({id}) => teamIds.includes(id)) + : teams const firstTeam = filteredTeams[0] if (firstTeam) { diff --git a/packages/client/package.json b/packages/client/package.json index 4371591433b..6e7616c0b22 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -55,7 +55,6 @@ "eslint-plugin-react-hooks": "^1.6.1", "jest": "^29.5.0", "lint-staged": "^10.1.7", - "prettier": "^2.8.8", "react-refresh": "^0.9.0", "strict-event-emitter-types": "^2.0.0", "typescript": "^5.3.3", diff --git a/packages/client/types/generics.ts b/packages/client/types/generics.ts index 7a1d76dafb0..81611879c63 100644 --- a/packages/client/types/generics.ts +++ b/packages/client/types/generics.ts @@ -7,24 +7,24 @@ export type DeepPartial = { [P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial[] : T[P] extends readonly (infer U)[] - ? readonly DeepPartial[] - : DeepPartial + ? readonly DeepPartial[] + : DeepPartial } export type DeepNullable = { [P in keyof T]: T[P] extends (infer U)[] ? DeepNullable[] | null : T[P] extends readonly (infer U)[] - ? readonly DeepNullable[] | null - : DeepNullable | null + ? readonly DeepNullable[] | null + : DeepNullable | null } export type DeepNonNullable = T extends (...args: any[]) => any ? T : T extends any[] - ? DeepNonNullableArray - : T extends object - ? DeepNonNullableObject - : T + ? DeepNonNullableArray + : T extends object + ? DeepNonNullableObject + : T interface DeepNonNullableArray extends Array>> {} @@ -96,8 +96,8 @@ export type WithFieldsAsType = { [K in keyof TObj]: K extends F ? NType : TObj[K] extends object - ? WithFieldsAsType - : TObj[K] + ? WithFieldsAsType + : TObj[K] } export type Tuple = R['length'] extends N ? R : Tuple diff --git a/packages/client/types/relayMutations.ts b/packages/client/types/relayMutations.ts index 9fb3ff8f125..cec183ca685 100644 --- a/packages/client/types/relayMutations.ts +++ b/packages/client/types/relayMutations.ts @@ -61,8 +61,8 @@ export type OnNextHandler = ( payload: null extends TSubResponse ? Omit, ' $fragmentType'> | null : undefined extends TSubResponse - ? Omit, ' $fragmentType'> | undefined - : Omit, + ? Omit, ' $fragmentType'> | undefined + : Omit, context: C ) => void @@ -70,9 +70,11 @@ export type SimpleMutation = { (atmosphere: Atmosphere, variables: T['variables']): ReturnType | undefined } export type StandardMutation = { - (atmosphere: Atmosphere, variables: T['variables'], localHandlers: C): ReturnType< - typeof commitMutation - > + ( + atmosphere: Atmosphere, + variables: T['variables'], + localHandlers: C + ): ReturnType } export type RelayDateHack = Omit & { diff --git a/packages/client/utils/relay/insertEdge.ts b/packages/client/utils/relay/insertEdge.ts index dc50f7c86e8..4242b17e4e8 100644 --- a/packages/client/utils/relay/insertEdge.ts +++ b/packages/client/utils/relay/insertEdge.ts @@ -50,8 +50,8 @@ export const insertEdgeAfter = ( const nextIdx = sortValue ? idxFinder(newName, nodes, sortValue) : isAscending - ? edges.length - 1 - : 0 + ? edges.length - 1 + : 0 const nextEdges = [...edges.slice(0, nextIdx), newEdge, ...edges.slice(nextIdx)] connection.setLinkedRecords(nextEdges, 'edges') } diff --git a/packages/client/utils/screenBugs/Bug.ts b/packages/client/utils/screenBugs/Bug.ts index 0ab7411d40d..e9703da829e 100644 --- a/packages/client/utils/screenBugs/Bug.ts +++ b/packages/client/utils/screenBugs/Bug.ts @@ -586,16 +586,22 @@ export default class Bug { twitch = (deathType: number, _legPos?: number) => { let legPos = _legPos || 0 if (deathType === 0 || deathType === 1) { - this.twitchTimer = window.setTimeout(() => { - this.bug.style.backgroundPosition = - '-' + (deathType * 2 + (legPos % 2)) * this.options.bugWidth + 'px 100%' - this.twitchTimer = window.setTimeout(() => { - legPos++ + this.twitchTimer = window.setTimeout( + () => { this.bug.style.backgroundPosition = '-' + (deathType * 2 + (legPos % 2)) * this.options.bugWidth + 'px 100%' - this.twitch(deathType, ++legPos) - }, this.random(300, 800)) - }, this.random(1000, 10000)) + this.twitchTimer = window.setTimeout( + () => { + legPos++ + this.bug.style.backgroundPosition = + '-' + (deathType * 2 + (legPos % 2)) * this.options.bugWidth + 'px 100%' + this.twitch(deathType, ++legPos) + }, + this.random(300, 800) + ) + }, + this.random(1000, 10000) + ) } } diff --git a/packages/client/utils/sortByTier.ts b/packages/client/utils/sortByTier.ts index 33ff202a964..7f0751b36e9 100644 --- a/packages/client/utils/sortByTier.ts +++ b/packages/client/utils/sortByTier.ts @@ -9,10 +9,10 @@ const sortByTier = tierVal(b) - ? 1 - : a.name.toLowerCase() < b.name.toLowerCase() - ? -1 - : 1 + ? 1 + : a.name.toLowerCase() < b.name.toLowerCase() + ? -1 + : 1 ) return teamsSlice as unknown as T } diff --git a/packages/embedder/indexing/retrospectiveDiscussionTopic.ts b/packages/embedder/indexing/retrospectiveDiscussionTopic.ts index 03af3b510ba..5a9d1c423cc 100644 --- a/packages/embedder/indexing/retrospectiveDiscussionTopic.ts +++ b/packages/embedder/indexing/retrospectiveDiscussionTopic.ts @@ -154,7 +154,7 @@ export const createTextFromRetrospectiveDiscussionTopic = async ( } } - markdown = prettier.format(markdown, { + markdown = await prettier.format(markdown, { parser: 'markdown', proseWrap: 'always', printWidth: 72 diff --git a/packages/embedder/textEmbeddingsnterface.d.ts b/packages/embedder/textEmbeddingsnterface.d.ts index 618eea7db91..da30347ab11 100644 --- a/packages/embedder/textEmbeddingsnterface.d.ts +++ b/packages/embedder/textEmbeddingsnterface.d.ts @@ -9,8 +9,8 @@ type XOR = T | U extends object ? (Without & U) | (Without & T type OneOf = T extends [infer Only] ? Only : T extends [infer A, infer B, ...infer Rest] - ? OneOf<[XOR, ...Rest]> - : never + ? OneOf<[XOR, ...Rest]> + : never export interface paths { '/decode': { diff --git a/packages/server/.eslintignore b/packages/server/.eslintignore index 18e5758e413..0f0f4df4e30 100644 --- a/packages/server/.eslintignore +++ b/packages/server/.eslintignore @@ -10,3 +10,4 @@ graphql/public/schema.graphql _legacy.graphql migrationTemplate.ts billing/debug.ts +pg.d.ts diff --git a/packages/server/billing/helpers/generateInvoice.ts b/packages/server/billing/helpers/generateInvoice.ts index 50adc213ef6..8a94adaffea 100644 --- a/packages/server/billing/helpers/generateInvoice.ts +++ b/packages/server/billing/helpers/generateInvoice.ts @@ -73,12 +73,15 @@ interface DetailedLineItemDict { const getEmailLookup = async (userIds: string[], dataLoader: DataLoaderWorker) => { const usersAndEmails = (await dataLoader.get('users').loadMany(userIds)).filter(isValid) - return usersAndEmails.reduce((dict, doc) => { - if (doc) { - dict[doc.id] = doc.email - } - return dict - }, {} as {[key: string]: string}) as EmailLookup + return usersAndEmails.reduce( + (dict, doc) => { + if (doc) { + dict[doc.id] = doc.email + } + return dict + }, + {} as {[key: string]: string} + ) as EmailLookup } const reduceItemsByType = (typesDict: TypesDict, email: string) => { diff --git a/packages/server/database/stricterR.ts b/packages/server/database/stricterR.ts index 3878ad34cd1..434b2cd3434 100644 --- a/packages/server/database/stricterR.ts +++ b/packages/server/database/stricterR.ts @@ -9,8 +9,8 @@ type DeepPartial = [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends ReadonlyArray - ? ReadonlyArray> - : DeepPartial + ? ReadonlyArray> + : DeepPartial } // User defined schemas @@ -421,8 +421,8 @@ export interface RQuery { ): T extends Array ? Promise> : T extends RCursor - ? Promise - : Promise> + ? Promise + : Promise> then(): never } export interface RDatum extends RQuery { diff --git a/packages/server/database/types/CheckInStage.ts b/packages/server/database/types/CheckInStage.ts index f5ad00e97d0..4d7ef6b5f69 100644 --- a/packages/server/database/types/CheckInStage.ts +++ b/packages/server/database/types/CheckInStage.ts @@ -2,7 +2,10 @@ import GenericMeetingStage from './GenericMeetingStage' export default class CheckInStage extends GenericMeetingStage { phaseType!: 'checkin' - constructor(public teamMemberId: string, durations?: number[] | undefined) { + constructor( + public teamMemberId: string, + durations?: number[] | undefined + ) { super({phaseType: 'checkin', durations}) } } diff --git a/packages/server/database/types/GenericMeetingPhase.ts b/packages/server/database/types/GenericMeetingPhase.ts index a419506d11d..5082d153812 100644 --- a/packages/server/database/types/GenericMeetingPhase.ts +++ b/packages/server/database/types/GenericMeetingPhase.ts @@ -21,7 +21,10 @@ export type NewMeetingPhaseTypeEnum = export default class GenericMeetingPhase { id = generateUID() stages: GenericMeetingStage[] - constructor(public phaseType: NewMeetingPhaseTypeEnum, durations?: number[] | undefined) { + constructor( + public phaseType: NewMeetingPhaseTypeEnum, + durations?: number[] | undefined + ) { this.stages = [new GenericMeetingStage({phaseType, durations})] } } diff --git a/packages/server/database/types/ReflectPhase.ts b/packages/server/database/types/ReflectPhase.ts index 4f446ed7f50..4de28d532c2 100644 --- a/packages/server/database/types/ReflectPhase.ts +++ b/packages/server/database/types/ReflectPhase.ts @@ -6,7 +6,10 @@ export default class ReflectPhase extends GenericMeetingPhase { stages: [GenericMeetingStage, ...GenericMeetingStage[]] focusedPromptId?: string - constructor(public teamId: string, durations: number[] | undefined) { + constructor( + public teamId: string, + durations: number[] | undefined + ) { super('reflect') this.stages = [ new GenericMeetingStage({ diff --git a/packages/server/database/types/ScheduledJob.ts b/packages/server/database/types/ScheduledJob.ts index ad42dce95a6..5f9c31158e0 100644 --- a/packages/server/database/types/ScheduledJob.ts +++ b/packages/server/database/types/ScheduledJob.ts @@ -4,5 +4,8 @@ export type ScheduledJobType = | 'WARN_ORGANIZATION' export default abstract class ScheduledJob { - protected constructor(public type: ScheduledJobType, public runAt: Date) {} + protected constructor( + public type: ScheduledJobType, + public runAt: Date + ) {} } diff --git a/packages/server/database/types/ScheduledJobMetingStageTimeLimit.ts b/packages/server/database/types/ScheduledJobMetingStageTimeLimit.ts index 2a340f87ec1..35b563df251 100644 --- a/packages/server/database/types/ScheduledJobMetingStageTimeLimit.ts +++ b/packages/server/database/types/ScheduledJobMetingStageTimeLimit.ts @@ -1,7 +1,10 @@ import ScheduledJob from './ScheduledJob' export default class ScheduledJobMeetingStageTimeLimit extends ScheduledJob { - constructor(public runAt: Date, public meetingId: string) { + constructor( + public runAt: Date, + public meetingId: string + ) { super('MEETING_STAGE_TIME_LIMIT_END', runAt) } } diff --git a/packages/server/database/types/ScheduledTeamLimitsJob.ts b/packages/server/database/types/ScheduledTeamLimitsJob.ts index e222f3315e1..8bf64fa26de 100644 --- a/packages/server/database/types/ScheduledTeamLimitsJob.ts +++ b/packages/server/database/types/ScheduledTeamLimitsJob.ts @@ -1,7 +1,11 @@ import ScheduledJob, {ScheduledJobType} from './ScheduledJob' export default class ScheduledTeamLimitsJob extends ScheduledJob { - constructor(public runAt: Date, public orgId: string, public type: ScheduledJobType) { + constructor( + public runAt: Date, + public orgId: string, + public type: ScheduledJobType + ) { super(type, runAt) } } diff --git a/packages/server/database/types/TeamHealthStage.ts b/packages/server/database/types/TeamHealthStage.ts index 87d366d92dd..77111215195 100644 --- a/packages/server/database/types/TeamHealthStage.ts +++ b/packages/server/database/types/TeamHealthStage.ts @@ -6,7 +6,11 @@ export default class TeamHealthStage extends GenericMeetingStage { votes: TeamHealthVote[] = [] isRevealed = false - constructor(public question: string, public labels: string[], durations?: number[] | undefined) { + constructor( + public question: string, + public labels: string[], + durations?: number[] | undefined + ) { super({phaseType: 'TEAM_HEALTH', durations, isNavigable: true}) } } diff --git a/packages/server/database/types/UpdatesStage.ts b/packages/server/database/types/UpdatesStage.ts index 4fff548858c..5cae1c5c3ed 100644 --- a/packages/server/database/types/UpdatesStage.ts +++ b/packages/server/database/types/UpdatesStage.ts @@ -2,7 +2,10 @@ import GenericMeetingStage from './GenericMeetingStage' export default class UpdatesStage extends GenericMeetingStage { phaseType!: 'updates' - constructor(public teamMemberId: string, durations?: number[] | undefined) { + constructor( + public teamMemberId: string, + durations?: number[] | undefined + ) { super({phaseType: 'updates', durations}) } } diff --git a/packages/server/dataloader/RootDataLoader.ts b/packages/server/dataloader/RootDataLoader.ts index 1c58cb7df78..3bf5f7c3acd 100644 --- a/packages/server/dataloader/RootDataLoader.ts +++ b/packages/server/dataloader/RootDataLoader.ts @@ -79,8 +79,8 @@ export type TypedDataLoader = LoaderName extends CustomLoaders LoaderName extends ForeignLoaders ? TypeFromForeign[] : LoaderName extends PrimaryLoaders - ? TypeFromPrimary - : never + ? TypeFromPrimary + : never > /** diff --git a/packages/server/dataloader/atlassianLoaders.ts b/packages/server/dataloader/atlassianLoaders.ts index efe9881f48a..de3358bb0e2 100644 --- a/packages/server/dataloader/atlassianLoaders.ts +++ b/packages/server/dataloader/atlassianLoaders.ts @@ -263,8 +263,8 @@ export const jiraIssue = ( hasDefaultEstimationField(possibleEstimationFields.map(({fieldName}) => fieldName)) ? undefined : simplified - ? 'teamManagedStoryPoints' - : 'companyManagedStoryPoints' + ? 'teamManagedStoryPoints' + : 'companyManagedStoryPoints' return { ...fields, diff --git a/packages/server/dataloader/foreignKeyLoaderMaker.ts b/packages/server/dataloader/foreignKeyLoaderMaker.ts index 363a3d64363..e21ec3a9f2d 100644 --- a/packages/server/dataloader/foreignKeyLoaderMaker.ts +++ b/packages/server/dataloader/foreignKeyLoaderMaker.ts @@ -6,13 +6,8 @@ import UpdatableCacheDataLoader from './UpdatableCacheDataLoader' type LoaderMakers = typeof primaryKeyLoaderMakers type LoaderKeys = keyof LoaderMakers type Loader = ReturnType -type LoaderType = Loader extends DataLoader< - any, - infer T, - any -> - ? NonNullable - : any +type LoaderType = + Loader extends DataLoader ? NonNullable : any /** * Used to register loaders for types by foreign key. diff --git a/packages/server/email/teamLimitsEmailCreator.tsx b/packages/server/email/teamLimitsEmailCreator.tsx index 931a0ddd7a9..337be985c06 100644 --- a/packages/server/email/teamLimitsEmailCreator.tsx +++ b/packages/server/email/teamLimitsEmailCreator.tsx @@ -76,8 +76,8 @@ const teamLimitsEmailCreator = (props: Props) => { emailType === 'locked' ? LockedEmail : emailType === 'sevenDayWarning' - ? SevenDayWarningEmail - : ThirtyDayWarningEmail + ? SevenDayWarningEmail + : ThirtyDayWarningEmail const bodyContent = ReactDOMServer.renderToStaticMarkup( ) @@ -86,8 +86,8 @@ const teamLimitsEmailCreator = (props: Props) => { emailType === 'locked' ? `Parabol Account Deactivated` : emailType === 'sevenDayWarning' - ? `Parabol Account - Action Required` - : `Parabol Account - Team Limit Reached` + ? `Parabol Account - Action Required` + : `Parabol Account - Team Limit Reached` const html = emailTemplate({ bodyContent, diff --git a/packages/server/fileStorage/GCSManager.ts b/packages/server/fileStorage/GCSManager.ts index fe952eed138..d99cf943f69 100644 --- a/packages/server/fileStorage/GCSManager.ts +++ b/packages/server/fileStorage/GCSManager.ts @@ -64,9 +64,12 @@ export default class GCSManager extends FileStoreManager { // refresh the token every hour // do this on an interval vs. on demand to reduce request latency // unref it so things like pushToCDN can exit - setInterval(async () => { - this.accessToken = await this.getFreshAccessToken() - }, (GCSManager.GOOGLE_EXPIRY - 100) * 1000).unref() + setInterval( + async () => { + this.accessToken = await this.getFreshAccessToken() + }, + (GCSManager.GOOGLE_EXPIRY - 100) * 1000 + ).unref() } private async getFreshAccessToken() { diff --git a/packages/server/graphql/mutations/changeTaskTeam.ts b/packages/server/graphql/mutations/changeTaskTeam.ts index 10a5efa4ea4..bd861bdb164 100644 --- a/packages/server/graphql/mutations/changeTaskTeam.ts +++ b/packages/server/graphql/mutations/changeTaskTeam.ts @@ -76,8 +76,8 @@ export default { task.integration?.service === 'jira' ? await Promise.all(authKeys.map((key) => dataLoader.get('freshAtlassianAuth').load(key))) : task.integration?.service === 'github' - ? await Promise.all(authKeys.map((key) => dataLoader.get('githubAuth').load(key))) - : authKeys.map(() => null) + ? await Promise.all(authKeys.map((key) => dataLoader.get('githubAuth').load(key))) + : authKeys.map(() => null) if (!targetTeamAuth && !sourceTeamAuth && !accessUsersTargetTeamAuth) { return standardError(new Error('No valid integration found'), { diff --git a/packages/server/graphql/mutations/helpers/generateGroups.ts b/packages/server/graphql/mutations/helpers/generateGroups.ts index f487119ecc0..adee86de361 100644 --- a/packages/server/graphql/mutations/helpers/generateGroups.ts +++ b/packages/server/graphql/mutations/helpers/generateGroups.ts @@ -57,10 +57,7 @@ const generateGroups = async ( const meetingRes = await r .table('NewMeeting') .get(meetingId) - .update( - {autogroupReflectionGroups}, - {returnChanges: true} - )('changes')(0)('new_val') + .update({autogroupReflectionGroups}, {returnChanges: true})('changes')(0)('new_val') .run() const {facilitatorUserId} = meetingRes const data = {meetingId} diff --git a/packages/server/graphql/mutations/helpers/notifications/makeMattermostAttachments.ts b/packages/server/graphql/mutations/helpers/notifications/makeMattermostAttachments.ts index 6466e1bd363..fa55a1083da 100644 --- a/packages/server/graphql/mutations/helpers/notifications/makeMattermostAttachments.ts +++ b/packages/server/graphql/mutations/helpers/notifications/makeMattermostAttachments.ts @@ -53,4 +53,4 @@ export const makeHackedFieldButtonValue = (spec: ButtonSpec): string => ` ||` export const makeHackedButtonPairFields = (button1: ButtonSpec, button2: ButtonSpec) => - [button1, button2].map((i) => ({short: true, value: makeHackedFieldButtonValue(i)} as Field)) + [button1, button2].map((i) => ({short: true, value: makeHackedFieldButtonValue(i)}) as Field) diff --git a/packages/server/graphql/mutations/helpers/removeFromOrg.ts b/packages/server/graphql/mutations/helpers/removeFromOrg.ts index 6d2747e227b..98db329798f 100644 --- a/packages/server/graphql/mutations/helpers/removeFromOrg.ts +++ b/packages/server/graphql/mutations/helpers/removeFromOrg.ts @@ -48,10 +48,7 @@ const removeFromOrg = async ( .getAll(userId, {index: 'userId'}) .filter({orgId, removedAt: null}) .nth(0) - .update( - {removedAt: now}, - {returnChanges: true} - )('changes')(0)('new_val') + .update({removedAt: now}, {returnChanges: true})('changes')(0)('new_val') .default(null) .run() as unknown as OrganizationUser, dataLoader.get('users').loadNonNull(userId) diff --git a/packages/server/graphql/mutations/helpers/updateTeamInsights.ts b/packages/server/graphql/mutations/helpers/updateTeamInsights.ts index dd0ddf0a310..ba9bc32cc5f 100644 --- a/packages/server/graphql/mutations/helpers/updateTeamInsights.ts +++ b/packages/server/graphql/mutations/helpers/updateTeamInsights.ts @@ -48,13 +48,16 @@ const updateTeamInsights = async (teamId: string, dataLoader: DataLoaderWorker) ]) // emojis - const allUsedEmojis = meetingInsights.reduce((acc, meeting) => { - if (!meeting?.usedReactjis) return acc - Object.entries(meeting?.usedReactjis).forEach(([emoji, count]) => { - acc[emoji] = (acc[emoji] ?? 0) + count - }) - return acc - }, {} as Record) + const allUsedEmojis = meetingInsights.reduce( + (acc, meeting) => { + if (!meeting?.usedReactjis) return acc + Object.entries(meeting?.usedReactjis).forEach(([emoji, count]) => { + acc[emoji] = (acc[emoji] ?? 0) + count + }) + return acc + }, + {} as Record + ) const mostUsedEmojis = Object.entries(allUsedEmojis) .map(([id, count]) => ({id, count})) diff --git a/packages/server/graphql/mutations/removeAgendaItem.ts b/packages/server/graphql/mutations/removeAgendaItem.ts index 2b6c8233176..4cf87cb57bd 100644 --- a/packages/server/graphql/mutations/removeAgendaItem.ts +++ b/packages/server/graphql/mutations/removeAgendaItem.ts @@ -39,10 +39,7 @@ export default { const agendaItem = await r .table('AgendaItem') .get(agendaItemId) - .update( - {isActive: false}, - {returnChanges: true} - )('changes')(0)('old_val') + .update({isActive: false}, {returnChanges: true})('changes')(0)('old_val') .default(null) .run() if (!agendaItem) { diff --git a/packages/server/graphql/public/mutations/createImposterToken.ts b/packages/server/graphql/public/mutations/createImposterToken.ts index 50a2a1b63ab..d2106ec34b0 100644 --- a/packages/server/graphql/public/mutations/createImposterToken.ts +++ b/packages/server/graphql/public/mutations/createImposterToken.ts @@ -14,8 +14,8 @@ const createImposterToken: MutationResolvers['createImposterToken'] = async ( const user = userId ? await dataLoader.get('users').load(userId) : email - ? await getUserByEmail(email) - : null + ? await getUserByEmail(email) + : null if (!user) { return standardError(new Error('User not found'), {userId: viewerId}) diff --git a/packages/server/graphql/public/mutations/helpers/SAMLHelpers/getURLWithSAMLRequestParam.ts b/packages/server/graphql/public/mutations/helpers/SAMLHelpers/getURLWithSAMLRequestParam.ts index d3fa3b7e98f..e0a9155c0cc 100644 --- a/packages/server/graphql/public/mutations/helpers/SAMLHelpers/getURLWithSAMLRequestParam.ts +++ b/packages/server/graphql/public/mutations/helpers/SAMLHelpers/getURLWithSAMLRequestParam.ts @@ -7,8 +7,8 @@ const getURLWithSAMLRequestParam = (destination: string, slug: string) => { + process.env.HOST + }/saml/${slug}"> ${issuer} diff --git a/packages/server/graphql/public/mutations/uploadUserImage.ts b/packages/server/graphql/public/mutations/uploadUserImage.ts index 7c3c47106a3..05c1e9fa3eb 100644 --- a/packages/server/graphql/public/mutations/uploadUserImage.ts +++ b/packages/server/graphql/public/mutations/uploadUserImage.ts @@ -36,10 +36,7 @@ const uploadUserImage: MutationResolvers['uploadUserImage'] = async ( r .table('TeamMember') .getAll(userId, {index: 'userId'}) - .update( - {picture: publicLocation}, - {returnChanges: true} - )('changes')('new_val') + .update({picture: publicLocation}, {returnChanges: true})('changes')('new_val') .default([]) .run() as unknown as TeamMember[], updateUser({picture: publicLocation}, userId) diff --git a/packages/server/graphql/public/rules/isUserViewer.ts b/packages/server/graphql/public/rules/isUserViewer.ts index 4fcb3e4443d..67b2734043a 100644 --- a/packages/server/graphql/public/rules/isUserViewer.ts +++ b/packages/server/graphql/public/rules/isUserViewer.ts @@ -2,11 +2,13 @@ import {rule} from 'graphql-shield' import {getUserId} from '../../../utils/authorization' import {GQLContext} from '../../graphql' -const isUserViewer = rule({cache: 'strict'})( - async ({id: userId}, _args, {authToken}: GQLContext) => { - const viewerId = getUserId(authToken) - return userId === viewerId ? true : new Error('Must be logged in as user') - } -) +const isUserViewer = rule({cache: 'strict'})(async ( + {id: userId}, + _args, + {authToken}: GQLContext +) => { + const viewerId = getUserId(authToken) + return userId === viewerId ? true : new Error('Must be logged in as user') +}) export default isUserViewer diff --git a/packages/server/graphql/public/rules/isViewerBillingLeader.ts b/packages/server/graphql/public/rules/isViewerBillingLeader.ts index 5af6b47af5b..87462f99486 100644 --- a/packages/server/graphql/public/rules/isViewerBillingLeader.ts +++ b/packages/server/graphql/public/rules/isViewerBillingLeader.ts @@ -14,14 +14,18 @@ const resolve = async (orgId: string, {authToken, dataLoader}: GQLContext) => { return true } -export const isViewerBillingLeader = rule({cache: 'strict'})( - async (_source, {orgId}, context: GQLContext) => { - return resolve(orgId, context) - } -) +export const isViewerBillingLeader = rule({cache: 'strict'})(async ( + _source, + {orgId}, + context: GQLContext +) => { + return resolve(orgId, context) +}) -export const isViewerBillingLeaderSource = rule({cache: 'strict'})( - async ({id: orgId}, _args, context: GQLContext) => { - return resolve(orgId, context) - } -) +export const isViewerBillingLeaderSource = rule({cache: 'strict'})(async ( + {id: orgId}, + _args, + context: GQLContext +) => { + return resolve(orgId, context) +}) diff --git a/packages/server/graphql/public/typeDefs/removeApprovedOrganizationDomains.graphql b/packages/server/graphql/public/typeDefs/removeApprovedOrganizationDomains.graphql index 61a3e3cb689..44039d7c1c1 100644 --- a/packages/server/graphql/public/typeDefs/removeApprovedOrganizationDomains.graphql +++ b/packages/server/graphql/public/typeDefs/removeApprovedOrganizationDomains.graphql @@ -18,7 +18,7 @@ extend type Mutation { Return value for removeApprovedOrganizationDomains, which could be an error """ union RemoveApprovedOrganizationDomainsPayload = - ErrorPayload + | ErrorPayload | RemoveApprovedOrganizationDomainsSuccess type RemoveApprovedOrganizationDomainsSuccess { diff --git a/packages/server/graphql/public/types/Company.ts b/packages/server/graphql/public/types/Company.ts index 351d4fb7981..cd21ce19d81 100644 --- a/packages/server/graphql/public/types/Company.ts +++ b/packages/server/graphql/public/types/Company.ts @@ -89,14 +89,17 @@ const Company: CompanyResolvers = { .flat() .filter(isValid) // group by teamId - const teamMembersByTeamId = teamMembers.reduce((obj, teamMember) => { - if (obj[teamMember.teamId]) { - obj[teamMember.teamId]!.push(teamMember) - } else { - obj[teamMember.teamId] = [teamMember] - } - return obj - }, {} as Record) + const teamMembersByTeamId = teamMembers.reduce( + (obj, teamMember) => { + if (obj[teamMember.teamId]) { + obj[teamMember.teamId]!.push(teamMember) + } else { + obj[teamMember.teamId] = [teamMember] + } + return obj + }, + {} as Record + ) // filter out teams that have less than 2 unremoved team members const teamsWithSufficientTeamMembers = Object.values(teamMembersByTeamId) diff --git a/packages/server/graphql/rootMutation.ts b/packages/server/graphql/rootMutation.ts index 1fd42b72e43..fe3ff00f0cf 100644 --- a/packages/server/graphql/rootMutation.ts +++ b/packages/server/graphql/rootMutation.ts @@ -243,5 +243,5 @@ export default new GraphQLObjectType({ removeTeamMemberIntegrationAuth, endTeamPrompt, updateAzureDevOpsDimensionField - } as any) + }) as any }) diff --git a/packages/server/graphql/types/CheckInStage.ts b/packages/server/graphql/types/CheckInStage.ts index 54585f85bbc..b7ee2e8415b 100644 --- a/packages/server/graphql/types/CheckInStage.ts +++ b/packages/server/graphql/types/CheckInStage.ts @@ -19,7 +19,7 @@ const CheckInStage: GraphQLObjectType = new GraphQLO ({ ...newMeetingStageFields(), ...newMeetingTeamMemberStageFields() - } as any) + }) as any }) export default CheckInStage diff --git a/packages/server/package.json b/packages/server/package.json index 4912521e0e1..dbcc82f38bf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -60,8 +60,6 @@ "jest-transform-graphql": "^2.1.0", "json-loader": "^0.5.7", "lint-staged": "^10.1.7", - "prettier": "^2.8.8", - "prettier-plugin-organize-imports": "^2.3.4", "rethinkdb-ts-migrate": "^0.3.6", "style-loader": "2.0.0", "sucrase": "^3.32.0", diff --git a/packages/server/postgres/queries/getAtlassianAuthsToUpdate.ts b/packages/server/postgres/queries/getAtlassianAuthsToUpdate.ts index 1672c6c912a..47653146047 100644 --- a/packages/server/postgres/queries/getAtlassianAuthsToUpdate.ts +++ b/packages/server/postgres/queries/getAtlassianAuthsToUpdate.ts @@ -12,7 +12,7 @@ const getAtlassianAuthsToUpdate = async (updatedAtThreshold: Date) => { ...jsq, lastUsedAt: new Date(jsq.lastUsedAt) })) - } as AtlassianAuth) + }) as AtlassianAuth ) } diff --git a/packages/server/safeMutations/removeSuggestedAction.ts b/packages/server/safeMutations/removeSuggestedAction.ts index 0909b52315a..76d7aca0ad4 100644 --- a/packages/server/safeMutations/removeSuggestedAction.ts +++ b/packages/server/safeMutations/removeSuggestedAction.ts @@ -7,10 +7,7 @@ const removeSuggestedAction = async (userId: string, type: TSuggestedActionTypeE .table('SuggestedAction') .getAll(userId, {index: 'userId'}) .filter({removedAt: null, type}) - .update( - {removedAt: new Date()}, - {returnChanges: true} - )('changes')(0)('new_val')('id') + .update({removedAt: new Date()}, {returnChanges: true})('changes')(0)('new_val')('id') .default(null) .run() } diff --git a/packages/server/utils/MattermostServerManager.ts b/packages/server/utils/MattermostServerManager.ts index 6471d00a3e6..be383baf670 100644 --- a/packages/server/utils/MattermostServerManager.ts +++ b/packages/server/utils/MattermostServerManager.ts @@ -66,8 +66,8 @@ abstract class MattermostManager { typeof textOrAttachmentsArray === 'string' ? 'text' : Array.isArray(textOrAttachmentsArray) - ? 'attachments' - : null + ? 'attachments' + : null if (!prop) return new Error('Invalid mattermost message') const defaultPayload = { [prop]: textOrAttachmentsArray diff --git a/packages/server/utils/SlackServerManager.ts b/packages/server/utils/SlackServerManager.ts index 0472f222b53..715d5670f0b 100644 --- a/packages/server/utils/SlackServerManager.ts +++ b/packages/server/utils/SlackServerManager.ts @@ -57,7 +57,10 @@ class SlackServerManager extends SlackManager { return new SlackServerManager(tokenJson.access_token, tokenJson) as Required } - constructor(botAccessToken: string, public response?: OAuth2Response) { + constructor( + botAccessToken: string, + public response?: OAuth2Response + ) { super(botAccessToken) } } diff --git a/scripts/codeshift/newMutation.ts b/scripts/codeshift/newMutation.ts index 1238819f57d..7fbf0ea2729 100644 --- a/scripts/codeshift/newMutation.ts +++ b/scripts/codeshift/newMutation.ts @@ -133,7 +133,7 @@ const addSuccessSourceToCodegen = async (camelMutationName: string) => { // stable stringify first to sort const stableString = stringify(codegenJSON) const options = await prettier.resolveConfig(codegenPath) - const prettyStableString = prettier.format(stableString, {...options, parser: 'json'}) + const prettyStableString = await prettier.format(stableString, {...options, parser: 'json'}) fs.writeFileSync(codegenPath, prettyStableString) } diff --git a/yarn.lock b/yarn.lock index 558fd3223ec..a1944e70e4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17802,21 +17802,26 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier-plugin-organize-imports@^2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-2.3.4.tgz#65473861ae5ab7960439fff270a2258558fbe9ba" - integrity sha512-R8o23sf5iVL/U71h9SFUdhdOEPsi3nm42FD/oDYIZ2PQa4TNWWuWecxln6jlIQzpZTDMUeO1NicJP6lLn2TtRw== +prettier-plugin-organize-imports@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz#77967f69d335e9c8e6e5d224074609309c62845e" + integrity sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog== -prettier-plugin-tailwindcss@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.1.tgz#989b35afd86c550cb671da69891aba4f4a051159" - integrity sha512-aIO8IguumORyRsmT+E7JfJ3A9FEoyhqZR7Au7TBOege3VZkgMvHJMkufeYp4zjnDK2iq4ktkvGMNOQR9T8lisQ== +prettier-plugin-tailwindcss@^0.5.13: + version "0.5.13" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.13.tgz#ee3c1e07848c90abdd1edde36a09366327e31e26" + integrity sha512-2tPWHCFNC+WRjAC4SIWQNSOdcL1NNkydXim8w7TDqlZi+/ulZYz2OouAI6qMtkggnPt7lGamboj6LcTMwcCvoQ== -prettier@^2.8.3, prettier@^2.8.8: +prettier@^2.8.3: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" @@ -20036,7 +20041,7 @@ string-similarity@^3.0.0: resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-3.0.0.tgz#07b0bc69fae200ad88ceef4983878d03793847c7" integrity sha512-7kS7LyTp56OqOI2BDWQNVnLX/rCxIQn+/5M0op1WV6P8Xx6TZNdajpuqQdiJ7Xx+p1C5CsWMvdiBp9ApMhxzEQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -20054,15 +20059,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.0.tgz#5ab00980cfb29f43e736b113a120a73a0fb569d3" @@ -20139,7 +20135,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -20153,13 +20149,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -22009,7 +21998,7 @@ workbox-window@6.5.4: "@types/trusted-types" "^2.0.2" workbox-core "6.5.4" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -22027,15 +22016,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"