0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

chore(docs): clarify what subcommands do not type-check by default (#18520)

The CLI docs suggested that all deno subcommands no longer type-check by
default. This is only the case for some subcommands, and this PR
clarifies the CLI docs in this regard.
This commit is contained in:
Geert-Jan Zwiers 2023-04-13 03:42:28 +02:00 committed by GitHub
parent d790ea7d53
commit aaebd6eb42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -765,6 +765,7 @@ fn clap_root() -> Command {
fn bench_subcommand() -> Command {
runtime_args(Command::new("bench"), true, false)
.arg(check_arg(true))
.arg(
Arg::new("json")
.long("json")
@ -821,6 +822,7 @@ glob {*_,*.,}bench.{js,mjs,ts,mts,jsx,tsx}:
fn bundle_subcommand() -> Command {
compile_args(Command::new("bundle"))
.hide(true)
.arg(check_arg(true))
.arg(
Arg::new("source_file")
.required(true)
@ -848,6 +850,7 @@ If no output file is given, the output is written to standard output:
fn cache_subcommand() -> Command {
compile_args(Command::new("cache"))
.arg(check_arg(false))
.arg(
Arg::new("file")
.num_args(1..)
@ -905,6 +908,7 @@ Unless --reload is specified, this command will not re-download already cached d
fn compile_subcommand() -> Command {
runtime_args(Command::new("compile"), true, false)
.arg(script_arg().required(true))
.arg(check_arg(true))
.arg(
Arg::new("include")
.long("include")
@ -1149,6 +1153,7 @@ To evaluate as TypeScript:
This command has implicit access to all permissions (--allow-all).",
)
.arg(check_arg(false))
.arg(
// TODO(@satyarohith): remove this argument in 2.0.
Arg::new("ts")
@ -1347,6 +1352,7 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.",
fn install_subcommand() -> Command {
runtime_args(Command::new("install"), true, true)
.arg(Arg::new("cmd").required(true).num_args(1..).value_hint(ValueHint::FilePath))
.arg(check_arg(true))
.arg(
Arg::new("name")
.long("name")
@ -1548,6 +1554,7 @@ Ignore linting a file by adding an ignore comment at the top of the file:
fn repl_subcommand() -> Command {
runtime_args(Command::new("repl"), true, true)
.about("Read Eval Print Loop")
.arg(check_arg(false))
.arg(
Arg::new("eval-file")
.long("eval-file")
@ -1567,6 +1574,7 @@ fn repl_subcommand() -> Command {
fn run_subcommand() -> Command {
runtime_args(Command::new("run"), true, true)
.arg(check_arg(false))
.arg(
watch_arg(true)
.conflicts_with("inspect")
@ -1629,6 +1637,7 @@ fn task_subcommand() -> Command {
fn test_subcommand() -> Command {
runtime_args(Command::new("test"), true, true)
.arg(check_arg(true))
.arg(
Arg::new("ignore")
.long("ignore")
@ -1855,7 +1864,7 @@ Remote modules and multiple modules may also be specified:
}
fn compile_args(app: Command) -> Command {
compile_args_without_check_args(app.arg(no_check_arg()).arg(check_arg()))
compile_args_without_check_args(app.arg(no_check_arg()))
}
fn compile_args_without_check_args(app: Command) -> Command {
@ -2206,23 +2215,33 @@ diagnostic errors from remote modules will be ignored.",
)
}
fn check_arg() -> Arg {
Arg::new("check")
fn check_arg(checks_local_by_default: bool) -> Arg {
let arg = Arg::new("check")
.conflicts_with("no-check")
.long("check")
.num_args(0..=1)
.require_equals(true)
.value_name("CHECK_TYPE")
.help("Type-check modules")
.long_help(
"Type-check modules.
Deno does not type-check modules automatically from v1.23 onwards. Pass this
flag to enable type-checking or use the 'deno check' subcommand.
.help("Type-check modules");
if checks_local_by_default {
arg.long_help(
"Set type-checking behavior. This subcommand type-checks local modules by
default, so adding --check is redundant.
If the value of '--check=all' is supplied, diagnostic errors from remote modules
will be included.",
will be included.
Alternatively, the 'deno check' subcommand can be used.",
)
} else {
arg.long_help(
"Enable type-checking. This subcommand does not type-check by default.
If the value of '--check=all' is supplied, diagnostic errors from remote modules
will be included.
Alternatively, the 'deno check' subcommand can be used.",
)
}
}
fn script_arg() -> Arg {