chore: introduce imports ordering (#5463)
This commit is contained in:
committed by
GitHub
parent
30f0e7b031
commit
dbf2920254
@ -1,6 +1,7 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('dotenv').config();
|
||||
import express from 'express';
|
||||
|
||||
import { registerCommonMiddlewares } from './middlewares/common';
|
||||
import { registerMiddleware as registerLocalGit } from './middlewares/localGit';
|
||||
import { registerMiddleware as registerLocalFs } from './middlewares/localFs';
|
||||
|
@ -1,9 +1,10 @@
|
||||
import type express from 'express';
|
||||
import { registerCommonMiddlewares } from './middlewares/common';
|
||||
import { registerMiddleware as localGit } from './middlewares/localGit';
|
||||
import { registerMiddleware as localFs } from './middlewares/localFs';
|
||||
import { createLogger } from './logger';
|
||||
|
||||
import type express from 'express';
|
||||
|
||||
type Options = {
|
||||
logLevel?: string;
|
||||
};
|
||||
|
@ -1,8 +1,9 @@
|
||||
import type winston from 'winston';
|
||||
import express from 'express';
|
||||
import morgan from 'morgan';
|
||||
import cors from 'cors';
|
||||
|
||||
import type winston from 'winston';
|
||||
|
||||
export type Options = {
|
||||
logger: winston.Logger;
|
||||
};
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { defaultSchema, joi } from '.';
|
||||
|
||||
import type express from 'express';
|
||||
import type Joi from '@hapi/joi';
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type express from 'express';
|
||||
import Joi from '@hapi/joi';
|
||||
|
||||
import type express from 'express';
|
||||
|
||||
const allowedActions = [
|
||||
'info',
|
||||
'entriesByFolder',
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import type Joi from '@hapi/joi';
|
||||
import { getSchema } from '.';
|
||||
|
||||
import type Joi from '@hapi/joi';
|
||||
|
||||
function assetFailure(result: Joi.ValidationResult, expectedMessage: string) {
|
||||
const { error } = result;
|
||||
expect(error).not.toBeNull();
|
||||
|
@ -1,8 +1,10 @@
|
||||
import type winston from 'winston';
|
||||
import type express from 'express';
|
||||
import path from 'path';
|
||||
|
||||
import { defaultSchema, joi } from '../joi';
|
||||
import { pathTraversal } from '../joi/customValidators';
|
||||
import { listRepoFiles, deleteFile, writeFile, move } from '../utils/fs';
|
||||
import { entriesFromFiles, readMediaFile } from '../utils/entries';
|
||||
|
||||
import type {
|
||||
EntriesByFolderParams,
|
||||
EntriesByFilesParams,
|
||||
@ -15,8 +17,8 @@ import type {
|
||||
DeleteFilesParams,
|
||||
DataFile,
|
||||
} from '../types';
|
||||
import { listRepoFiles, deleteFile, writeFile, move } from '../utils/fs';
|
||||
import { entriesFromFiles, readMediaFile } from '../utils/entries';
|
||||
import type express from 'express';
|
||||
import type winston from 'winston';
|
||||
|
||||
type FsOptions = {
|
||||
repoPath: string;
|
||||
|
@ -1,8 +1,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import winston from 'winston';
|
||||
|
||||
import { validateRepo, getSchema, localGitMiddleware } from '.';
|
||||
|
||||
import type Joi from '@hapi/joi';
|
||||
import type express from 'express';
|
||||
import winston from 'winston';
|
||||
import { validateRepo, getSchema, localGitMiddleware } from '.';
|
||||
|
||||
jest.mock('netlify-cms-lib-util', () => jest.fn());
|
||||
jest.mock('simple-git/promise');
|
||||
|
@ -1,5 +1,3 @@
|
||||
import type winston from 'winston';
|
||||
import type express from 'express';
|
||||
import path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import {
|
||||
@ -12,7 +10,14 @@ import {
|
||||
parseContentKey,
|
||||
} from 'netlify-cms-lib-util/src/APIUtils';
|
||||
import { parse } from 'what-the-diff';
|
||||
import simpleGit from 'simple-git/promise';
|
||||
import { Mutex, withTimeout } from 'async-mutex';
|
||||
|
||||
import { defaultSchema, joi } from '../joi';
|
||||
import { pathTraversal } from '../joi/customValidators';
|
||||
import { listRepoFiles, writeFile, move, deleteFile, getUpdateDate } from '../utils/fs';
|
||||
import { entriesFromFiles, readMediaFile } from '../utils/entries';
|
||||
|
||||
import type {
|
||||
EntriesByFolderParams,
|
||||
EntriesByFilesParams,
|
||||
@ -33,12 +38,8 @@ import type {
|
||||
UnpublishedEntryDataFileParams,
|
||||
UnpublishedEntryMediaFileParams,
|
||||
} from '../types';
|
||||
// eslint-disable-next-line import/default
|
||||
import simpleGit from 'simple-git/promise';
|
||||
import { Mutex, withTimeout } from 'async-mutex';
|
||||
import { pathTraversal } from '../joi/customValidators';
|
||||
import { listRepoFiles, writeFile, move, deleteFile, getUpdateDate } from '../utils/fs';
|
||||
import { entriesFromFiles, readMediaFile } from '../utils/entries';
|
||||
import type express from 'express';
|
||||
import type winston from 'winston';
|
||||
|
||||
async function commit(git: simpleGit.SimpleGit, commitMessage: string) {
|
||||
await git.add('.');
|
||||
|
Reference in New Issue
Block a user