Skip to content

chore: update shared eslint config to a stable version #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/before-beta-release.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const { execSync } = require('node:child_process');
const fs = require('node:fs');
const path = require('node:path');

const PKG_JSON_PATH = path.join(__dirname, '..', '..', 'package.json');

Expand All @@ -11,7 +11,7 @@
const VERSION = pkgJson.version;

const nextVersion = getNextVersion(VERSION);
console.log(`before-deploy: Setting version to ${nextVersion}`);

Check warning on line 14 in .github/scripts/before-beta-release.js

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
pkgJson.version = nextVersion;

fs.writeFileSync(PKG_JSON_PATH, `${JSON.stringify(pkgJson, null, 2)}\n`);
Expand All @@ -21,7 +21,7 @@
const versions = JSON.parse(versionString);

if (versions.some((v) => v === VERSION)) {
console.error(`before-deploy: A release with version ${VERSION} already exists. Please increment version accordingly.`);

Check warning on line 24 in .github/scripts/before-beta-release.js

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
process.exit(1);
}

Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import apify from '@apify/eslint-config';
import apifyTypescriptConfig from '@apify/eslint-config/ts.js';

// eslint-disable-next-line import/no-default-export
export default [
{ ignores: ['**/dist', 'test'] }, // Ignores need to happen first
...apify,
...apifyTypescriptConfig,
{
languageOptions: {
sourceType: 'module',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxy-chain",
"version": "2.5.7",
"version": "2.5.8",
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.",
"main": "dist/index.js",
"keywords": [
Expand Down Expand Up @@ -44,7 +44,7 @@
"node": ">=14"
},
"devDependencies": {
"@apify/eslint-config": "^0.5.0-beta.2",
"@apify/eslint-config": "^1.0.0",
"@apify/tsconfig": "^0.1.0",
"@types/jest": "^28.1.2",
"@types/node": "^18.8.3",
Expand Down
8 changes: 4 additions & 4 deletions src/anonymize_proxy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Buffer } from 'buffer';
import type http from 'http';
import type net from 'net';
import { URL } from 'url';
import type { Buffer } from 'node:buffer';
import type http from 'node:http';
import type net from 'node:net';
import { URL } from 'node:url';

import { Server, SOCKS_PROTOCOLS } from './server';
import { nodeify } from './utils/nodeify';
Expand Down
12 changes: 6 additions & 6 deletions src/chain.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Buffer } from 'buffer';
import type dns from 'dns';
import type { EventEmitter } from 'events';
import http from 'http';
import https from 'https';
import type { URL } from 'url';
import type { Buffer } from 'node:buffer';
import type dns from 'node:dns';
import type { EventEmitter } from 'node:events';
import http from 'node:http';
import https from 'node:https';
import type { URL } from 'node:url';

import type { Socket } from './socket';
import { badGatewayStatusCodes, createCustomStatusHttpResponse, errorCodeToStatusCode } from './statuses';
Expand Down
12 changes: 6 additions & 6 deletions src/chain_socks.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Buffer } from 'buffer';
import type { EventEmitter } from 'events';
import type http from 'http';
import type net from 'net';
import { URL } from 'url';
import type { Buffer } from 'node:buffer';
import type { EventEmitter } from 'node:events';
import type http from 'node:http';
import type net from 'node:net';
import { URL } from 'node:url';

import { type SocksClientError, SocksClient, type SocksProxy } from 'socks';
import { SocksClient, type SocksClientError, type SocksProxy } from 'socks';

import type { Socket } from './socket';
import { createCustomStatusHttpResponse, socksErrorMessageToStatusCode } from './statuses';
Expand Down
6 changes: 3 additions & 3 deletions src/custom_connect.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type http from 'http';
import type net from 'net';
import { promisify } from 'util';
import type http from 'node:http';
import type net from 'node:net';
import { promisify } from 'node:util';

export const customConnect = async (socket: net.Socket, server: http.Server): Promise<void> => {
// `countTargetBytes(socket, socket)` is incorrect here since `socket` is not a target.
Expand Down
4 changes: 2 additions & 2 deletions src/custom_response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Buffer } from 'buffer';
import type http from 'http';
import type { Buffer } from 'node:buffer';
import type http from 'node:http';

export interface CustomResponse {
statusCode?: number;
Expand Down
10 changes: 5 additions & 5 deletions src/direct.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Buffer } from 'buffer';
import type dns from 'dns';
import type { EventEmitter } from 'events';
import net from 'net';
import { URL } from 'url';
import type { Buffer } from 'node:buffer';
import type dns from 'node:dns';
import type { EventEmitter } from 'node:events';
import net from 'node:net';
import { URL } from 'node:url';

import type { Socket } from './socket';
import { countTargetBytes } from './utils/count_target_bytes';
Expand Down
12 changes: 6 additions & 6 deletions src/forward.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type dns from 'dns';
import http from 'http';
import https from 'https';
import stream from 'stream';
import type { URL } from 'url';
import util from 'util';
import type dns from 'node:dns';
import http from 'node:http';
import https from 'node:https';
import stream from 'node:stream';
import type { URL } from 'node:url';
import util from 'node:util';

import { badGatewayStatusCodes, errorCodeToStatusCode } from './statuses';
import type { SocketWithPreviousStats } from './utils/count_target_bytes';
Expand Down
8 changes: 4 additions & 4 deletions src/forward_socks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import http from 'http';
import stream from 'stream';
import type { URL } from 'url';
import util from 'util';
import http from 'node:http';
import stream from 'node:stream';
import type { URL } from 'node:url';
import util from 'node:util';

import { SocksProxyAgent } from 'socks-proxy-agent';

Expand Down
14 changes: 7 additions & 7 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable no-use-before-define */
import { Buffer } from 'buffer';
import type dns from 'dns';
import { EventEmitter } from 'events';
import http from 'http';
import type net from 'net';
import { URL } from 'url';
import util from 'util';
import { Buffer } from 'node:buffer';
import type dns from 'node:dns';
import { EventEmitter } from 'node:events';
import http from 'node:http';
import type net from 'node:net';
import { URL } from 'node:url';
import util from 'node:util';

import type { HandlerOpts as ChainOpts } from './chain';
import { chain } from './chain';
Expand Down
4 changes: 2 additions & 2 deletions src/socket.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type net from 'net';
import type tls from 'tls';
import type net from 'node:net';
import type tls from 'node:tls';

type AdditionalProps = { proxyChainId?: number };

Expand Down
2 changes: 1 addition & 1 deletion src/statuses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { STATUS_CODES } from 'http';
import { STATUS_CODES } from 'node:http';

type HttpStatusCode = number;

Expand Down
4 changes: 2 additions & 2 deletions src/tcp_tunnel_tools.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import net from 'net';
import { URL } from 'url';
import net from 'node:net';
import { URL } from 'node:url';

import { chain } from './chain';
import { nodeify } from './utils/nodeify';
Expand Down Expand Up @@ -44,7 +44,7 @@
const server: net.Server & { log?: (...args: unknown[]) => void } = net.createServer();

const log = (...args: unknown[]): void => {
if (verbose) console.log(...args);

Check warning on line 47 in src/tcp_tunnel_tools.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
};

server.log = log;
Expand Down
3 changes: 2 additions & 1 deletion src/utils/count_target_bytes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type net from 'net';
import type net from 'node:net';

const targetBytesWritten = Symbol('targetBytesWritten');
const targetBytesRead = Symbol('targetBytesRead');
Expand All @@ -21,6 +21,7 @@ interface Extras {
}

// @ts-expect-error TS is not aware that `source` is used in the assertion.
// eslint-disable-next-line @typescript-eslint/no-empty-function
function typeSocket(source: unknown): asserts source is net.Socket & Extras {}

export const countTargetBytes = (
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get_basic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { URL } from 'url';
import type { URL } from 'node:url';

import { decodeURIComponentSafe } from './decode_uri_component_safe';

Expand Down
2 changes: 1 addition & 1 deletion src/utils/normalize_url_port.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { URL } from 'url';
import type { URL } from 'node:url';

// https://url.spec.whatwg.org/#default-port
const mapping = {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/parse_authorization_header.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from 'buffer';
import { Buffer } from 'node:buffer';

const splitAt = (string: string, index: number) => {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/utils/redact_url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { URL } from 'url';
import { URL } from 'node:url';

export const redactUrl = (url: string | URL, passwordReplacement = '<redacted>'): string => {
if (typeof url !== 'object') {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/valid_headers_only.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { validateHeaderName, validateHeaderValue } from 'http';
import { validateHeaderName, validateHeaderValue } from 'node:http';

import { isHopByHopHeader } from './is_hop_by_hop_header';

Expand Down
Loading