Last analyzed e429694 3 months ago
Default analysis branch is
Currently analyzing run
Unnecessary type assertion of an expression JS-0349
Anti-pattern
7 months ago7 months old
This assertion is unnecessary since it does not change the type of the expression
 9
10const DisplayPosts = ({ pages }: { pages: Pages }) => {
11  return (
12    <>{pages!.map(({ feed }) => feed.map((post: typeof feed[number]) => <PostCard key={post.id} post={post} />))}</>13  )
14}
15
This assertion is unnecessary since it does not change the type of the expression
55        <Popover.Dropdown p={0} sx={{ height: '222px', overflowY: 'auto' }}>
56          {searchResult?.searchResult?.length! > 0 ? (
57            searchResult?.searchResult?.map((user) => (
58              <Group p={'0.5rem'} key={user!.id} sx={{ borderBottom: '1px solid lightgray' }}>59                <AvatarName avatar={user?.avatar} name={user?.name} />
60              </Group>
61            ))
This assertion is unnecessary since it does not change the type of the expression
25      utils.setQueryData(['post.get-post', { postId }], {
26        post: {
27          ...snapshot!.post,
28          comments: [res.commentAdded, ...snapshot!.post.comments],29        },
30      })
31      return { snapshot }
This assertion is unnecessary since it does not change the type of the expression
24
25      utils.setQueryData(['post.get-post', { postId }], {
26        post: {
27          ...snapshot!.post,28          comments: [res.commentAdded, ...snapshot!.post.comments],
29        },
30      })
This assertion is unnecessary since it does not change the type of the expression
 93          data: {
 94            postId: post.id,
 95            userId: ctx.session.user.id,
 96            body: caption!, 97          },
 98        })
 99      }