feat: Add "deno check" subcommand for type checking (#14072)

This commit adds new "deno check" subcommand.
Currently it is an alias for "deno cache" with the difference that remote
modules don't emit TS diagnostics by default.

Prints warning for "deno run" subcommand if "--check" flag is not present
and there's no "--no-check" flag. Adds "DENO_FUTURE_CHECK" env
variable that allows to opt into new behavior now.
This commit is contained in:
Bartek Iwańczuk 2022-04-11 01:12:51 +02:00 committed by GitHub
parent a4eee007ef
commit 8ae17026cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 497 additions and 72 deletions

View file

@ -339,7 +339,7 @@ pub fn is_emittable(
pub struct CheckOptions {
/// The check flag from the option which can effect the filtering of
/// diagnostics in the emit result.
pub typecheck_mode: flags::TypecheckMode,
pub type_check_mode: flags::TypeCheckMode,
/// Set the debug flag on the TypeScript type checker.
pub debug: bool,
/// If true, any files emitted will be cached, even if there are diagnostics
@ -430,7 +430,7 @@ pub fn check_and_maybe_emit(
root_names,
})?;
let diagnostics = if options.typecheck_mode == flags::TypecheckMode::Local {
let diagnostics = if options.type_check_mode == flags::TypeCheckMode::Local {
response.diagnostics.filter(|d| {
if let Some(file_name) = &d.file_name {
!file_name.starts_with("http")