chore: enable import/order rule (#7418)

This commit is contained in:
Joshua Chen 2022-05-14 23:39:50 +08:00 committed by GitHub
parent a4c54aba45
commit 0838884f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
300 changed files with 712 additions and 727 deletions

View file

@ -6,9 +6,9 @@
*/
import {jest} from '@jest/globals';
import {readOutputHTMLFile, generate} from '../emitUtils';
import path from 'path';
import fs from 'fs-extra';
import {readOutputHTMLFile, generate} from '../emitUtils';
describe('readOutputHTMLFile', () => {
it('reads both files with trailing slash undefined', async () => {

View file

@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/
import {FileNotTrackedError, getFileCommitDate} from '../gitUtils';
import fs from 'fs-extra';
import path from 'path';
import {createTempRepo} from '@testing-utils/git';
import {FileNotTrackedError, getFileCommitDate} from '../gitUtils';
/* eslint-disable no-restricted-properties */
function initializeTempRepo() {

View file

@ -6,6 +6,7 @@
*/
import {jest} from '@jest/globals';
import _ from 'lodash';
import {
removeSuffix,
removePrefix,
@ -13,7 +14,6 @@ import {
findAsyncSequential,
reportMessage,
} from '../jsUtils';
import _ from 'lodash';
describe('removeSuffix', () => {
it("is no-op when suffix doesn't exist", () => {

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
import dedent from 'dedent';
import {
createExcerpt,
parseMarkdownContentTitle,
@ -12,7 +13,6 @@ import {
parseMarkdownHeadingId,
writeMarkdownHeadingId,
} from '../markdownUtils';
import dedent from 'dedent';
describe('createExcerpt', () => {
it('creates excerpt for text-only content', () => {

View file

@ -6,6 +6,7 @@
*/
import {jest} from '@jest/globals';
import path from 'path';
import {
isNameTooLong,
shortName,
@ -15,7 +16,6 @@ import {
toMessageRelativeFilePath,
addTrailingPathSeparator,
} from '../pathUtils';
import path from 'path';
describe('isNameTooLong', () => {
it('works', () => {

View file

@ -6,11 +6,11 @@
*/
import fs from 'fs-extra';
import Yaml from 'js-yaml';
import path from 'path';
import logger from '@docusaurus/logger';
import Yaml from 'js-yaml';
import {findAsyncSequential} from './index';
import type {ContentPaths} from './markdownLinks';
import logger from '@docusaurus/logger';
type DataFileParams = {
/** Path to the potential data file, relative to `contentPaths` */

View file

@ -7,8 +7,8 @@
// Globby/Micromatch are the 2 libs we use in Docusaurus consistently
import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby
import path from 'path';
import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby
/** A re-export of the globby instance. */
export {default as Globby} from 'globby';

View file

@ -7,13 +7,13 @@
import path from 'path';
import _ from 'lodash';
import {DEFAULT_PLUGIN_ID, I18N_DIR_NAME} from './constants';
import {normalizeUrl} from './urlUtils';
import type {
TranslationFileContent,
TranslationFile,
I18n,
} from '@docusaurus/types';
import {DEFAULT_PLUGIN_ID, I18N_DIR_NAME} from './constants';
import {normalizeUrl} from './urlUtils';
/**
* Takes a list of translation file contents, and shallow-merges them into one.

View file

@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
import type {ReportingSeverity} from '@docusaurus/types';
import logger from '@docusaurus/logger';
import type {ReportingSeverity} from '@docusaurus/types';
/** Removes a given string suffix from `str`. */
export function removeSuffix(str: string, suffix: string): string {

View file

@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
import {removeSuffix} from './jsUtils';
import resolvePathnameUnsafe from 'resolve-pathname';
import {removeSuffix} from './jsUtils';
/**
* Much like `path.join`, but much better. Takes an array of URL segments, and

View file

@ -5,13 +5,13 @@
* LICENSE file in the root directory of this source tree.
*/
import type {RuleSetRule} from 'webpack';
import path from 'path';
import {escapePath} from './pathUtils';
import {
WEBPACK_URL_LOADER_LIMIT,
OUTPUT_STATIC_ASSETS_DIR_NAME,
} from './constants';
import type {RuleSetRule} from 'webpack';
type AssetFolder = 'images' | 'files' | 'fonts' | 'medias';