Skip to content

Commit

Permalink
rules: npm and yarn subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
iffse committed Sep 24, 2024
1 parent 3bd7126 commit 4169493
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pay-respects"
version = "0.4.14"
version = "0.4.15"
edition = "2021"

# for crates.io
Expand Down
79 changes: 79 additions & 0 deletions rules/npm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
command = "npm"

[[match_err]]
pattern = [
"unknown command"
]
suggest = [
'''
{{command[0]}}
{{typo[1](
access,
adduser,
audit,
bugs,
cache,
ci,
completion,
config,
dedupe,
deprecate,
diff,
dist-tag,
docs,
doctor,
edit,
exec,
explain,
explore,
find-dupes,
fund,
get,
help,
help-search,
hook,
init,
install,
install-ci-test,
install-test,
link,
ll,
login,
logout,
ls,
org,
outdated,
owner,
pack,
ping,
pkg,
prefix,
profile,
prune,
publish,
query,
rebuild,
repo,
restart,
root,
run-script,
sbom,
search,
set,
shrinkwrap,
star,
stars,
start,
stop,
team,
test,
token,
uninstall,
unpublish,
unstar,
update,
version,
view,
whoami
)}} {{command[2:]}} '''
]
53 changes: 53 additions & 0 deletions rules/yarn.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
command = "yarn"

[[match_err]]
pattern = [
"not found"
]
suggest = [
'''
#[err_contains(command)]
{{command[0]}}
{{typo[1](
access,
add,
audit,
autoclean,
bin,
cache,
check,
config,
create,
exec,
generate-lock-entry / generateLockEntry,
global,
help,
import,
info,
init,
install,
licenses,
link,
list,
login,
logout,
node,
outdated,
owner,
pack,
policies,
publish,
remove,
run,
tag,
team,
unlink,
unplug,
upgrade,
upgrade-interactive / upgradeInteractive,
version,
versions,
why,
workspace,
workspaces
)}} {{command[2:]}} '''
]

[[match_err]]
pattern = [
"error `install` has been replaced with `add` to add new dependencies."
Expand Down

0 comments on commit 4169493

Please sign in to comment.