refactor: import jest as global; unify import style of some modules (#6898)

* refactor: import jest as global

* fix react
This commit is contained in:
Joshua Chen 2022-03-11 19:04:27 +08:00 committed by GitHub
parent e97dc0d37e
commit c9ee6e467c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 177 additions and 139 deletions

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import path from 'path';
import {cliDocsVersionCommand} from '../cli';
import type {

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import path from 'path';
import {loadContext} from '@docusaurus/core/src/server/index';
import {

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import path from 'path';
import {isMatch} from 'picomatch';
import commander from 'commander';
@ -29,7 +30,7 @@ import type {
} from '../sidebars/types';
import {toSidebarsProp} from '../props';
import {validate} from 'webpack';
import webpack from 'webpack';
import {DefaultSidebarItemsGenerator} from '../sidebars/generator';
import {DisabledSidebars} from '../sidebars';
@ -311,7 +312,7 @@ describe('simple website', () => {
undefined,
content,
);
const errors = validate(config);
const errors = webpack.validate(config);
expect(errors).toBeUndefined();
});

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import fs from 'fs-extra';
import path from 'path';
import shell from 'shelljs';

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import path from 'path';
import {
getVersionsFilePath,

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import fs from 'fs-extra';
import path from 'path';
import {linkify} from '../linkify';

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import {DefaultSidebarItemsGenerator} from '../generator';
import type {SidebarItemsGenerator} from '../types';
import {DefaultNumberPrefixParser} from '../../numberPrefix';

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import {jest} from '@jest/globals';
import {processSidebars} from '../processor';
import type {
SidebarItem,