summaryrefslogtreecommitdiff
path: root/cli/module_graph.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-06-11 09:03:42 -0400
committerGitHub <noreply@github.com>2021-06-11 09:03:42 -0400
commit1a92c39b77c46170a2135994359962034c8131c5 (patch)
tree8643d3b36820e3fb75a6bb0c797de2d8635f48af /cli/module_graph.rs
parent9d706d71b55ca254d1bbd87754533a60142d2a6a (diff)
refactor(ast): Change AST parsing error to return struct with message and location (#10911)
* Remove unused check js emit option. * Improve parse error. * Format.
Diffstat (limited to 'cli/module_graph.rs')
-rw-r--r--cli/module_graph.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs
index 2ae112c8d..3a135b166 100644
--- a/cli/module_graph.rs
+++ b/cli/module_graph.rs
@@ -1102,10 +1102,11 @@ impl Graph {
}
}
BundleType::None => {
+ let check_js = config.get_check_js();
let emit_options: ast::EmitOptions = config.into();
for (_, module_slot) in self.modules.iter_mut() {
if let ModuleSlot::Module(module) = module_slot {
- if !(emit_options.check_js
+ if !(check_js
|| module.media_type == MediaType::Jsx
|| module.media_type == MediaType::Tsx
|| module.media_type == MediaType::TypeScript)
@@ -1669,6 +1670,7 @@ impl Graph {
.merge_tsconfig_from_config_file(options.maybe_config_file.as_ref())?;
let config = ts_config.as_bytes();
+ let check_js = ts_config.get_check_js();
let emit_options: ast::EmitOptions = ts_config.into();
let mut emit_count = 0_u32;
for (_, module_slot) in self.modules.iter_mut() {
@@ -1683,7 +1685,7 @@ impl Graph {
}
// if we don't have check_js enabled, we won't touch non TypeScript or JSX
// modules
- if !(emit_options.check_js
+ if !(check_js
|| module.media_type == MediaType::Jsx
|| module.media_type == MediaType::Tsx
|| module.media_type == MediaType::TypeScript)