mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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:
parent
a4eee007ef
commit
8ae17026cb
20 changed files with 497 additions and 72 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue