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

enable eslint hooks rules #5363

Merged
merged 1 commit into from
Mar 17, 2023
Merged

Conversation

aciccarello
Copy link
Contributor

@aciccarello aciccarello commented Mar 16, 2023

Description
A clear and concise description of what this pull request solves. (Please do not just link to a long issue thread. Instead include a clear description here or your pull request will likely not be reviewed as quickly.)

Issue
Fixes: (link to issue)

Example
A GIF or video showing the old and new behaviors after this pull request is merged. Or a code sample showing the usage of a new API. (If you don't include this, your pull request will not be reviewed as quickly, because it's much too hard to figure out exactly what is going wrong, and it makes maintenance much harder.)

Context
If your change is non-trivial, please include a description of how the new logic works, and why you decided to solve it the way you did. (This is incredibly helpful so that reviewers don't have to guess your intentions based on the code, and without it your pull request will likely not be reviewed as quickly.)

Closes #3886

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2023

🦋 Changeset detected

Latest commit: 40e1ab8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -19,7 +20,7 @@
"settings": {
"import/extensions": [".js", ".ts", ".jsx", ".tsx"],
"react": {
"version": "detect"
"version": "16"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think yarn was causing detect to not work

renderElement={({ element, children }) => {
React.useEffect(() => mounts(element), [])
renderElement={({ children }) => {
useEffect(() => mounts(), [])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is meant to be testing the mount call count (hence the empty dependency) but we were passing the element which eslint wants included in the dependency array. It's not needed for the test.

@aciccarello aciccarello marked this pull request as ready for review March 16, 2023 20:58
Copy link
Collaborator

@dylans dylans left a comment

Choose a reason for hiding this comment

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

Overall looks good, it looks like @jason0x43's feedback covers everything I would have suggested, so please let me know when you've addressed the other feedback. Thanks!

@dylans dylans merged commit d42cd00 into ianstormtaylor:main Mar 17, 2023
@github-actions github-actions bot mentioned this pull request Mar 17, 2023
@aciccarello aciccarello deleted the eslint-react-hooks branch March 17, 2023 18:05
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.

Runtime change of editor causes a crash
3 participants