mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 20:28:58 +00:00
fix(linter): fix crashing with unwrap in import/no-cycle (#3035)
closes #3034
This commit is contained in:
parent
fe37da63ae
commit
598bbbaddc
1 changed files with 5 additions and 2 deletions
|
|
@ -113,8 +113,11 @@ impl Rule for NoCycle {
|
|||
let help = stack
|
||||
.iter()
|
||||
.map(|(specifier, path)| {
|
||||
let path =
|
||||
path.strip_prefix(&cwd).unwrap().to_string_lossy().replace('\\', "/");
|
||||
let path = path
|
||||
.strip_prefix(&cwd)
|
||||
.unwrap_or(path)
|
||||
.to_string_lossy()
|
||||
.replace('\\', "/");
|
||||
format!("-> {specifier} - {path}")
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue