Skip to content

Commit 523b74c

Browse files
authored
Restrict use of global URL in certain packages (#246)
1 parent dd3b98f commit 523b74c

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

.changeset/fuzzy-walls-shake.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,16 @@ module.exports = {
1313
'plugin:@typescript-eslint/eslint-recommended',
1414
'plugin:@typescript-eslint/recommended',
1515
],
16+
overrides: [
17+
{
18+
files: ['packages/{pac-proxy,proxy,socks-proxy}-agent/**/*'],
19+
rules: {
20+
'no-restricted-globals': [
21+
'error',
22+
// https://github.com/TooTallNate/proxy-agents/pull/242
23+
{ name: 'URL', message: 'Use url.URL instead' },
24+
],
25+
},
26+
},
27+
],
1628
};

packages/proxy-agent/test/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as fs from 'fs';
22
import * as http from 'http';
33
import * as https from 'https';
4+
import { URL } from 'url';
45
import { once } from 'events';
56
import assert from 'assert';
67
import WebSocket, { WebSocketServer } from 'ws';

packages/socks-proxy-agent/test/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as https from 'https';
33
import * as http from 'http';
44
import * as path from 'path';
55
import * as fs from 'fs';
6+
import { URL } from 'url';
67
import dns2 from 'dns2';
78
// @ts-expect-error no types
89
import socks from 'socksv5';

0 commit comments

Comments
 (0)