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

@ -7,9 +7,9 @@
import {jest} from '@jest/globals';
import {DefaultSidebarItemsGenerator} from '../generator';
import type {SidebarItemsGenerator} from '../types';
import {DefaultNumberPrefixParser} from '../../numberPrefix';
import {isCategoryIndex} from '../../docs';
import type {SidebarItemsGenerator} from '../types';
describe('DefaultSidebarItemsGenerator', () => {
function testDefaultSidebarItemsGenerator(

View file

@ -9,8 +9,8 @@ import {jest} from '@jest/globals';
import path from 'path';
import {createSlugger} from '@docusaurus/utils';
import {loadSidebars, DisabledSidebars} from '../index';
import type {SidebarProcessorParams} from '../types';
import {DefaultSidebarItemsGenerator} from '../generator';
import type {SidebarProcessorParams} from '../types';
import type {DocMetadata} from '@docusaurus/plugin-content-docs';
describe('loadSidebars', () => {

View file

@ -6,7 +6,11 @@
*/
import {jest} from '@jest/globals';
import {createSlugger} from '@docusaurus/utils';
import {processSidebars} from '../processor';
import {DefaultSidebarItemsGenerator} from '../generator';
import {DefaultNumberPrefixParser} from '../../numberPrefix';
import {isCategoryIndex} from '../../docs';
import type {
SidebarItem,
SidebarItemsGenerator,
@ -16,11 +20,7 @@ import type {
CategoryMetadataFile,
ProcessedSidebars,
} from '../types';
import {DefaultSidebarItemsGenerator} from '../generator';
import {createSlugger} from '@docusaurus/utils';
import type {VersionMetadata} from '@docusaurus/plugin-content-docs';
import {DefaultNumberPrefixParser} from '../../numberPrefix';
import {isCategoryIndex} from '../../docs';
describe('processSidebars', () => {
function createStaticSidebarItemGenerator(

View file

@ -5,6 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/
import path from 'path';
import _ from 'lodash';
import logger from '@docusaurus/logger';
import {addTrailingSlash} from '@docusaurus/utils';
import {createDocsByIdIndex, toCategoryIndexMatcherParam} from '../docs';
import type {
SidebarItemDoc,
SidebarItemsGenerator,
@ -13,11 +18,6 @@ import type {
NormalizedSidebarItem,
SidebarItemCategoryLinkConfig,
} from './types';
import _ from 'lodash';
import {addTrailingSlash} from '@docusaurus/utils';
import logger from '@docusaurus/logger';
import path from 'path';
import {createDocsByIdIndex, toCategoryIndexMatcherParam} from '../docs';
const BreadcrumbSeparator = '/';

View file

@ -6,19 +6,19 @@
*/
import fs from 'fs-extra';
import path from 'path';
import _ from 'lodash';
import logger from '@docusaurus/logger';
import {Globby} from '@docusaurus/utils';
import Yaml from 'js-yaml';
import combinePromises from 'combine-promises';
import importFresh from 'import-fresh';
import type {SidebarsConfig, Sidebars, SidebarProcessorParams} from './types';
import {validateSidebars, validateCategoryMetadataFile} from './validation';
import {normalizeSidebars} from './normalization';
import {processSidebars} from './processor';
import {postProcessSidebars} from './postProcessor';
import path from 'path';
import {Globby} from '@docusaurus/utils';
import logger from '@docusaurus/logger';
import type {PluginOptions} from '@docusaurus/plugin-content-docs';
import Yaml from 'js-yaml';
import _ from 'lodash';
import combinePromises from 'combine-promises';
import type {SidebarsConfig, Sidebars, SidebarProcessorParams} from './types';
export const DefaultSidebars: SidebarsConfig = {
defaultSidebar: [

View file

@ -5,6 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
import _ from 'lodash';
import logger from '@docusaurus/logger';
import {isCategoriesShorthand} from './utils';
import type {
NormalizedSidebarItem,
NormalizedSidebar,
@ -16,9 +19,6 @@ import type {
SidebarsConfig,
NormalizedSidebarItemCategory,
} from './types';
import {isCategoriesShorthand} from './utils';
import _ from 'lodash';
import logger from '@docusaurus/logger';
function normalizeCategoriesShorthand(
sidebar: SidebarCategoriesShorthand,

View file

@ -5,7 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
import _ from 'lodash';
import {normalizeUrl} from '@docusaurus/utils';
import {getDocIds} from '../docs';
import type {
SidebarItem,
Sidebars,
@ -15,8 +17,6 @@ import type {
ProcessedSidebars,
SidebarItemCategoryLink,
} from './types';
import {getDocIds} from '../docs';
import _ from 'lodash';
type SidebarPostProcessorParams = SidebarProcessorParams & {
draftIds: Set<string>;

View file

@ -5,6 +5,11 @@
* LICENSE file in the root directory of this source tree.
*/
import _ from 'lodash';
import combinePromises from 'combine-promises';
import {DefaultSidebarItemsGenerator} from './generator';
import {validateSidebars} from './validation';
import {isCategoryIndex} from '../docs';
import type {
DocMetadataBase,
VersionMetadata,
@ -22,11 +27,6 @@ import type {
SidebarProcessorParams,
CategoryMetadataFile,
} from './types';
import {DefaultSidebarItemsGenerator} from './generator';
import {validateSidebars} from './validation';
import _ from 'lodash';
import combinePromises from 'combine-promises';
import {isCategoryIndex} from '../docs';
function toSidebarItemsGeneratorDoc(
doc: DocMetadataBase,

View file

@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
import _ from 'lodash';
import {toMessageRelativeFilePath} from '@docusaurus/utils';
import type {
Sidebars,
Sidebar,
@ -18,9 +20,6 @@ import type {
SidebarItemCategoryWithGeneratedIndex,
SidebarNavigationItem,
} from './types';
import _ from 'lodash';
import {toMessageRelativeFilePath} from '@docusaurus/utils';
import type {
DocMetadataBase,
PropNavigationLink,