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

feat: bigint literals without as const #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

paul-soporan
Copy link
Contributor

t.isLiteral didn't support bigint literals without as const.

@@ -25,6 +25,10 @@ import * as t from '../sources';
if (t.isLiteral(42)(foo)) {
const bar: 42 = foo;
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to remove the messages at the top? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I tried using a nested tsconfig.json, but it only gets rid of the editor warning, so it's still present if type-checking from the root. Maybe some magic with project references? Or should we just add a @ts-expect-error to the line above?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the best is to use ES2020 in the general tsconfig.json, and create a tsconfig.build.json that extends the main one but downgrades the target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we can't set ES2020 as the target for development, as TS won't transpile optional chaining anymore, which isn't supported by Node 12.

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

Successfully merging this pull request may close these issues.

None yet

2 participants