From 1a92c39b77c46170a2135994359962034c8131c5 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 11 Jun 2021 09:03:42 -0400 Subject: refactor(ast): Change AST parsing error to return struct with message and location (#10911) * Remove unused check js emit option. * Improve parse error. * Format. --- cli/module_graph.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cli/module_graph.rs') 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) -- cgit v1.2.3