Skip to content

Commit 0b0a309

Browse files
authored
build(deps-dev): replace standard with neostandard (#394)
1 parent c33eda6 commit 0b0a309

File tree

5 files changed

+37
-34
lines changed

5 files changed

+37
-34
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![CI](https://github.com/fastify/fastify-http-proxy/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-http-proxy/actions/workflows/ci.yml)
44
[![NPM version](https://img.shields.io/npm/v/@fastify/http-proxy.svg?style=flat)](https://www.npmjs.com/package/@fastify/http-proxy)
5-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
5+
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)
66

77
Proxy your HTTP requests to another server, with hooks.
88
This [`fastify`](https://fastify.dev) plugin forwards all requests

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict'
2+
3+
module.exports = require('neostandard')({
4+
ignores: require('neostandard').resolveIgnoresFromGitignore(),
5+
ts: true
6+
})

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"type": "commonjs",
77
"types": "types/index.d.ts",
88
"scripts": {
9-
"lint": "standard | snazzy",
10-
"lint:fix": "standard --fix | snazzy",
9+
"lint": "eslint",
10+
"lint:fix": "eslint --fix",
1111
"lint:typescript": "npm run lint:fix - --parser @typescript-eslint/parser --plugin typescript \"test/types/*.ts\"",
1212
"test": "npm run lint && tap \"test/*.js\" && npm run typescript",
1313
"typescript": "tsd"
@@ -32,20 +32,17 @@
3232
"@fastify/websocket": "^11.0.1",
3333
"@types/node": "^22.0.0",
3434
"@types/ws": "^8.5.10",
35-
"@typescript-eslint/eslint-plugin": "^7.6.0",
36-
"@typescript-eslint/parser": "^7.6.0",
3735
"express": "^4.19.2",
3836
"express-http-proxy": "^2.0.0",
3937
"fast-proxy": "^2.1.0",
4038
"fastify": "^5.0.0",
4139
"got": "^11.8.6",
4240
"http-errors": "^2.0.0",
4341
"http-proxy": "^1.18.1",
42+
"neostandard": "^0.11.9",
4443
"simple-get": "^4.0.1",
45-
"snazzy": "^9.0.0",
4644
"socket.io": "^4.7.5",
4745
"socket.io-client": "^4.7.5",
48-
"standard": "^17.1.0",
4946
"tap": "^18.7.2",
5047
"tsd": "^0.31.0",
5148
"typescript": "~5.7.2",

types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
preValidationHookHandler,
88
RawServerBase,
99
RequestGenericInterface,
10-
} from 'fastify';
10+
} from 'fastify'
1111

1212
import {
1313
FastifyReplyFromOptions,
1414
FastifyReplyFromHooks,
15-
} from '@fastify/reply-from';
15+
} from '@fastify/reply-from'
1616

17-
import { ClientOptions, ServerOptions } from 'ws';
17+
import { ClientOptions, ServerOptions } from 'ws'
1818

1919
interface FastifyHttpProxyWebsocketOptionsEnabled {
2020
websocket: true;
@@ -28,14 +28,14 @@ interface FastifyHttpProxyWebsocketOptionsDisabled {
2828
type FastifyHttpProxy = FastifyPluginCallback<
2929
fastifyHttpProxy.FastifyHttpProxyOptions
3030
& (FastifyHttpProxyWebsocketOptionsEnabled | FastifyHttpProxyWebsocketOptionsDisabled)
31-
>;
31+
>
3232

3333
declare namespace fastifyHttpProxy {
3434
type QueryStringFunction = (
3535
search: string | undefined,
3636
reqUrl: string,
3737
request: FastifyRequest<RequestGenericInterface, RawServerBase>
38-
) => string;
38+
) => string
3939

4040
export interface FastifyHttpProxyOptions extends FastifyReplyFromOptions {
4141
upstream: string;
@@ -58,5 +58,5 @@ declare namespace fastifyHttpProxy {
5858
export { fastifyHttpProxy as default }
5959
}
6060

61-
declare function fastifyHttpProxy(...params: Parameters<FastifyHttpProxy>): ReturnType<FastifyHttpProxy>
61+
declare function fastifyHttpProxy (...params: Parameters<FastifyHttpProxy>): ReturnType<FastifyHttpProxy>
6262
export = fastifyHttpProxy

types/index.test-d.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import fastify, {
44
type FastifyRequest,
55
type RawServerBase,
66
type RequestGenericInterface,
7-
} from 'fastify';
8-
import { expectError, expectType } from 'tsd';
9-
import fastifyHttpProxy from '..';
7+
} from 'fastify'
8+
import { expectError, expectType } from 'tsd'
9+
import fastifyHttpProxy from '..'
1010

11-
const app = fastify();
11+
const app = fastify()
1212

1313
app.register(fastifyHttpProxy, {
1414
upstream: 'http://origin.asd',
15-
});
15+
})
1616

1717
app.register(fastifyHttpProxy, {
1818
upstream: 'http://origin.asd',
@@ -23,16 +23,16 @@ app.register(fastifyHttpProxy, {
2323
replyOptions: { contentType: 'application/json' },
2424
httpMethods: ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT', 'OPTIONS'],
2525
preHandler: (request, reply) => {
26-
expectType<RawRequestDefaultExpression>(request.raw);
27-
expectType<RawReplyDefaultExpression>(reply.raw);
26+
expectType<RawRequestDefaultExpression>(request.raw)
27+
expectType<RawReplyDefaultExpression>(reply.raw)
2828
},
2929
beforeHandler: (request, reply) => {
30-
expectType<RawRequestDefaultExpression>(request.raw);
31-
expectType<RawReplyDefaultExpression>(reply.raw);
30+
expectType<RawRequestDefaultExpression>(request.raw)
31+
expectType<RawReplyDefaultExpression>(reply.raw)
3232
},
3333
preValidation: (request, reply) => {
34-
expectType<RawRequestDefaultExpression>(request.raw);
35-
expectType<RawReplyDefaultExpression>(reply.raw);
34+
expectType<RawRequestDefaultExpression>(request.raw)
35+
expectType<RawReplyDefaultExpression>(reply.raw)
3636
},
3737
base: 'whatever',
3838
cacheURLs: 10,
@@ -56,41 +56,41 @@ app.register(fastifyHttpProxy, {
5656
websocket: true,
5757
wsUpstream: 'ws://origin.asd/connection',
5858
wsClientOptions: {
59-
queryString(search, reqUrl, request) {
60-
expectType<string | undefined>(search);
61-
expectType<string>(reqUrl);
62-
expectType<FastifyRequest<RequestGenericInterface, RawServerBase>>(request);
63-
return '';
59+
queryString (search, reqUrl, request) {
60+
expectType<string | undefined>(search)
61+
expectType<string>(reqUrl)
62+
expectType<FastifyRequest<RequestGenericInterface, RawServerBase>>(request)
63+
return ''
6464
},
6565
},
6666
internalRewriteLocationHeader: true,
67-
});
67+
})
6868

6969
expectError(
7070
app.register(fastifyHttpProxy, {
7171
thisOptionDoesNotExist: 'triggers a typescript error',
7272
})
73-
);
73+
)
7474

7575
expectError(
7676
app.register(fastifyHttpProxy, {
7777
upstream: 'http://origin.asd',
7878
wsUpstream: 'ws://origin.asd',
7979
})
80-
);
80+
)
8181

8282
expectError(
8383
app.register(fastifyHttpProxy, {
8484
upstream: 'http://origin.asd',
8585
websocket: false,
8686
wsUpstream: 'asdf',
8787
})
88-
);
88+
)
8989

9090
expectError(
9191
app.register(fastifyHttpProxy, {
9292
upstream: 'http://origin.asd',
9393
websocket: false,
9494
internalRewriteLocationHeader: 'NON_BOOLEAN_VALUE'
9595
})
96-
);
96+
)

0 commit comments

Comments
 (0)