Skip to content

Conversation

@nicodh
Copy link
Member

@nicodh nicodh commented Nov 25, 2025

Reduces the number of warnings from 37 to 16. Many of the warnings seem inappropriate so just adding a line to disable the rook was often used.

Can be best reviewed commit by commit.

@nicodh
Copy link
Member Author

nicodh commented Nov 25, 2025

@WofWca we have 7 warnings just from the ChatlistContext file. Maybe you can have a look how to fix/avoid them?

@nicodh nicodh requested a review from WofWca November 25, 2025 09:48
Copy link
Member

@WofWca WofWca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although some of these can probably be fixed instead of simply being ignored, I think it's fine to ignore them if there is no obvious problem that they're pointing out. The fact that a warning is ignored is also sort of a warning.

Comment on lines +107 to +113
const [currentTime] = useState(() => Date.now())

// if older than one week we don't need to update timestamps
if (props.timestamp < Date.now() - relativeTimeThreshold) {
const isOld = useMemo(
() => props.timestamp < currentTime - relativeTimeThreshold,
[props.timestamp, currentTime]
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utilizing useState over useMemo for currentTime seems to be just a hack to suppress the warning here or am I wrong? Let's better suppress it explicitly.

Suggested change
const [currentTime] = useState(() => Date.now())
// if older than one week we don't need to update timestamps
if (props.timestamp < Date.now() - relativeTimeThreshold) {
const isOld = useMemo(
() => props.timestamp < currentTime - relativeTimeThreshold,
[props.timestamp, currentTime]
)
// if older than one week we don't need to update timestamps
const isOld = useMemo(
// eslint-disable-next-line react-hooks/purity
() => props.timestamp < Date.now() - relativeTimeThreshold,
[props.timestamp]
)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both variants seem fine to me

Copy link
Member

@WofWca WofWca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The misuse of useState is not nice, but otherwise looks good (see my previous review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants