refactor: import jest as global; unify import style of some modules#6898
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
|
| }; | ||
|
|
||
| const AnnouncementBarContext = createContext<AnnouncementBarAPI | null>(null); | ||
| const AnnouncementBarContext = React.createContext<AnnouncementBarAPI | null>( |
There was a problem hiding this comment.
not against this change, just wondering why it's necessary?
There was a problem hiding this comment.
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.
maybe this should be disabled with more granularity (if possible)? 🤷♂️
There was a problem hiding this comment.
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