Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 933 Bytes

no-default.md

File metadata and controls

47 lines (33 loc) · 933 Bytes

Disallow use of defaultMessage with react-intl (no-default)

This rule looks for defaultMessage in react-intl's <FormattedMessage />, formatMessage and defineMessages.

Rule Details

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' })

Options

"@godaddy/react-intl/no-default": <enabled>