Skip to content

Commit

Permalink
style: revert to previous prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanabaroa committed Feb 14, 2024
1 parent 403a5a2 commit 2c674f1
Show file tree
Hide file tree
Showing 39 changed files with 138 additions and 137 deletions.
1 change: 1 addition & 0 deletions config/prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const config = {
printWidth: 170,
parser: 'typescript',
bracketSpacing: false,
trailingComma: 'es5',
}

export default config
4 changes: 2 additions & 2 deletions src/hooks/accounts/accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ describe('accounts', () => {
expect(typeof rendered.result.current.account.name).toBe('string')
await act(async () => {
expect(() => rendered.result.current.createAccount(rendered.result.current.account.name)).rejects.toThrow(
`account name '${rendered.result.current.account.name}' already exists in database`,
`account name '${rendered.result.current.account.name}' already exists in database`
)
})
})
Expand Down Expand Up @@ -1316,7 +1316,7 @@ describe('accounts', () => {
expectAccountCommentsToHaveIndexAndAccountId(rendered2.result.current.accountComments)
})
},
{retry: 10},
{retry: 10}
)

test(`cid gets added to account comment after feed is fetched`, async () => {
Expand Down
22 changes: 11 additions & 11 deletions src/hooks/accounts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function useAccounts() {
error: undefined,
errors: [],
}),
[accountsArray, state],
[accountsArray, state]
)
}

Expand Down Expand Up @@ -169,7 +169,7 @@ export function useAccountSubplebbits(options?: UseAccountSubplebbitsOptions): U
error: undefined,
errors: [],
}),
[accountSubplebbits, state],
[accountSubplebbits, state]
)
}

Expand Down Expand Up @@ -215,7 +215,7 @@ export function useNotifications(options?: UseNotificationsOptions): UseNotifica
error: errors[errors.length - 1],
errors,
}),
[notifications, errors],
[notifications, errors]
)
}

Expand Down Expand Up @@ -269,7 +269,7 @@ export function useAccountComments(options?: UseAccountCommentsOptions): UseAcco
}
},
delay,
immediate,
immediate
)

const filteredAccountCommentsWithStates = useMemo(() => {
Expand All @@ -290,7 +290,7 @@ export function useAccountComments(options?: UseAccountCommentsOptions): UseAcco
error: undefined,
errors: [],
}),
[filteredAccountCommentsWithStates, state],
[filteredAccountCommentsWithStates, state]
)
}

Expand All @@ -311,7 +311,7 @@ export function useAccountComment(options?: UseAccountCommentOptions): UseAccoun
error: accountComment?.error,
errors: accountComment?.errors || [],
}),
[accountComment, state],
[accountComment, state]
)
}

Expand Down Expand Up @@ -355,7 +355,7 @@ export function useAccountVotes(options?: UseAccountVotesOptions): UseAccountVot
error: undefined,
errors: [],
}),
[filteredAccountVotesArray, state],
[filteredAccountVotesArray, state]
)
}

Expand All @@ -379,7 +379,7 @@ export function useAccountVote(options?: UseAccountVoteOptions): UseAccountVoteR
error: undefined,
errors: [],
}),
[accountVote, state],
[accountVote, state]
)
}

Expand Down Expand Up @@ -420,7 +420,7 @@ export function useAccountEdits(options?: UseAccountEditsOptions): UseAccountEdi
error: undefined,
errors: [],
}),
[accountEditsArray, filter, state],
[accountEditsArray, filter, state]
)
}

Expand Down Expand Up @@ -580,7 +580,7 @@ export function useEditedComment(options?: UseEditedCommentOptions): UseEditedCo
error: undefined,
errors: [],
}),
[editedResult, initialState],
[editedResult, initialState]
)
}

Expand Down Expand Up @@ -630,6 +630,6 @@ export function usePubsubSubscribe(options?: UsePubsubSubscribeOptions): UsePubs
error: errors[errors.length - 1],
errors,
}),
[state, errors],
[state, errors]
)
}
4 changes: 2 additions & 2 deletions src/hooks/accounts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const useCalculatedAccountsNotifications = (accounts?: Accounts, accounts
accountsNotifications[accountId] = getReplyNotificationsFromAccountCommentsReplies(
accountsCommentsReplies[accountId],
accountsBlockedAddresses[accountId],
accountsBlockedCids[accountId],
accountsBlockedCids[accountId]
)
}
return accountsNotifications
Expand All @@ -98,7 +98,7 @@ export const useCalculatedAccountsNotifications = (accounts?: Accounts, accounts
const getReplyNotificationsFromAccountCommentsReplies = (
accountCommentsReplies: AccountCommentsReplies,
accountBlockedAddresses?: {[address: string]: boolean},
accountBlockedCids?: {[cid: string]: boolean},
accountBlockedCids?: {[cid: string]: boolean}
) => {
// get reply notifications
const replyNotifications: AccountCommentReply[] = []
Expand Down
14 changes: 7 additions & 7 deletions src/hooks/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function useSubscribe(options?: UseSubscribeOptions): UseSubscribeResult
error: errors[errors.length - 1],
errors,
}),
[state, subscribed, errors, subplebbitAddress, accountName],
[state, subscribed, errors, subplebbitAddress, accountName]
)
}

Expand Down Expand Up @@ -137,7 +137,7 @@ export function useBlock(options?: UseBlockOptions): UseBlockResult {
error: errors[errors.length - 1],
errors,
}),
[state, blocked, errors, address, accountName],
[state, blocked, errors, address, accountName]
)
}

Expand Down Expand Up @@ -211,7 +211,7 @@ export function usePublishComment(options?: UsePublishCommentOptions): UsePublis
error: errors[errors.length - 1],
errors,
}),
[publishingState, initialState, errors, index, challenge, challengeVerification, options, accountName, publishChallengeAnswers],
[publishingState, initialState, errors, index, challenge, challengeVerification, options, accountName, publishChallengeAnswers]
)
}

Expand Down Expand Up @@ -282,7 +282,7 @@ export function usePublishVote(options?: UsePublishVoteOptions): UsePublishVoteR
error: errors[errors.length - 1],
errors,
}),
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers],
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers]
)
}

Expand Down Expand Up @@ -353,7 +353,7 @@ export function usePublishCommentEdit(options?: UsePublishCommentEditOptions): U
error: errors[errors.length - 1],
errors,
}),
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers],
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers]
)
}

Expand Down Expand Up @@ -424,7 +424,7 @@ export function usePublishSubplebbitEdit(options?: UsePublishSubplebbitEditOptio
error: errors[errors.length - 1],
errors,
}),
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers],
[publishingState, initialState, errors, challenge, challengeVerification, options, accountName, publishChallengeAnswers]
)
}

Expand Down Expand Up @@ -464,6 +464,6 @@ export function useCreateSubplebbit(options?: UseCreateSubplebbitOptions): UseCr
error: errors[errors.length - 1],
errors,
}),
[state, errors, createdSubplebbit, options, accountName],
[state, errors, createdSubplebbit, options, accountName]
)
}
2 changes: 1 addition & 1 deletion src/hooks/authors/author-avatars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const verifyAuthorAvatarSignature = async (nft: Nft, authorAddress: strin
nft?.id,
nft?.chainTicker,
chainProviders?.[nft?.chainTicker]?.urls?.[0],
chainProviders?.[nft?.chainTicker]?.chainId,
chainProviders?.[nft?.chainTicker]?.chainId
)

let messageThatShouldBeSigned: any = {}
Expand Down
12 changes: 6 additions & 6 deletions src/hooks/authors/authors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function useAuthorComments(options?: UseAuthorCommentsOptions): UseAuthor
error: errors[errors.length - 1],
errors,
}),
[authorComments, lastCommentCid, hasMore, errors, state],
[authorComments, lastCommentCid, hasMore, errors, state]
)
}

Expand Down Expand Up @@ -162,7 +162,7 @@ export function useAuthor(options?: UseAuthorOptions): UseAuthorResult {
error: errors[errors.length - 1],
errors,
}),
[author, errors, state],
[author, errors, state]
)
}

Expand Down Expand Up @@ -220,7 +220,7 @@ export function useAuthorAvatar(options?: UseAuthorAvatarOptions): UseAuthorAvat
error,
errors,
}),
[imageUrl, metadataUrl, chainProvider, state, error],
[imageUrl, metadataUrl, chainProvider, state, error]
)
}

Expand Down Expand Up @@ -306,7 +306,7 @@ export function useAuthorAddress(options?: UseAuthorAddressOptions): UseAuthorAd
error: undefined,
errors: [],
}),
[authorAddress, shortAuthorAddress],
[authorAddress, shortAuthorAddress]
)
}
// TODO: figure out how to upgrade to quick-lru 6+ to use maxAge
Expand Down Expand Up @@ -405,7 +405,7 @@ export function useResolvedAuthorAddress(options?: UseResolvedAuthorAddressOptio
},
interval,
true,
[author?.address, chainProviders],
[author?.address, chainProviders]
)

// log('useResolvedAuthorAddress', {author, state, errors, resolvedAddress, chainProviders})
Expand All @@ -421,7 +421,7 @@ export function useResolvedAuthorAddress(options?: UseResolvedAuthorAddressOptio
error: errors[errors.length - 1],
errors,
}),
[resolvedAddress, chainProvider, state, errors],
[resolvedAddress, chainProvider, state, errors]
)
}

Expand Down
6 changes: 3 additions & 3 deletions src/hooks/comments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('comments', () => {
() =>
typeof rendered.result.current.comments[0].cid === 'string' &&
typeof rendered.result.current.comments[1].cid === 'string' &&
typeof rendered.result.current.comments[2].cid === 'string',
typeof rendered.result.current.comments[2].cid === 'string'
)
expect(rendered.result.current.comments[0].cid).toBe('comment cid 1')
expect(rendered.result.current.comments[1].cid).toBe('comment cid 2')
Expand All @@ -124,7 +124,7 @@ describe('comments', () => {
() =>
typeof rendered.result.current.comments[0].upvoteCount === 'number' &&
typeof rendered.result.current.comments[1].upvoteCount === 'number' &&
typeof rendered.result.current.comments[2].upvoteCount === 'number',
typeof rendered.result.current.comments[2].upvoteCount === 'number'
)
expect(rendered.result.current.comments[0].upvoteCount).toBe(3)
expect(rendered.result.current.comments[1].upvoteCount).toBe(3)
Expand Down Expand Up @@ -168,7 +168,7 @@ describe('comments', () => {
() =>
typeof rendered.result.current.comments[0].cid === 'string' &&
typeof rendered.result.current.comments[1].cid === 'string' &&
typeof rendered.result.current.comments[2].cid === 'string',
typeof rendered.result.current.comments[2].cid === 'string'
)
expect(rendered.result.current.comments[0].cid).toBe('comment cid 1')
expect(rendered.result.current.comments[1].cid).toBe('comment cid 2')
Expand Down
8 changes: 4 additions & 4 deletions src/hooks/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function useComment(options?: UseCommentOptions): UseCommentResult {
error: errors?.[errors.length - 1],
errors: errors || [],
}),
[comment, commentCid, errors],
[comment, commentCid, errors]
)
}

Expand All @@ -109,11 +109,11 @@ export function useComments(options?: UseCommentsOptions): UseCommentsResult {
const account = useAccount({accountName})
const commentsStoreComments: (Comment | undefined)[] = useCommentsStore(
(state: any) => (commentCids || []).map((commentCid) => state.comments[commentCid || '']),
shallow,
shallow
)
const subplebbitsPagesComments: (Comment | undefined)[] = useSubplebbitsPagesStore(
(state: any) => (commentCids || []).map((commentCid) => state.comments[commentCid || '']),
shallow,
shallow
)

const addCommentToStore = useCommentsStore((state: any) => state.addCommentToStore)
Expand Down Expand Up @@ -154,6 +154,6 @@ export function useComments(options?: UseCommentsOptions): UseCommentsResult {
error: undefined,
errors: [],
}),
[comments, commentCids?.toString()],
[comments, commentCids?.toString()]
)
}
Loading

0 comments on commit 2c674f1

Please sign in to comment.