Skip to content

Commit

Permalink
fix(linter): typescript/no-magic-numbers: remove double minus for rep…
Browse files Browse the repository at this point in the history
…orting negative bigint numbers (#5565)

@DonIsaac small bug I found after 10x review

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
Sysix and autofix-ci[bot] authored Sep 7, 2024
1 parent 0ac420d commit cdd1a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/rules/typescript/no_magic_numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl InternConfig<'_> {
InternConfig {
node: parent_node,
value: NoMagicNumbersNumber::BigInt(raw.clone()),
raw: format!("-{raw}"),
raw,
}
} else {
InternConfig {
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/snapshots/no_magic_numbers.snap
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ source: crates/oxc_linter/src/tester.rs
· ────
╰────

typescript-eslint(no-magic-numbers): No magic number: --100n
typescript-eslint(no-magic-numbers): No magic number: -100n
╭─[no_magic_numbers.tsx:1:3]
1f(-100n)
· ─────
Expand Down Expand Up @@ -757,7 +757,7 @@ source: crates/oxc_linter/src/tester.rs
· ──
╰────

typescript-eslint(no-magic-numbers): No magic number: --4n
typescript-eslint(no-magic-numbers): No magic number: -4n
╭─[no_magic_numbers.tsx:1:12]
1type Foo = -4n;
· ───
Expand Down

0 comments on commit cdd1a91

Please sign in to comment.