Skip to content

Commit

Permalink
fix(@formatjs/intl): add more details to missing ID message
Browse files Browse the repository at this point in the history
fix #1059
  • Loading branch information
longlho committed Mar 30, 2021
1 parent 0bbb1f0 commit 506779b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/intl/src/message.ts
Expand Up @@ -109,7 +109,11 @@ export function formatMessage<T>(
// `id` is a required field of a Message Descriptor.
invariant(
!!msgId,
'[@formatjs/intl] An `id` must be provided to format a message.'
`[@formatjs/intl] An \`id\` must be provided to format a message. You can either:
1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)
or [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR
2. Configure your \`eslint\` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)
to autofix this issue`
)
const id = String(msgId)
const message =
Expand Down

0 comments on commit 506779b

Please sign in to comment.