Skip to content

feat: bigint literals without as const - #2

Open
paul-soporan wants to merge 2 commits into
arcanis:mainfrom
paul-soporan:bigint-literals
Open

feat: bigint literals without as const#2
paul-soporan wants to merge 2 commits into
arcanis:mainfrom
paul-soporan:bigint-literals

Conversation

@paul-soporan

Copy link
Copy Markdown
Contributor

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

Comment thread tests/type-guards.ts
if (t.isLiteral(42)(foo)) {
const bar: 42 = foo;
}

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@paul-soporan
paul-soporan requested a review from arcanis November 21, 2020 19:03
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.

2 participants