Skip to content
Back to snapcart-api report
Code QualityMedium

Disabled Lint Rule on Bundle-Critical File

src/analytics/track.ts:12

What's going on

eslint-disable blocks three warnings in the analytics script, including a no-unused-vars condition hiding what looks like a dead branch.

Why it matters

Disabling rules without a deliberate review cadence hides the exact errors static analysis is meant to catch.

src/analytics/track.ts:12

Recommended Fix

Replace the inline query with a parameterized statement and validate the id before it ever reaches the database. A regression test is generated alongside the patch.

Before
1// eslint-disable-next-line @typescript-eslint/no-unused-vars2const flag = computeFlag(config); // appears unused
After
1const flag = computeFlag(config);2void flag; // intentionally kept for side effect
  1. Uploaddone
  2. Analyzedone
  3. Finddone
  4. Explainactive
  5. Fixupcoming
  6. Testupcoming
  7. Verifyupcoming