Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo: ESLint warnings in useSandboxServices (react-hooks/exhaustive-deps) #6917

Closed
JoshuaKGoldberg opened this issue Apr 16, 2023 · 2 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

/home/runner/work/typescript-eslint/typescript-eslint/packages/website/src/components/editor/useSandboxServices.ts
Warning:   128:6  warning  React Hook useEffect has missing dependencies: 'colorMode', 'onLoaded', and 'props'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

Example: #6907 -> https://github.com/typescript-eslint/typescript-eslint/actions/runs/4703925812/jobs/8343076171?pr=6907

This is showing up in PRs. Can we fix for the rule's complaint without causing bugs in the playground?

@JoshuaKGoldberg JoshuaKGoldberg added repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue labels Apr 16, 2023
@armano2
Copy link
Member

armano2 commented Apr 16, 2023

sadly we have to eslint-disable it

@armano2 armano2 closed this as completed Apr 18, 2023
@armano2
Copy link
Member

armano2 commented Apr 18, 2023

this has been fixed in v6

// colorMode and jsx can't be reactive here because we don't want to force a recreation
// updating of colorMode and jsx is handled in LoadedEditor
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.ts, onLoaded]);

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

No branches or pull requests

2 participants