This rule looks for defaultMessage in react-intl's <FormattedMessage />
, formatMessage
and defineMessages
.
Examples of incorrect code for this rule:
<FormattedMessage id='missing_example' defaultMessage='Redundant message text' />
formatMessage({ id: 'missing_example', defaultMessage: 'Redundant message text' })
defineMessages({ msg: { id: 'missing_example', defaultMessage: 'Redundant message text' }})
defineMessage({ id: 'missing_example', defaultMessage: 'Redundant message text' })
Examples of correct code for this rule:
<FormattedMessage id='in_example' />
formatMessage({ id: 'in_example' })
defineMessages({ msg: { id: 'in_example' }})
defineMessage({ id: 'in_example' })
"@godaddy/react-intl/no-default": <enabled>