-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: default to TS for file extension and support ext flag in more scenarios #25472
Conversation
# Conflicts: # cli/args/flags.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I want @dsherret to take a look as well before we merge
# Conflicts: # Cargo.lock # cli/Cargo.toml # cli/graph_container.rs # cli/module_loader.rs # cli/tools/fmt.rs # cli/tools/registry/pm/cache_deps.rs
# Conflicts: # cli/lsp/testing/execution.rs # cli/tools/test/mod.rs
let headers = if local.extension().is_none() { | ||
Some(HashMap::from([( | ||
"content-type".to_string(), | ||
"application/typescript".to_string(), | ||
)])) | ||
} else { | ||
None | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you want is MediaType::from_specifier(specifier) != MediaType::Unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, as per what you have said in #11220 (comment)
extensionless files default to TS everywhere (entrypoint and imported)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really lift this up into deno_graph
after 2.0 is out the door...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's land it and if Luca has concerns we can fix them tomorrow.
Closes #11220
Currently does lint, fmt, and repl