mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(linter): fix panic when directive appears at the first line (#264)
This commit is contained in:
parent
f9347b55b7
commit
034ca98182
1 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ impl<'a, 'b> DisableDirectivesBuilder<'a, 'b> {
|
|||
.lines()
|
||||
.rev()
|
||||
.next()
|
||||
.map_or(0, |line| span.start - line.len() as u32);
|
||||
.map_or(0, |line| span.start - (line.len() as u32 - 1));
|
||||
let stop = span.start;
|
||||
|
||||
// `eslint-disable-line`
|
||||
|
|
@ -192,7 +192,7 @@ fn test() {
|
|||
// debugger;
|
||||
// ",
|
||||
// To disable all rules on a specific line, use a line or block comment in one of the following formats:
|
||||
"
|
||||
"debugger; // eslint-disable-line
|
||||
debugger; // eslint-disable-line
|
||||
|
||||
// eslint-disable-next-line
|
||||
|
|
|
|||
Loading…
Reference in a new issue