Skip to content

🚨 add a lint rule to forbid declare global usage#3836

Merged
BenoitZugmeyer merged 1 commit into
mainfrom
benoit/push-mwmzmuvoswuz
Sep 12, 2025
Merged

🚨 add a lint rule to forbid declare global usage#3836
BenoitZugmeyer merged 1 commit into
mainfrom
benoit/push-mwmzmuvoswuz

Conversation

@BenoitZugmeyer

@BenoitZugmeyer BenoitZugmeyer commented Sep 12, 2025

Copy link
Copy Markdown
Member

Motivation

Types declared within a declare global block are leaking into the user codebase. Never do that.

Changes

Add a lint to forbid using declare global.

Test instructions

In a source file, add:

declare global {
  const toto: any
}

ESLint should show an error.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@BenoitZugmeyer
BenoitZugmeyer requested a review from a team as a code owner September 12, 2025 08:14
@datadog-datadog-prod-us1

Copy link
Copy Markdown

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 100.00%
Total Coverage: 92.29% (+0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 08b8c81 | Docs | Was this helpful? Give us feedback!

@cit-pr-commenter

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 157.25 KiB 157.25 KiB 0 B 0.00%
Rum Recorder 19.53 KiB 19.53 KiB 0 B 0.00%
Rum Profiler 5.18 KiB 5.18 KiB 0 B 0.00%
Logs 55.74 KiB 55.74 KiB 0 B 0.00%
Flagging N/A 931 B 931 B N/A%
Rum Slim 114.99 KiB 114.99 KiB 0 B 0.00%
Worker 23.60 KiB 23.60 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base Average Cpu Time (ms) Local Average Cpu Time (ms) 𝚫
addglobalcontext 0.005 0.008 0.003
addaction 0.019 0.018 -0.002
addtiming 0.006 0.005 -0.001
adderror 0.025 0.017 -0.008
startstopsessionreplayrecording 0.001 0.001 -0.000
startview 0.006 0.008 0.002
logmessage 0.029 0.019 -0.009
🧠 Memory Performance
Action Name Base Consumption Memory (bytes) Local Consumption Memory (bytes) 𝚫 (bytes)
addglobalcontext 25.19 KiB 25.50 KiB 320 B
addaction 44.59 KiB 46.05 KiB 1.46 KiB
addtiming 24.83 KiB 24.55 KiB -292 B
adderror 50.20 KiB 51.47 KiB 1.26 KiB
startstopsessionreplayrecording 24.18 KiB 23.79 KiB -408 B
startview 422.52 KiB 431.32 KiB 8.80 KiB
logmessage 41.24 KiB 42.95 KiB 1.72 KiB

🔗 RealWorld

@BenoitZugmeyer
BenoitZugmeyer merged commit 65691c2 into main Sep 12, 2025
21 checks passed
@BenoitZugmeyer
BenoitZugmeyer deleted the benoit/push-mwmzmuvoswuz branch September 12, 2025 10:32
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.

3 participants