Skip to content

Commit

Permalink
Restrict use of global URL in certain packages (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 8, 2023
1 parent dd3b98f commit 523b74c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/fuzzy-walls-shake.md
@@ -0,0 +1,2 @@
---
---
12 changes: 12 additions & 0 deletions .eslintrc.js
Expand Up @@ -13,4 +13,16 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
overrides: [
{
files: ['packages/{pac-proxy,proxy,socks-proxy}-agent/**/*'],
rules: {
'no-restricted-globals': [
'error',
// https://github.com/TooTallNate/proxy-agents/pull/242
{ name: 'URL', message: 'Use url.URL instead' },
],
},
},
],
};
1 change: 1 addition & 0 deletions packages/proxy-agent/test/test.ts
@@ -1,6 +1,7 @@
import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';
import { URL } from 'url';
import { once } from 'events';
import assert from 'assert';
import WebSocket, { WebSocketServer } from 'ws';
Expand Down
1 change: 1 addition & 0 deletions packages/socks-proxy-agent/test/test.ts
Expand Up @@ -3,6 +3,7 @@ import * as https from 'https';
import * as http from 'http';
import * as path from 'path';
import * as fs from 'fs';
import { URL } from 'url';
import dns2 from 'dns2';
// @ts-expect-error no types
import socks from 'socksv5';
Expand Down

1 comment on commit 523b74c

@vercel
Copy link

@vercel vercel bot commented on 523b74c Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.