Skip to content

Commit 5f64b74

Browse files
committed
lint
1 parent c84d50a commit 5f64b74

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

crates/oxc_linter/src/config/oxlintrc.rs

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -153,29 +153,28 @@ impl Oxlintrc {
153153
config.path = path.to_path_buf();
154154

155155
// resolve relative paths
156-
if let Some(external_plugins) = &mut config.external_plugins {
157-
if let Some(config_dir) = config.path.parent() {
158-
*external_plugins = std::mem::take(external_plugins)
159-
.into_iter()
160-
.map(|specifier| {
161-
let is_relative =
162-
specifier.starts_with("./") || specifier.starts_with("../");
163-
if is_relative {
164-
config_dir
165-
.join(&specifier)
166-
.into_os_string()
167-
.into_string()
168-
// there is a corner case where this can fail
169-
// for non-utf8 paths, this relative plugin specifier
170-
// may be resolved relative to the wrong config file
171-
// when two are merged.
172-
.unwrap_or(specifier.clone())
173-
} else {
174-
specifier
175-
}
176-
})
177-
.collect();
178-
}
156+
if let Some(external_plugins) = &mut config.external_plugins
157+
&& let Some(config_dir) = config.path.parent()
158+
{
159+
*external_plugins = std::mem::take(external_plugins)
160+
.into_iter()
161+
.map(|specifier| {
162+
let is_relative = specifier.starts_with("./") || specifier.starts_with("../");
163+
if is_relative {
164+
config_dir
165+
.join(&specifier)
166+
.into_os_string()
167+
.into_string()
168+
// there is a corner case where this can fail
169+
// for non-utf8 paths, this relative plugin specifier
170+
// may be resolved relative to the wrong config file
171+
// when two are merged.
172+
.unwrap_or(specifier)
173+
} else {
174+
specifier
175+
}
176+
})
177+
.collect();
179178
}
180179
Ok(config)
181180
}

0 commit comments

Comments
 (0)