Skip to content

feat(config): add --ignore-proxy flag#9752

Open
hemanth wants to merge 2 commits into
npm:latestfrom
hemanth:feat/ignore-proxy
Open

feat(config): add --ignore-proxy flag#9752
hemanth wants to merge 2 commits into
npm:latestfrom
hemanth:feat/ignore-proxy

Conversation

@hemanth

@hemanth hemanth commented Jul 12, 2026

Copy link
Copy Markdown

What?

Add an ignore-proxy boolean config that, when set to true, nullifies proxy and https-proxy settings.

Why?

Closes #380. Users with a proxy configured globally (e.g., corporate .npmrc or environment variables) currently have no simple way to bypass it for specific operations. They must manually unset both proxy and https-proxy, which is error-prone and inconvenient.

Approach

  • Added a new ignore-proxy Definition (default: false, type: Boolean) in the config definitions.
  • Rather than giving ignore-proxy its own flatten, the existing proxy and https-proxy flatten functions were modified to check obj["ignore-proxy"] and return null when it is truthy. This keeps the nullification co-located with the settings it affects.

Verification

  • Unit tests added in workspaces/config/test/definitions/definitions.js:
    • https-proxy flattens to null when ignore-proxy is true
    • https-proxy passes through when ignore-proxy is false
    • proxy flattens to null when ignore-proxy is true
    • proxy passes through when ignore-proxy is false
  • All affected snapshots regenerated and passing (docs, config list, type-description).
  • Full config workspace test suite passes with lint clean.

hemanth added 2 commits July 11, 2026 22:13
When set, ignores proxy and https-proxy settings, allowing
direct connections without going through any configured proxy.

Closes: npm/rfcs#380
Add unit tests verifying that the ignore-proxy config correctly
nullifies both proxy and https-proxy flatten values when set to true,
and preserves them when false. Regenerate all affected snapshots.
@hemanth
hemanth requested review from a team as code owners July 12, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPM will skip over transitive dependencies that point to non-github URLs.

1 participant