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

ES2020 lib required because of @types/es-abstract #1426

Closed
buschtoens opened this issue Aug 20, 2020 · 1 comment · Fixed by #1427
Closed

ES2020 lib required because of @types/es-abstract #1426

buschtoens opened this issue Aug 20, 2020 · 1 comment · Fixed by #1427

Comments

@buschtoens
Copy link
Member

With 9342da7 I updated the intl library related dependencies to the latest version. This resolved the issue with the divergent TranslationAST / MessageFormat types.

However @types/es-abstract, which is a dependency of @formatjs/intl-numberformat assumes methods only added in ES2020, like String#matchAll(). For host projects that do not yet target ES2020 or do not have ES2020 listed in their lib, this will throw type errors.

The fix is trivial: Just raise the compilerOptions.target to ES2020 or add ES2020 to compilerOptions.lib.

Is this something we should document somewhere?

@longlho
Copy link
Collaborator

longlho commented Aug 22, 2020

An addition to this to always add ["esnext.intl", "es2017.intl", "es2018.intl"] as well

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 a pull request may close this issue.

2 participants