Skip to content

feat: add prefer-global/crypto rule#514

Merged
aladdin-add merged 2 commits intoeslint-community:masterfrom
Pixel998:feat/prefer-global-crypto
Feb 15, 2026
Merged

feat: add prefer-global/crypto rule#514
aladdin-add merged 2 commits intoeslint-community:masterfrom
Pixel998:feat/prefer-global-crypto

Conversation

@Pixel998
Copy link

What is the purpose of this pull request?

This PR adds the prefer-global/crypto rule. This rule enforces the use of the global crypto variable (which implements the Web Crypto API) instead of importing it via require("crypto").webcrypto or require("crypto").webcrypto.

What changes did you make? (Give an overview)

  • Implemented prefer-global/crypto rule
  • Added Documentation
  • Added tests

Related Issues

Closes #490

Is there anything you'd like reviewers to focus on?

Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@aladdin-add aladdin-add merged commit 2ea0f22 into eslint-community:master Feb 15, 2026
29 checks passed
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.

New Rule: prefer-global/crypto

2 participants

Comments