-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update eslint #4797
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
Update eslint #4797
Conversation
503580a to
3e2552d
Compare
e555bdf to
aa1d7a6
Compare
size-limit report
|
|
👋 It looks like you're updating JavaScript packages that are known You can deduplicate them with the A duplicate React version may cause an invalid hook call warning. React context providers usually use module-scoped globals as their |
kyledurand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
| const Wrapper = strict ? StrictMode : Fragment; | ||
| const intl = new I18n(i18n || {}); | ||
| const scrollLockManager = new ScrollLockManager(); | ||
| const intl = useMemo(() => new I18n(i18n || {}), [i18n]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary or optimizing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eslint warns with react/jsx-no-constructed-context-values when you sick something in a context that shall cause the context to be updated on every single rerender regardless of if the content changes or not. With the fix being to memoize objects you pass into contexts.
In this particular case it's probably not a big deal as we probably aren't causing rerenders on PolarisTestProvider because, but it's an easy fix to write code in the way to keep the linter happy rather than sprinkling eslint-disable-next-lines around
WHY are these changes introduced?
Keeping up to date.
WHAT is this pull request doing?
eslintto v8.3.0 and@shopify/eslint-pluginto v41.0.1babel/*rules to be@babel/*Tkeyprops are always before spreads to keep react/jsx-key happyTo Test
CI passes