mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
refactor(linter): use BigIntLiteral::raw field (#7660)
No need to slice source text to get raw value of `BigIntLiteral`. It already has a `raw` field.
This commit is contained in:
parent
3711a8e342
commit
a0973dcb5a
1 changed files with 2 additions and 4 deletions
|
|
@ -101,13 +101,11 @@ impl Rule for NumericSeparatorsStyle {
|
|||
}
|
||||
}
|
||||
AstKind::BigIntLiteral(number) => {
|
||||
let raw = number.span.source_text(ctx.source_text());
|
||||
|
||||
if self.only_if_contains_separator && !raw.contains('_') {
|
||||
if self.only_if_contains_separator && !number.raw.contains('_') {
|
||||
return;
|
||||
}
|
||||
|
||||
let formatted = self.format_bigint(number, raw);
|
||||
let formatted = self.format_bigint(number, &number.raw);
|
||||
|
||||
if formatted.len() != number.span.size() as usize {
|
||||
ctx.diagnostic_with_fix(
|
||||
|
|
|
|||
Loading…
Reference in a new issue