RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/duckduckgo/content-scope-scripts

Cursor rule

.cursor/rules/strict-web-compat-and-telemetry.mdc

Subagent task: Fix strict TypeScript errors in web-compat and web-telemetry files and add to CORE_FILES

Cursor rules

Quality

89/100

Scores the file, not the repository.

Length

576 words

9 headings · 2 code blocks

Repository

70

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
duckduckgo/content-scope-scripts/.cursor/rules/strict-web-compat-and-telemetry.mdcRawGitHub
1---
2description: "Subagent task: Fix strict TypeScript errors in web-compat and web-telemetry files and add to CORE_FILES"
3globs:
4 - "scripts/check-strict-core.js"
5 - "injected/src/features/web-compat.js"
6 - "injected/src/features/web-telemetry.js"
7---
8 
9# Strict TypeScript: Web Compat & Telemetry
10 
11## Task
12 
13Fix all strict-mode TypeScript errors in 2 files and add them to `CORE_FILES`.
14 
15## Branch
16 
17```
18git checkout main && git pull origin main && git checkout -b cursor/strict/web-compat-and-telemetry
19```
20 
21## Files (69 errors total)
22 
23### `injected/src/features/web-compat.js` (58 errors)
24 
25**Error breakdown by category:**
26 
271. **TS7006 — Parameter implicitly any** (~25 errors):
28 Lines: 28, 63(x2), 74(x3), 84, 218, 328(x2), 329(x2), 330(x2), 454, 505, 622, 656, 665, 726, 842(x4)
29 
302. **TS2339 — Property not on type** (~10 errors):
31 `name`, `supportedPermissions` on Object (lines 551-557); `title`, `artist`, `album`, `artwork` on `{}` (lines 886-889)
32 
333. **TS7053 — No index signature** (~5 errors):
34 String index on `ShareRequestData` (line 90), `{}` (lines 459, 461), viewport config (line 1146)
35 
364. **TS7017 — globalThis no index signature** (4 errors):
37 Lines 1010, 1015, 1042, 1043
38 
395. **TS18046/TS18048 — Unknown/undefined** (3 errors):
40 `err` unknown (lines 233, 748), `key` possibly undefined (line 1152)
41 
426. **TS2345 — Argument not assignable** (4 errors):
43 `string | undefined` → `string` (lines 528, 1137); `HTMLMetaElement | null | undefined` → `HTMLMetaElement | null` (lines 1097, 1100, 1156)
44 
457. **TS7034/TS7005 — Variable implicitly any** (2 errors):
46 `newContent` (lines 1144, 1156)
47 
488. **TS7008 — Member implicitly any** (1 error):
49 `onchange` (line 67)
50 
519. **TS2314 — Generic requires type args** (2 errors):
52 `Promise` without type arg (lines 1226, 1228)
53 
5410. **TS2322 — Type not assignable** (2 errors):
55 viewport array type (line 1089); wrapMethod proxy type (line 1250)
56 
5711. **TS2532 — Possibly undefined** (1 error): line 1153
58 
59### `injected/src/features/web-telemetry.js` (11 errors)
60```
61(13,17): error TS7006: Parameter 'featureName' implicitly has an 'any' type.
62(13,30): error TS7006: Parameter 'importConfig' implicitly has an 'any' type.
63(13,44): error TS7006: Parameter 'features' implicitly has an 'any' type.
64(13,54): error TS7006: Parameter 'args' implicitly has an 'any' type.
65(34,17): error TS7006: Parameter 'video' implicitly has an 'any' type.
66(60,27): error TS7006: Parameter 'video' implicitly has an 'any' type.
67(76,21): error TS7006: Parameter 'video' implicitly has an 'any' type.
68(84,29): error TS7006: Parameter 'node' implicitly has an 'any' type.
69(89,25): error TS7006: Parameter 'video' implicitly has an 'any' type.
70(121,35): error TS7006: Parameter 'mutationsList' implicitly has an 'any' type.
71(124,50): error TS7006: Parameter 'node' implicitly has an 'any' type.
72```
73 
74## Fix Patterns
75 
76- **TS7006**: Add `@param {Type}` JSDoc. For constructor params (`featureName`, `importConfig`, `features`, `args`), look at the parent class signature.
77- **TS2339 on Object**: Define `@typedef` for the config shapes (permissions, media metadata).
78- **TS7017 (globalThis)**: Use `/** @type {Record<string, unknown>} */ (globalThis)` access pattern.
79- **TS7053**: Use `Record<string, X>` cast or narrow the key type.
80- **TS18046**: `instanceof Error` check or `String(err)`.
81- **TS18048**: Null/undefined guard.
82- **TS2345**: Add undefined guards or non-null assertions where value is guaranteed.
83- **TS2314**: Add type parameter: `Promise<void>`.
84- **TS7008**: Add `/** @type {Function|null} */` or appropriate type to class member.
85 
86## Workflow
87 
881. `npm ci`
892. Add both files to CORE_FILES in `scripts/check-strict-core.js`
903. Fix each file's errors
914. `npm run tsc-strict-core` — must pass
925. `npm run test-unit` — must pass
936. `npm run lint` — must pass (run `npm run lint-fix` first if needed)
947. Commit: `fix(types): add strict checking for web-compat and web-telemetry files`
958. `git push -u origin cursor/strict/web-compat-and-telemetry`
96 
97## Constraints
98 
99- Do NOT use `any` — use `unknown`, specific types, or proper interfaces
100- Do NOT use `@ts-ignore` or `@ts-expect-error`
101- Do NOT modify files outside the assigned list (except `scripts/check-strict-core.js`)
102- Do NOT remove existing CORE_FILES entries
103- Preserve existing behavior — type fixes only, no logic changes
104 

Commands it names

  • git checkout main && git pull origin main && git checkout -b cursor/strict/web-compat-and-telemetry
  • npm ci
  • npm run tsc-strict-core
  • npm run test-unit
  • npm run lint
  • npm run lint-fix
  • git push -u origin cursor/strict/web-compat-and-telemetry

Sections

  • Strict TypeScript: Web Compat & Telemetry
  • Task
  • Branch
  • Files (69 errors total)
  • `injected/src/features/web-compat.js` (58 errors)
  • `injected/src/features/web-telemetry.js` (11 errors)
  • Fix Patterns
  • Workflow
  • Constraints

What it covers

testcode-styletypesgit-prdo-notagent-behaviourdocs

Stack — with the evidence

typescript

(1.00)

javascript

(1.00)

node

(1.00)

eslint

(1.00)

playwright

(0.70)

swift

(0.60)

github-actions

(0.60)

Glob targeting

  • scripts/check-strict-core.js
  • injected/src/features/web-compat.js
  • injected/src/features/web-telemetry.js

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
duckduckgo
Language
—
License
—
Archived
no

All configs in this repo

Also in duckduckgo/content-scope-scripts

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
duckduckgo/content-scope-scriptstypes-generator/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5testarchtypesdo-not73/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-broker-protection-actions.mdc · 70Cursor rulestypescriptjavascript+5buildteststyletypes+493/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-broker-protection-rest.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-click-to-load.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+289/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-detectors.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer-native.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer.mdc · 70Cursor rulestypescriptjavascript+5setupteststyletypes+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-fingerprinting.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-message-bridge.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-a.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-b.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+389/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-c.mdc · 70Cursor rulestypescriptjavascript+5teststyletypesgit+489/1003 days ago
duckduckgo/content-scope-scripts.cursor/rules/strict-zero-errors-batch.mdc · 70Cursor rulestypescriptjavascript+5testtypesgitdo-not+181/1003 days ago
duckduckgo/content-scope-scriptsAGENTS.md · 70AGENTS.mdtypescriptjavascript+6buildtestlint-formatstyle+583/1003 days ago
duckduckgo/content-scope-scriptsinjected/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+292/1003 days ago
duckduckgo/content-scope-scriptsmessaging/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5testarchtesting-strategyapi66/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
Diff against types-generator/AGENTS.md Diff against .cursor/rules/strict-broker-protection-actions.mdc Diff against .cursor/rules/strict-broker-protection-rest.mdc Diff against .cursor/rules/strict-click-to-load.mdc Diff against .cursor/rules/strict-detectors.mdc Diff against .cursor/rules/strict-duckplayer-native.mdc Diff against .cursor/rules/strict-duckplayer.mdc Diff against .cursor/rules/strict-fingerprinting.mdc Diff against .cursor/rules/strict-message-bridge.mdc Diff against .cursor/rules/strict-standalone-features-a.mdc Diff against .cursor/rules/strict-standalone-features-b.mdc Diff against .cursor/rules/strict-standalone-features-c.mdc Diff against .cursor/rules/strict-zero-errors-batch.mdc Diff against AGENTS.md Diff against injected/AGENTS.md Diff against messaging/AGENTS.md Diff against special-pages/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack