Define custom lint rule to assert that each CLI command lists examples#67
Merged
andrewjensen merged 3 commits intomainfrom May 6, 2026
Merged
Define custom lint rule to assert that each CLI command lists examples#67andrewjensen merged 3 commits intomainfrom
andrewjensen merged 3 commits intomainfrom
Conversation
andrewjensen
commented
May 6, 2026
Collaborator
Author
There was a problem hiding this comment.
ESLint has its own little test helper with RuleTester, so this is basically just a shim to connect it with our main vitest suite.
See the custom rule tutorial: Step 6: write the test
emmahoggan
approved these changes
May 6, 2026
Contributor
emmahoggan
left a comment
There was a problem hiding this comment.
Love this - pits of success 🔥
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.
This defines a custom ESLint rule called
require-cli-examples, to assert that each "leaf node" command includes examples in its help output.This means that any command that has an
action()must also call:This rule helps us guarantee good UX for users that need more information about a command.
The rule caught missing examples in the following commands, so this PR also defines examples for them:
dx auth logindx auth logoutdx auth statusdx init