Repository navigation
docs(modifiers): document attachModifier and unlockrequest - #108
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A custom-modifier author calling
attachModifierorunlockrequestsaw bare parameter types. #71 changed what both take, and the contract it settled lived only in that PR's body. This PR puts that contract in TSDoc on both functions and makes the "Create custom modifiers" docs page agree with it. #48 is closed, so the TSDoc describes the signatures onmain.What
attachModifierTSDoc gives each parameter, what TypeScript checks (optionsonly, not thatfieldnames a member), what happens at run time (accessor for a modifier withlock, event handlers for every other method), and both throws:constructoror__proto__, and a modifier withlockstacked on a field that already has a one-way modifier.unlockrequestTSDoc gives each parameter, thattableis read only for its modifier metadata, what the expression yields for one-way and unmodified fields, and that it throws aTypeErrorwhenmodifiershas no entry for a two-way modifier on the field.docs/3.table-modifiers.mdgains "Attach a modifier" and "Read a modified field in a query", which state the same contract.No code changes. The skill file already states the stacking rule and needs no edit.
Proof
Runtime probe against the built
dist/modifiers/common.js, checking each throw and pass case the TSDoc names:Documentation check (
tooling-configsv0.0.9):pnpm run checks:antelopejs-comment-proof origin/main:Comment proof: 2 packages, 37 entries unchanged against origin/main (committed HEAD).
Suppressions in authored code files (origin/main and committed HEAD). A lint directive counts once per rule it names;
*is a directive naming none.anti-slop/no-unknown-parametersanti-slop/no-unknown-returnsanti-slop/no-unsafe-dictionary-typetypescript/no-unnecessary-type-parameterstypescript/no-unsafe-assignmenttypescript/no-unsafe-return@ts-expect-error@ts-ignoreSAFETY:comments