types.ts: LoopCliConfig.maxPrompts docstring claims 'null/undefined' is unlimited, but the type only permits 'undefined'
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- documentation
Research direction
Open src/types.ts around line 86 and compare the maxPrompts JSDoc with its optional number type. Check schema/loop-the-loop.schema.json to confirm the field is a non-nullable integer. Done means the documentation matches the supported type and schema, with the relevant TypeScript checks or tests passing.
Written by the indexing model from the issue text.
Description
Observed behavior
The docstring on LoopCliConfig.maxPrompts in src/types.ts reads:
/**
* Maximum number of prompts to process. Unlimited when null/undefined.
*/
readonly maxPrompts?: number;
The doc says the field is unlimited when set to null or undefined. But the field's TypeScript type is number | undefined (optional number), so a strict TypeScript caller cannot legally pass null. The implementation in loop.ts does coalesce with ?? Infinity, which would accept null at runtime, but the type contract forbids it.
This is a small TS/JS hazard: a JavaScript caller reading the JSDoc might set maxPrompts: null and have it work; a TypeScript caller doing the same will see a compile error and assume the JSDoc is wrong.
Expected behavior
Either:
- The docstring should drop the mention of
nulland read "Unlimited when omitted" (matching the JSON schema inschema/loop-the-loop.schema.json, which also requires an integer); or - The type should be widened to
number | null | undefinedifnullis genuinely supported.
Option 1 matches existing intent (the JSON schema requires integer >= 0, not nullable).
Minimal reproduction
Open src/types.ts at line 86 and compare the JSDoc with the field type immediately below it. Also note that schema/loop-the-loop.schema.json declares maxPrompts as a non-nullable integer.
Suggested fix
Change the docstring to "Maximum number of prompts to process. Unlimited when omitted."
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from joewalker/loop-the-loop
-
bug S4
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
joewalker/loop-the-loop#88 ·
-
Git exec(): child killed by a signal rejects with new Error('') and loses the signal information Openbug S3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
joewalker/loop-the-loop#84 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
joewalker/loop-the-loop#83 ·
-
bug S3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
joewalker/loop-the-loop#82 ·
-
bug S4
Difficulty 1/5 Under an hour Newbie friendliness 92/100
joewalker/loop-the-loop#78 ·
All issues in joewalker/loop-the-loop
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100