Skip to content

Commit 7c0fff7

Browse files
committed
perf(linter): skip running consistent-function-scoping on .d.ts files (#11739)
taken from #11682
1 parent ff775e9 commit 7c0fff7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ impl Rule for ConsistentFunctionScoping {
299299
function_name,
300300
));
301301
}
302+
303+
fn should_run(&self, ctx: &crate::context::ContextHost) -> bool {
304+
// .d.ts files are never run, so there are no perf considerations for them.
305+
!ctx.source_type().is_typescript_definition()
306+
}
302307
}
303308

304309
#[derive(Default)]

0 commit comments

Comments
 (0)