-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor: import jest as global; unify import style of some modules #6898
Conversation
✔️ [V2] 🔨 Explore the source changes: 03853de 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/622b25e98b6fd6000960a950 😎 Browse the preview: https://deploy-preview-6898--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6898--docusaurus-2.netlify.app/ |
Size Change: -24 B (0%) Total Size: 792 kB ℹ️ View Unchanged
|
@@ -96,7 +95,9 @@ const useAnnouncementBarContextValue = (): AnnouncementBarAPI => { | |||
); | |||
}; | |||
|
|||
const AnnouncementBarContext = createContext<AnnouncementBarAPI | null>(null); | |||
const AnnouncementBarContext = React.createContext<AnnouncementBarAPI | null>( |
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.
not against this change, just wondering why it's necessary?
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.
Oh, purely stylistic. We have some React.createContext
and some createContext
. I personally prefer to have the React.
prefix except for hooks so we understand what we are talking about
{ | ||
files: ['*.test.ts', '*.test.tsx'], | ||
rules: { | ||
'import/no-extraneous-dependencies': OFF, |
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.
maybe this should be disabled with more granularity (if possible)? 🤷♂️
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.
Test files are internal anyways. If they can run, there's nothing to worry about.
Motivation
I spent a while playing with running Jest in ESM. I was very close to success. Now, I'm a bit more confident about how to roll this out gradually—as usual, the migration (even when it's only for development) will be split into several granular PRs so people can follow the progress and catch any bugs in the process.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Tests still pass
Related PRs
#6520