diff --git a/biome.json b/biome.json index 6861f822..968ec8e4 100644 --- a/biome.json +++ b/biome.json @@ -22,7 +22,7 @@ "formatter": { "semicolons": "asNeeded", "quoteStyle": "single", - "trailingComma": "all", + "trailingComma": "none", "enabled": true, "jsxQuoteStyle": "double", "arrowParentheses": "always" diff --git a/src/components/App.tsx b/src/components/App.tsx index b024f194..26ec7975 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -84,7 +84,7 @@ const pagesMap: Record> = { profileSettings: ProfileSettingsPage, profileSecurity: ProfileSecurityPage, profileSubscriptions: ProfileSubscriptionsPage, - fourOuFour: FourOuFourPage, + fourOuFour: FourOuFourPage } type Props = PageProps & { is404: boolean } diff --git a/src/components/Article/AudioPlayer/AudioPlayer.tsx b/src/components/Article/AudioPlayer/AudioPlayer.tsx index 00bebe9d..6b4b6aff 100644 --- a/src/components/Article/AudioPlayer/AudioPlayer.tsx +++ b/src/components/Article/AudioPlayer/AudioPlayer.tsx @@ -38,8 +38,8 @@ export const AudioPlayer = (props: Props) => { () => { setCurrentTrackDuration(0) }, - { defer: true }, - ), + { defer: true } + ) ) const handlePlayMedia = async (trackIndex: number) => { @@ -134,7 +134,7 @@ export const AudioPlayer = (props: Props) => {
diff --git a/src/components/Article/AudioPlayer/PlayerHeader.tsx b/src/components/Article/AudioPlayer/PlayerHeader.tsx index 37d020cb..bc2654ee 100644 --- a/src/components/Article/AudioPlayer/PlayerHeader.tsx +++ b/src/components/Article/AudioPlayer/PlayerHeader.tsx @@ -18,7 +18,7 @@ type Props = { export const PlayerHeader = (props: Props) => { const volumeContainerRef: { current: HTMLDivElement } = { - current: null, + current: null } const [isVolumeBarOpened, setIsVolumeBarOpened] = createSignal(false) @@ -30,7 +30,7 @@ export const PlayerHeader = (props: Props) => { useOutsideClickHandler({ containerRef: volumeContainerRef, predicate: () => isVolumeBarOpened(), - handler: () => toggleVolumeBar(), + handler: () => toggleVolumeBar() }) return ( @@ -42,7 +42,7 @@ export const PlayerHeader = (props: Props) => { onClick={props.onPlayMedia} class={clsx( styles.playButton, - props.isPlaying ? styles.playButtonInvertPause : styles.playButtonInvertPlay, + props.isPlaying ? styles.playButtonInvertPause : styles.playButtonInvertPlay )} aria-label="Play" data-playing="false" diff --git a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx index ff0661c9..cda903de 100644 --- a/src/components/Article/AudioPlayer/PlayerPlaylist.tsx +++ b/src/components/Article/AudioPlayer/PlayerPlaylist.tsx @@ -43,7 +43,7 @@ export const PlayerPlaylist = (props: Props) => { gtag('event', 'select_item', { item_list_id: props.articleSlug, item_list_name: getMediaTitle(mi, index), - items: props.media.map((it, ix) => getMediaTitle(it, ix)), + items: props.media.map((it, ix) => getMediaTitle(it, ix)) }) } return ( diff --git a/src/components/Article/Comment/Comment.tsx b/src/components/Article/Comment/Comment.tsx index d6af579f..3b9a8655 100644 --- a/src/components/Article/Comment/Comment.tsx +++ b/src/components/Article/Comment/Comment.tsx @@ -54,7 +54,7 @@ export const Comment = (props: Props) => { confirmBody: t('Are you sure you want to delete this comment?'), confirmButtonLabel: t('Delete'), confirmButtonVariant: 'danger', - declineButtonVariant: 'primary', + declineButtonVariant: 'primary' }) if (isConfirmed) { @@ -75,7 +75,7 @@ export const Comment = (props: Props) => { kind: ReactionKind.Comment, reply_to: props.comment.id, body: value, - shout: props.comment.shout.id, + shout: props.comment.shout.id }) setClearEditor(true) setIsReplyVisible(false) @@ -96,7 +96,7 @@ export const Comment = (props: Props) => { await updateReaction(props.comment.id, { kind: ReactionKind.Comment, body: value, - shout: props.comment.shout.id, + shout: props.comment.shout.id }) setEditMode(false) setLoading(false) @@ -109,7 +109,7 @@ export const Comment = (props: Props) => {
  • props.lastSeen, + [styles.isNew]: !isCommentAuthor() && comment()?.created_at > props.lastSeen })} > @@ -122,7 +122,7 @@ export const Comment = (props: Props) => { name={comment().created_by.name} userpic={comment().created_by.pic} class={clsx({ - [styles.compactUserpic]: props.compact, + [styles.compactUserpic]: props.compact })} /> diff --git a/src/components/Article/CommentDate/CommentDate.tsx b/src/components/Article/CommentDate/CommentDate.tsx index e3901399..388295a5 100644 --- a/src/components/Article/CommentDate/CommentDate.tsx +++ b/src/components/Article/CommentDate/CommentDate.tsx @@ -30,7 +30,7 @@ export const CommentDate = (props: Props) => {
    diff --git a/src/components/Article/CommentRatingControl.tsx b/src/components/Article/CommentRatingControl.tsx index 5ce60d08..eb471f51 100644 --- a/src/components/Article/CommentRatingControl.tsx +++ b/src/components/Article/CommentRatingControl.tsx @@ -28,7 +28,7 @@ export const CommentRatingControl = (props: Props) => { r.kind === reactionKind && r.created_by.slug === author()?.slug && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, + r.reply_to === props.comment.id ) const isUpvoted = createMemo(() => checkReaction(ReactionKind.Like)) const isDownvoted = createMemo(() => checkReaction(ReactionKind.Dislike)) @@ -39,8 +39,8 @@ export const CommentRatingControl = (props: Props) => { (r) => [ReactionKind.Like, ReactionKind.Dislike].includes(r.kind) && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, - ), + r.reply_to === props.comment.id + ) ) const deleteCommentReaction = async (reactionKind: ReactionKind) => { @@ -49,7 +49,7 @@ export const CommentRatingControl = (props: Props) => { r.kind === reactionKind && r.created_by.slug === author()?.slug && r.shout.id === props.comment.shout.id && - r.reply_to === props.comment.id, + r.reply_to === props.comment.id ) return deleteReaction(reactionToDelete.id) } @@ -64,7 +64,7 @@ export const CommentRatingControl = (props: Props) => { await createReaction({ kind: isUpvote ? ReactionKind.Like : ReactionKind.Dislike, shout: props.comment.shout.id, - reply_to: props.comment.id, + reply_to: props.comment.id }) } } catch { @@ -73,7 +73,7 @@ export const CommentRatingControl = (props: Props) => { await loadShout(props.comment.shout.slug) await loadReactionsBy({ - by: { shout: props.comment.shout.slug }, + by: { shout: props.comment.shout.slug } }) } @@ -84,7 +84,7 @@ export const CommentRatingControl = (props: Props) => { disabled={!(canVote() && author())} onClick={() => handleRatingChange(true)} class={clsx(styles.commentRatingControl, styles.commentRatingControlUp, { - [styles.voted]: isUpvoted(), + [styles.voted]: isUpvoted() })} /> {
    0, - [styles.commentRatingNegative]: props.comment.stat.rating < 0, + [styles.commentRatingNegative]: props.comment.stat.rating < 0 })} > {props.comment.stat.rating || 0} @@ -110,7 +110,7 @@ export const CommentRatingControl = (props: Props) => { disabled={!(canVote() && author())} onClick={() => handleRatingChange(false)} class={clsx(styles.commentRatingControl, styles.commentRatingControlDown, { - [styles.voted]: isDownvoted(), + [styles.voted]: isDownvoted() })} />
    diff --git a/src/components/Article/CommentsTree.tsx b/src/components/Article/CommentsTree.tsx index 3057ffb6..0226fe2a 100644 --- a/src/components/Article/CommentsTree.tsx +++ b/src/components/Article/CommentsTree.tsx @@ -52,7 +52,7 @@ export const CommentsTree = (props: Props) => { const { reactionEntities, createReaction } = useReactions() const comments = createMemo(() => - Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT'), + Object.values(reactionEntities).filter((reaction) => reaction.kind === 'COMMENT') ) const sortedComments = createMemo(() => { @@ -96,7 +96,7 @@ export const CommentsTree = (props: Props) => { await createReaction({ kind: ReactionKind.Comment, body: value, - shout: props.shoutId, + shout: props.shoutId }) setClearEditor(true) } catch (error) { @@ -154,7 +154,7 @@ export const CommentsTree = (props: Props) => { a?.slug === reaction.created_by.slug), + props.articleAuthors.some((a) => a?.slug === reaction.created_by.slug) )} comment={reaction} clickedReply={(id) => setClickedReplyId(id)} diff --git a/src/components/Article/CoverImage/CoverImage.tsx b/src/components/Article/CoverImage/CoverImage.tsx index 970d2636..4815b20d 100644 --- a/src/components/Article/CoverImage/CoverImage.tsx +++ b/src/components/Article/CoverImage/CoverImage.tsx @@ -26,7 +26,7 @@ const coverImages = [ CoverImage9, CoverImage10, CoverImage11, - CoverImage12, + CoverImage12 ] let counter = 0 diff --git a/src/components/Article/FullArticle.tsx b/src/components/Article/FullArticle.tsx index 9119274c..d2d3ac35 100644 --- a/src/components/Article/FullArticle.tsx +++ b/src/components/Article/FullArticle.tsx @@ -62,7 +62,7 @@ const scrollTo = (el: HTMLElement) => { window.scrollTo({ top: top + window.scrollY - DEFAULT_HEADER_OFFSET, left: 0, - behavior: 'smooth', + behavior: 'smooth' }) } @@ -159,7 +159,7 @@ export const FullArticle = (props: Props) => { if (searchParams()?.scrollTo === 'comments' && commentsRef.current) { scrollToComments() changeSearchParams({ - scrollTo: null, + scrollTo: null }) } }) @@ -167,7 +167,7 @@ export const FullArticle = (props: Props) => { createEffect(() => { if (searchParams().commentId && isReactionsLoaded()) { const commentElement = document.querySelector( - `[id='comment_${searchParams().commentId}']`, + `[id='comment_${searchParams().commentId}']` ) changeSearchParams({ commentId: null }) @@ -187,7 +187,7 @@ export const FullArticle = (props: Props) => { } const tooltipElements: NodeListOf = document.querySelectorAll( - '[data-toggle="tooltip"], footnote', + '[data-toggle="tooltip"], footnote' ) if (!tooltipElements) { return @@ -212,19 +212,19 @@ export const FullArticle = (props: Props) => { modifiers: [ { name: 'eventListeners', - options: { scroll: false }, + options: { scroll: false } }, { name: 'offset', options: { - offset: [0, 8], - }, + offset: [0, 8] + } }, { name: 'flip', - options: { fallbackPlacements: ['top'] }, - }, - ], + options: { fallbackPlacements: ['top'] } + } + ] }) tooltip.style.visibility = 'hidden' @@ -309,8 +309,8 @@ export const FullArticle = (props: Props) => { () => props.article, () => { updateIframeSizes() - }, - ), + } + ) ) const [ratings, setRatings] = createSignal([]) onMount(async () => { @@ -329,7 +329,7 @@ export const FullArticle = (props: Props) => { title: props.article.title, topic: mainTopic()?.title || '', author: props.article?.authors[0]?.name || '', - width: 1200, + width: 1200 }) const description = getDescription(props.article.description || body()) diff --git a/src/components/Article/ShoutRatingControl.tsx b/src/components/Article/ShoutRatingControl.tsx index 409c65d6..a6c42d09 100644 --- a/src/components/Article/ShoutRatingControl.tsx +++ b/src/components/Article/ShoutRatingControl.tsx @@ -43,8 +43,8 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { const total = likes - dislikes setTotal(total) }, - { defer: true }, - ), + { defer: true } + ) ) const handleRatingChange = (voteKind: ReactionKind) => { @@ -65,7 +65,7 @@ export const ShoutRatingControl = (props: ShoutRatingControlProps) => { if (myRate()?.kind === oppositeKind) { mergeProps( props.ratings, - props.ratings.filter((r) => r.id === myRate().id), + props.ratings.filter((r) => r.id === myRate().id) ) await deleteReaction(myRate().id) setMyRate(undefined) diff --git a/src/components/AuthGuard/AuthGuard.tsx b/src/components/AuthGuard/AuthGuard.tsx index 6ba70476..d1ae8a75 100644 --- a/src/components/AuthGuard/AuthGuard.tsx +++ b/src/components/AuthGuard/AuthGuard.tsx @@ -26,9 +26,9 @@ export const AuthGuard = (props: Props) => { changeSearchParams( { source: 'authguard', - m: 'auth', + m: 'auth' }, - true, + true ) } } else { diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index d81a26d0..11648495 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -53,7 +53,7 @@ export const AuthorBadge = (props: Props) => { requireAuthentication(() => { openPage(router, 'inbox') changeSearchParams({ - initChat: props.author.id.toString(), + initChat: props.author.id.toString() }) }, 'discussions') } @@ -74,8 +74,8 @@ export const AuthorBadge = (props: Props) => { on( () => props.isFollowed, (followed) => setIsFollowed(followed?.value), - { defer: true }, - ), + { defer: true } + ) ) const handleFollowClick = () => { @@ -112,7 +112,7 @@ export const AuthorBadge = (props: Props) => { fallback={
    {t('Registered since {date}', { - date: formatDate(new Date(props.author.created_at * 1000)), + date: formatDate(new Date(props.author.created_at * 1000)) })}
    } @@ -150,7 +150,7 @@ export const AuthorBadge = (props: Props) => { isSubscribeButton={true} class={clsx(styles.actionButton, { [styles.iconed]: props.iconButtons, - [stylesButton.subscribed]: isFollowed(), + [stylesButton.subscribed]: isFollowed() })} /> } @@ -175,7 +175,7 @@ export const AuthorBadge = (props: Props) => { isSubscribeButton={true} class={clsx(styles.actionButton, { [styles.iconed]: props.iconButtons, - [stylesButton.subscribed]: isFollowed(), + [stylesButton.subscribed]: isFollowed() })} /> diff --git a/src/components/Author/AuthorCard/AuthorCard.tsx b/src/components/Author/AuthorCard/AuthorCard.tsx index 9fa25a8e..e686cb42 100644 --- a/src/components/Author/AuthorCard/AuthorCard.tsx +++ b/src/components/Author/AuthorCard/AuthorCard.tsx @@ -63,7 +63,7 @@ export const AuthorCard = (props: Props) => { requireAuthentication(() => { openPage(router, 'inbox') changeSearchParams({ - initChat: props.author.id.toString(), + initChat: props.author.id.toString() }) }, 'discussions') } @@ -206,7 +206,7 @@ export const AuthorCard = (props: Props) => { value={followButtonText()} isSubscribeButton={true} class={clsx({ - [stylesButton.subscribed]: isFollowed(), + [stylesButton.subscribed]: isFollowed() })} /> @@ -254,7 +254,7 @@ export const AuthorCard = (props: Props) => { author={follower} isFollowed={{ loaded: Boolean(authorSubs()), - value: isOwnerSubscribed(follower.id), + value: isOwnerSubscribed(follower.id) }} /> )} @@ -303,7 +303,7 @@ export const AuthorCard = (props: Props) => { diff --git a/src/components/Author/AuthorLink/AuthorLink.tsx b/src/components/Author/AuthorLink/AuthorLink.tsx index 27ab93f8..4eb73443 100644 --- a/src/components/Author/AuthorLink/AuthorLink.tsx +++ b/src/components/Author/AuthorLink/AuthorLink.tsx @@ -27,7 +27,7 @@ export const AuthorLink = (props: Props) => { return (
    diff --git a/src/components/Author/AuthorRatingControl.tsx b/src/components/Author/AuthorRatingControl.tsx index 3175c30a..81c16515 100644 --- a/src/components/Author/AuthorRatingControl.tsx +++ b/src/components/Author/AuthorRatingControl.tsx @@ -30,7 +30,7 @@ export const AuthorRatingControl = (props: AuthorRatingControlProps) => {
    diff --git a/src/components/_shared/DropdownSelect/DropdownSelect.tsx b/src/components/_shared/DropdownSelect/DropdownSelect.tsx index f0cddc2c..5860466f 100644 --- a/src/components/_shared/DropdownSelect/DropdownSelect.tsx +++ b/src/components/_shared/DropdownSelect/DropdownSelect.tsx @@ -20,7 +20,7 @@ export const DropdownSelect = (props: Props) => { const [isDropDownVisible, setIsDropDownVisible] = createSignal(false) const containerRef: { current: HTMLElement } = { - current: null, + current: null } const handleShowDropdown = () => { @@ -30,7 +30,7 @@ export const DropdownSelect = (props: Props) => { useOutsideClickHandler({ containerRef, predicate: () => isDropDownVisible(), - handler: () => setIsDropDownVisible(false), + handler: () => setIsDropDownVisible(false) }) return ( diff --git a/src/components/_shared/FloatingPanel/FloatingPanel.tsx b/src/components/_shared/FloatingPanel/FloatingPanel.tsx index d629500e..3bc7de66 100644 --- a/src/components/_shared/FloatingPanel/FloatingPanel.tsx +++ b/src/components/_shared/FloatingPanel/FloatingPanel.tsx @@ -16,7 +16,7 @@ export default (props: Props) => { return (