diff --git a/crates/oxc_linter/src/fixer/mod.rs b/crates/oxc_linter/src/fixer/mod.rs index 6f373d6f35b1f..477c386767853 100644 --- a/crates/oxc_linter/src/fixer/mod.rs +++ b/crates/oxc_linter/src/fixer/mod.rs @@ -176,6 +176,15 @@ impl<'c, 'a: 'c> RuleFixer<'c, 'a> { self.new_fix(CompositeFix::Single(fix), message) } + /// Finds the next occurrence of the given token in the source code, + /// starting from the specified position, skipping over comments. + /// + /// Returns the offset from `start` if the token is found, otherwise `None`. + #[inline] + pub fn find_next_token_from(&self, start: u32, token: &str) -> Option { + self.ctx.find_next_token_from(start, token) + } + #[must_use] pub fn codegen(self) -> Codegen<'a> { Codegen::new()