Add Recurse ML rules for naming and code patterns #780
+47
−0
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.
This PR adds two custom Recurse ML rules to enforce naming and usage patterns
.github/recurseml-rules/naming.mdc:
snake_case
for anything that goes over HTTP in REST APIs,camelCase
for JavaScript elsewherecaptureError
's first argument should be a machine-readable ID without whitespaces (e.g.,'user-sign-up-email'
not'Email failed to send'
).github/recurseml-rules/code_patterns.mdc:
void asyncFunction()
orasyncFunction().catch(console.error)
- userunAsynchronously(asyncFunction)
insteadparseJson
/stringifyJson
fromstack-shared/utils/json
instead ofJSON.parse
/JSON.stringify
waitUntil
, userunAsynchronously(promise, { promiseCallback: waitUntil })
/users/${userId}
?? throwErr("message", { extraData })
patternImportant
Add Recurse ML rules for naming conventions and code patterns in JavaScript/TypeScript.
rules: .github/recurseml-rules/
to.github/.recurseml.yaml
.naming.mdc
):snake_case
for REST API HTTP elements,camelCase
for JavaScript.captureError
IDs must be machine-readable without spaces.code_patterns.mdc
):runAsynchronously
instead ofvoid asyncFunction()
or.catch(console.error)
.parseJson
/stringifyJson
fromstack-shared/utils/json
.runAsynchronously
withpromiseCallback
for VercelwaitUntil
.?? throwErr
pattern.This description was created by
for 9dd35ab. You can customize this summary. It will automatically update as commits are pushed.