Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

BigInt support #4293

Closed
joshuajbouw opened this issue Nov 15, 2018 · 5 comments
Closed

BigInt support #4293

joshuajbouw opened this issue Nov 15, 2018 · 5 comments
Labels

Comments

@joshuajbouw
Copy link

joshuajbouw commented Nov 15, 2018

Rule Suggestion

Is your rule for a general problem or is it specific to your development style?
It is a general problem for those that are using BigInt that is apart of official repos now.

What does your suggested rule do?
Ignores BigInt and "n" at the end of integers flagging that they are BigInt.

screen shot 2018-11-16 at 3 48 05 am
screen shot 2018-11-16 at 3 47 57 am
screen shot 2018-11-16 at 3 47 28 am

Here are some examples above.

List several examples where your rule could be used

const num = 10n
const num2 = BigInt(20)
const arr = new BigUint64Array(64)
const arr2 = new BigInt64Array(64)

Additional context
Now that TC-39 is out in V8, Node.js as well as JS, it would make sense to start supporting BigInt as it is officially accepted.

If there are any temporary solutions, I will be grateful.

@JoshuaKGoldberg
Copy link
Contributor

Hi @joshuajbouw - what exactly is your issue? You haven't posted any rule names or error message. Is a TSLint rule flagging something as an error that shouldn't be?

@joshuajbouw
Copy link
Author

joshuajbouw commented Nov 15, 2018

Yeah, with BigInt, tslint doesn't know exactly what to do with them. So, it flags everything BigInt related. Everything does compile as-is correctly and it does run as intended.

@JoshuaKGoldberg
Copy link
Contributor

it flags everything BigInt related

What error messages are you seeing?

@joshuajbouw
Copy link
Author

I had updated the issue above with pictures showing the error messages.

@JoshuaKGoldberg
Copy link
Contributor

Gotcha, the screenshots edited into your OP help. Thanks!

Your issue isn't with TSLint; it's with TypeScript. Out of the three:

If you have any other issues, you'll want to file them on the TypeScript repository.

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

No branches or pull requests

2 participants