Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigInt not support yet #13122

Closed
willin opened this issue Mar 30, 2020 · 7 comments
Closed

BigInt not support yet #13122

willin opened this issue Mar 30, 2020 · 7 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion needs info Not enough information has been provided to triage this issue triage An ESLint team member will look at this issue soon

Comments

@willin
Copy link

willin commented Mar 30, 2020

The version of ESLint you are using.

6.8.0

The problem you want to solve.

BigInt Support

Your take on the correct solution to problem.

console.log(1 === 1n);
// Parsing error: Identifier directly after number
console.log(BigInt(1));
// 'BigInt' is not defined.
@willin willin added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Mar 30, 2020
@anikethsaha
Copy link
Member

Can you share your eslint config ?
BigInt I think is available from es2020

parserOptions: { ecmaVersion: 2020 }

@kaicataldo kaicataldo added the needs info Not enough information has been provided to triage this issue label Mar 30, 2020
@eslint-deprecated
Copy link

Hi @willin, thanks for the issue. It looks like there's not enough information for us to know how to help you.

If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

Requesting a rule change? Please see Proposing a Rule Change for instructions.

If it's something else, please just provide as much additional information as possible. Thanks!

@kaicataldo kaicataldo removed core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint labels Mar 30, 2020
@willin
Copy link
Author

willin commented Mar 31, 2020

@anikethsaha https://github.com/tc39/proposals/blob/master/finished-proposals.md

besides, Optional Chaining is not supported too.

@anikethsaha
Copy link
Member

@anikethsaha https://github.com/tc39/proposals/blob/master/finished-proposals.md

yes, 2020 as I mentioned

besides, Optional Chaining is not supported too.

this is work in progress.

@willin
Copy link
Author

willin commented Mar 31, 2020

root: true
extends: shiwangme
parserOptions:
  ecmaVersion: 2020

when i add ecmaVersion:

console.log(BigInt(1));
// 'BigInt' is not defined.
console.log(1n === 1);
// ok

const a = {};
console.log(a?.b);
// Parsing error: Unexpected token .

@anikethsaha
Copy link
Member

console.log(BigInt(1));

is

console.log(1n) //  use this one

Or else , try using babel-eslint if you want to use BigInt , though I am not sure about this whether they support it or not.

const a = {};
console.log(a?.b);
// Parsing error: Unexpected token .

its still in work in progress state, check this one #12642

Hope this helps 👍

@willin
Copy link
Author

willin commented Mar 31, 2020

thx

@willin willin closed this as completed Mar 31, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 28, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion needs info Not enough information has been provided to triage this issue triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants