Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Request: extend ESLint's valid-typeof rule to accept "bigint" as a valid comparison value #153

Closed
fmartin5 opened this issue Aug 7, 2018 · 1 comment

Comments

@fmartin5
Copy link

fmartin5 commented Aug 7, 2018

Some people are starting to use typeof with "bigint" in their code, but ESLint's valid-typeof rule does not accept it, and ESLint will not support it until the proposal for BigInt reaches stage 4 (it's currently in stage 3).

Then someone at ESLint suggested to check eslint-plugin-babel for an augmented rule:

Your best chance at this point is to use babel-eslint (to parse literals), as well as to see if there is a rule in eslint-plugin-babel which augments valid-typeof to support big integers.

@GeneralYouri
Copy link

Seconded, it's annoying to have to disable rules or go through other loop holes just to be able to work with BigInts.

The 'no-undef' rule can be bypassed by adding BigInt to ESLint globals, which stops it from reporting the use of the BigInt constructor, which is a reasonable workaround. But for the 'valid-typeof' rule I don't see a workaround other than disabling this rule either globally or locally, which really sucks either way.

I'd easily use eslint-plugin-babel even if all it did was augment that one rule for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants