feat: eslint rule to prefer node protocols (#1187)

This commit is contained in:
Matt 2025-11-28 11:37:25 +00:00 • committed by GitHub
commit cca6ba05b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 195 additions and 21 deletions

View file

@ -1,5 +1,5 @@
import { createServer, ServerResponse, type IncomingMessage, type Server } from 'http';
import { AddressInfo } from 'net';
import { createServer, ServerResponse, type IncomingMessage, type Server } from 'node:http';
import { AddressInfo } from 'node:net';
import { JSONRPCMessage } from '../types.js';
import { SSEClientTransport } from './sse.js';
import { OAuthClientProvider, UnauthorizedError } from './auth.js';

View file

@ -7,7 +7,7 @@
import { Task, Request, RequestId, Result } from '../../../types.js';
import { TaskStore, isTerminal, TaskMessageQueue, QueuedMessage, CreateTaskOptions } from '../interfaces.js';
import { randomBytes } from 'crypto';
import { randomBytes } from 'node:crypto';
interface StoredTask {
task: Task;

View file

@ -1,4 +1,4 @@
import http from 'http';
import http from 'node:http';
import { type Mocked } from 'vitest';
import { SSEServerTransport } from './sse.js';

View file

@ -5,7 +5,7 @@ import { JSONRPCMessage, JSONRPCMessageSchema, MessageExtraInfo, RequestInfo } f
import getRawBody from 'raw-body';
import contentType from 'content-type';
import { AuthInfo } from './auth/types.js';
import { URL } from 'url';
import { URL } from 'node:url';
const MAXIMUM_MESSAGE_SIZE = '4mb';