refactor: introduce type-only imports (#5462)
This commit is contained in:
committed by
GitHub
parent
e4a29d5991
commit
fc07ce6854
@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('dotenv').config();
|
||||
import express from 'express';
|
||||
import { registerCommonMiddlewares } from './middlewares/common';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import express from 'express';
|
||||
import type express from 'express';
|
||||
import { registerCommonMiddlewares } from './middlewares/common';
|
||||
import { registerMiddleware as localGit } from './middlewares/localGit';
|
||||
import { registerMiddleware as localFs } from './middlewares/localFs';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import winston from 'winston';
|
||||
import type winston from 'winston';
|
||||
import express from 'express';
|
||||
import morgan from 'morgan';
|
||||
import cors from 'cors';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defaultSchema, joi } from '.';
|
||||
import express from 'express';
|
||||
import Joi from '@hapi/joi';
|
||||
import type express from 'express';
|
||||
import type Joi from '@hapi/joi';
|
||||
|
||||
function assetFailure(result: Joi.ValidationResult, expectedMessage: string) {
|
||||
const { error } = result;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import express from 'express';
|
||||
import type express from 'express';
|
||||
import Joi from '@hapi/joi';
|
||||
|
||||
const allowedActions = [
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import Joi from '@hapi/joi';
|
||||
import type Joi from '@hapi/joi';
|
||||
import { getSchema } from '.';
|
||||
|
||||
function assetFailure(result: Joi.ValidationResult, expectedMessage: string) {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import winston from 'winston';
|
||||
import express from 'express';
|
||||
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 {
|
||||
import type {
|
||||
EntriesByFolderParams,
|
||||
EntriesByFilesParams,
|
||||
GetEntryParams,
|
||||
@ -32,7 +32,6 @@ export function localFsMiddleware({ repoPath, logger }: FsOptions) {
|
||||
case 'info': {
|
||||
res.json({
|
||||
repo: path.basename(repoPath),
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
publish_modes: ['simple'],
|
||||
type: 'local_fs',
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import Joi from '@hapi/joi';
|
||||
import express from 'express';
|
||||
import type Joi from '@hapi/joi';
|
||||
import type express from 'express';
|
||||
import winston from 'winston';
|
||||
import { validateRepo, getSchema, localGitMiddleware } from '.';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import winston from 'winston';
|
||||
import express from 'express';
|
||||
import type winston from 'winston';
|
||||
import type express from 'express';
|
||||
import path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import {
|
||||
@ -13,7 +13,7 @@ import {
|
||||
} from 'netlify-cms-lib-util/src/APIUtils';
|
||||
import { parse } from 'what-the-diff';
|
||||
import { defaultSchema, joi } from '../joi';
|
||||
import {
|
||||
import type {
|
||||
EntriesByFolderParams,
|
||||
EntriesByFilesParams,
|
||||
GetEntryParams,
|
||||
@ -181,7 +181,6 @@ export function localGitMiddleware({ repoPath, logger }: GitOptions) {
|
||||
if (body.action === 'info') {
|
||||
res.json({
|
||||
repo: path.basename(repoPath),
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
publish_modes: ['simple', 'editorial_workflow'],
|
||||
type: 'local_git',
|
||||
});
|
||||
|
Reference in New Issue
Block a user