Closed Bug 2089817 Opened 25 days ago Closed 4 days ago

Add a mach ts command to measure how much of each module its JSDoc types

Categories

(Developer Infrastructure :: Linting and Formatting: JavaScript, enhancement)

enhancement

Tracking

(firefox163 fixed)

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

With noImplicitAny off, a parameter without a JSDoc type is silently any, so a low tsc error count can mean little of the code is checked. Before enabling TypeScript for a directory, or quoting its error count, it helps to know how much of each module its JSDoc types.

./mach ts coverage <path>… prints, for each .js or .mjs module directly in a directory (or each file given), how many functions have a JSDoc comment and how many parameters tsc can type, with totals; --list names each function with an untyped parameter. It moves the typescript-rollout agent skill's bundled script (bug 2089016) into tools/ts, beside ./mach ts summary (bug 2089610), and enabling.md names it where it explains what a low error count can hide.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Component: Lint and Formatting → Linting and Formatting: JavaScript
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f302777fde80 https://hg.mozilla.org/integration/autoland/rev/ba1f863d658e Add mach ts coverage to measure how much of each module its JSDoc types. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: