Skip to content

Commit 2873b72

Browse files
committed
chore(prettier): fix prettier lint
1 parent 5c72c08 commit 2873b72

32 files changed

+75
-52
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ Proxy `/api` requests to `http://www.example.org`
2828

2929
```typescript
3030
// typescript
31-
3231
import * as express from 'express';
33-
import type { Request, Response, NextFunction } from 'express';
34-
32+
import type { NextFunction, Request, Response } from 'express';
3533
import { createProxyMiddleware } from 'http-proxy-middleware';
3634
import type { Filter, Options, RequestHandler } from 'http-proxy-middleware';
3735

examples/next-app/pages/api/_proxy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { NextApiRequest, NextApiResponse } from 'next';
2+
23
import { createProxyMiddleware } from '../../../../dist';
34

45
// Singleton

examples/next-app/pages/api/users.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { NextApiRequest, NextApiResponse, PageConfig } from 'next';
2+
23
import { proxyMiddleware } from './_proxy';
34

45
// https://nextjs.org/docs/pages/building-your-application/routing/api-routes

recipes/servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ export const proxyMiddleware = createProxyMiddleware<NextApiRequest, NextApiResp
105105

106106
```typescript
107107
// Next project: `/pages/api/users.ts`
108-
109108
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
110109
import type { NextApiRequest, NextApiResponse } from 'next';
110+
111111
import { proxyMiddleware } from './users.proxy';
112112

113113
export default function handler(req: NextApiRequest, res: NextApiResponse) {

src/factory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { HttpProxyMiddleware } from './http-proxy-middleware';
2-
import type { Options, RequestHandler, NextFunction } from './types';
31
import type * as http from 'http';
42

3+
import { HttpProxyMiddleware } from './http-proxy-middleware';
4+
import type { NextFunction, Options, RequestHandler } from './types';
5+
56
export function createProxyMiddleware<
67
TReq = http.IncomingMessage,
78
TRes = http.ServerResponse,

src/get-plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { Options, Plugin } from './types';
21
import {
32
debugProxyErrorsPlugin,
4-
loggerPlugin,
53
errorResponsePlugin,
4+
loggerPlugin,
65
proxyEventsPlugin,
76
} from './plugins/default';
7+
import type { Options, Plugin } from './types';
88

99
export function getPlugins<TReq, TRes>(options: Options<TReq, TRes>): Plugin<TReq, TRes>[] {
1010
// don't load default errorResponsePlugin if user has specified their own

src/handlers/response-interceptor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type * as http from 'http';
22
import * as zlib from 'zlib';
3+
34
import { Debug } from '../debug';
45
import { getFunctionName } from '../utils/function';
56

src/http-proxy-middleware.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import type * as net from 'net';
21
import type * as http from 'http';
3-
import type * as https from 'https';
4-
import type { RequestHandler, Options, Filter, Logger } from './types';
52
import * as httpProxy from 'http-proxy';
3+
import type * as https from 'https';
4+
import type * as net from 'net';
5+
66
import { verifyConfig } from './configuration';
7+
import { Debug as debug } from './debug';
78
import { getPlugins } from './get-plugins';
9+
import { getLogger } from './logger';
810
import { matchPathFilter } from './path-filter';
911
import * as PathRewriter from './path-rewriter';
1012
import * as Router from './router';
11-
import { Debug as debug } from './debug';
13+
import type { Filter, Logger, Options, RequestHandler } from './types';
1214
import { getFunctionName } from './utils/function';
13-
import { getLogger } from './logger';
1415

1516
export class HttpProxyMiddleware<TReq, TRes> {
1617
private wsInternalSubscribed = false;

src/legacy/create-proxy-middleware.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { createProxyMiddleware } from '../factory';
1+
import type * as http from 'http';
2+
23
import { Debug } from '../debug';
4+
import { createProxyMiddleware } from '../factory';
35
import { Filter, RequestHandler } from '../types';
46
import { legacyOptionsAdapter } from './options-adapter';
57
import { LegacyOptions } from './types';
6-
import type * as http from 'http';
78

89
const debug = Debug.extend('legacy-create-proxy-middleware');
910

src/legacy/options-adapter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import * as url from 'url';
2-
import { Filter, Options } from '../types';
3-
import { LegacyOptions } from './types';
2+
43
import { Debug } from '../debug';
54
import { getLogger } from '../logger';
5+
import { Filter, Options } from '../types';
66
import { Logger } from '../types';
7+
import { LegacyOptions } from './types';
78

89
const debug = Debug.extend('legacy-options-adapter');
910

0 commit comments

Comments
 (0)