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

missing type information for formatter options when using moduleResolution: bundler #690

Closed
stefanprobst opened this issue Dec 5, 2023 · 1 comment · Fixed by #694
Closed
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@stefanprobst
Copy link
Contributor

stefanprobst commented Dec 5, 2023

Description

with "moduleResolution": "bundler" in tsconfig.json (which is the current CNA default), i don't get type information for getFormatter DateFormat options: see https://github.com/stefanprobst/issue-next-intl-types/blob/main/app/%5Blocale%5D/page.tsx#L42

it does seem to work fine with useFormatter: see https://github.com/stefanprobst/issue-next-intl-types/blob/main/app/%5Blocale%5D/page.tsx#L31

also, when setting "moduleResolution": "node" it does seem to work.

EDIT: seems to not be a problem for numberformat/listformat options.

Mandatory reproduction URL (CodeSandbox or GitHub repository)

https://github.com/stefanprobst/issue-next-intl-types

Reproduction description

Steps to reproduce:

  1. Clone reproduction repo
  2. Open app/[locale]/page.tsx in your editor
  3. See that with useFormatter, the invalid dateFormat option is marked as an error, while it is not marked as an invalid option with getFormatter

Expected behaviour

get intellisense for allowed formatter options

@amannn
Copy link
Owner

amannn commented Dec 5, 2023

Thank you for the great bug report! This will be fixed by #694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants