Cursor rule
.cursor/rules/strict-web-compat-and-telemetry.mdcSubagent 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 blocksRepository
70
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.123456789# Strict TypeScript: Web Compat & Telemetry1011## Task1213Fix all strict-mode TypeScript errors in 2 files and add them to `CORE_FILES`.1415## Branch1617```18git checkout main && git pull origin main && git checkout -b cursor/strict/web-compat-and-telemetry19```2021## Files (69 errors total)2223### `injected/src/features/web-compat.js` (58 errors)2425**Error breakdown by category:**26271. **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)29302. **TS2339 — Property not on type** (~10 errors):31 `name`, `supportedPermissions` on Object (lines 551-557); `title`, `artist`, `album`, `artwork` on `{}` (lines 886-889)32333. **TS7053 — No index signature** (~5 errors):34 String index on `ShareRequestData` (line 90), `{}` (lines 459, 461), viewport config (line 1146)35364. **TS7017 — globalThis no index signature** (4 errors):37 Lines 1010, 1015, 1042, 104338395. **TS18046/TS18048 — Unknown/undefined** (3 errors):40 `err` unknown (lines 233, 748), `key` possibly undefined (line 1152)41426. **TS2345 — Argument not assignable** (4 errors):43 `string | undefined` → `string` (lines 528, 1137); `HTMLMetaElement | null | undefined` → `HTMLMetaElement | null` (lines 1097, 1100, 1156)44457. **TS7034/TS7005 — Variable implicitly any** (2 errors):46 `newContent` (lines 1144, 1156)47488. **TS7008 — Member implicitly any** (1 error):49 `onchange` (line 67)50519. **TS2314 — Generic requires type args** (2 errors):52 `Promise` without type arg (lines 1226, 1228)535410. **TS2322 — Type not assignable** (2 errors):55 viewport array type (line 1089); wrapMethod proxy type (line 1250)565711. **TS2532 — Possibly undefined** (1 error): line 11535859### `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```7374## Fix Patterns7576- **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.8586## Workflow87881. `npm ci`892. Add both files to CORE_FILES in `scripts/check-strict-core.js`903. Fix each file's errors914. `npm run tsc-strict-core` — must pass925. `npm run test-unit` — must pass936. `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`9697## Constraints9899- Do NOT use `any` — use `unknown`, specific types, or proper interfaces100- 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 entries103- Preserve existing behavior — type fixes only, no logic changes104
Also in duckduckgo/content-scope-scripts
Diff this repo’s formatsOne 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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| duckduckgo/content-scope-scriptstypes-generator/AGENTS.md · 70 | AGENTS.md | testarchtypesdo-not | 73/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-broker-protection-actions.mdc · 70 | Cursor rules | buildteststyletypes+4 | 93/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-broker-protection-rest.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-click-to-load.mdc · 70 | Cursor rules | teststyletypesgit+2 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-detectors.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer-native.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-duckplayer.mdc · 70 | Cursor rules | setupteststyletypes+4 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-fingerprinting.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-message-bridge.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-a.mdc · 70 | Cursor rules | teststyletypesgit+4 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-b.mdc · 70 | Cursor rules | teststyletypesgit+3 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-standalone-features-c.mdc · 70 | Cursor rules | teststyletypesgit+4 | 89/100 | 3 days ago | |
| duckduckgo/content-scope-scripts.cursor/rules/strict-zero-errors-batch.mdc · 70 | Cursor rules | testtypesgitdo-not+1 | 81/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsAGENTS.md · 70 | AGENTS.md | buildtestlint-formatstyle+5 | 83/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsinjected/AGENTS.md · 70 | AGENTS.md | buildteststylearch+2 | 92/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsmessaging/AGENTS.md · 70 | AGENTS.md | testarchtesting-strategyapi | 66/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 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.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
