SonarSource / eslint-plugin-sonarjs

SonarJS rules for ESLint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix FP S1764 (`no-identical-expressions`): using BigInts in bit shifting

Darker-Ink opened this issue · comments

I want to report a bug.

When you are using the no-identical-expressions rule and using bigints it seems to cause it to error out when it probably shouldn't

when you do for example

1n << 1n

It errors out though when you do

1 << 1

it works fine

Reproducer

const Flags = {
  StaffBadge: 1n << 0n,
  GhostBadge: 1n << 1n, // False-positive here
  SponsorBadge: 1n << 2n
};

Expected behavior:

It does not error out

eslint-plugin-sonarjs version: 0.19.0
eslint version: 8.39.0
Node.js version: v19.3.0

Rule key: no-identical-expressions

Thanks for notifying us, we'll fix this in the next release!