mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(linter): hanging when source has syntax/is flow (#7432)
Closes #7406 See https://github.com/oxc-project/oxc/issues/7406#issuecomment-2494981152 for why this is happening not sure whether there's a better solve for this/
This commit is contained in:
parent
c6d790b287
commit
8507464d5a
2 changed files with 14 additions and 1 deletions
|
|
@ -414,6 +414,16 @@ mod test {
|
||||||
assert_eq!(result.number_of_errors, 0);
|
assert_eq!(result.number_of_errors, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
// https://github.com/oxc-project/oxc/issues/7406
|
||||||
|
fn ignore_flow_import_plugin_directory() {
|
||||||
|
let args = &["--import-plugin", "-A all", "-D no-cycle", "fixtures/flow/"];
|
||||||
|
let result = test(args);
|
||||||
|
assert_eq!(result.number_of_files, 2);
|
||||||
|
assert_eq!(result.number_of_warnings, 0);
|
||||||
|
assert_eq!(result.number_of_errors, 0);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filter_allow_all() {
|
fn filter_allow_all() {
|
||||||
let args = &["-A", "all", "fixtures/linter"];
|
let args = &["-A", "all", "fixtures/linter"];
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use oxc_allocator::Allocator;
|
||||||
use oxc_diagnostics::{DiagnosticSender, DiagnosticService, Error, OxcDiagnostic};
|
use oxc_diagnostics::{DiagnosticSender, DiagnosticService, Error, OxcDiagnostic};
|
||||||
use oxc_parser::{ParseOptions, Parser};
|
use oxc_parser::{ParseOptions, Parser};
|
||||||
use oxc_resolver::Resolver;
|
use oxc_resolver::Resolver;
|
||||||
use oxc_semantic::SemanticBuilder;
|
use oxc_semantic::{ModuleRecord, SemanticBuilder};
|
||||||
use oxc_span::{SourceType, VALID_EXTENSIONS};
|
use oxc_span::{SourceType, VALID_EXTENSIONS};
|
||||||
use rayon::{iter::ParallelBridge, prelude::ParallelIterator};
|
use rayon::{iter::ParallelBridge, prelude::ParallelIterator};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
@ -199,6 +199,9 @@ impl Runtime {
|
||||||
.parse();
|
.parse();
|
||||||
|
|
||||||
if !ret.errors.is_empty() {
|
if !ret.errors.is_empty() {
|
||||||
|
if self.resolver.is_some() {
|
||||||
|
self.modules.add_resolved_module(path, Arc::new(ModuleRecord::default()));
|
||||||
|
}
|
||||||
return if ret.is_flow_language {
|
return if ret.is_flow_language {
|
||||||
vec![]
|
vec![]
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue