New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@preply/babel-plugin-react-intl-auto-id

Package Overview
Dependencies
Maintainers
7
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preply/babel-plugin-react-intl-auto-id

Generate react-intl message IDs from their defaultMessage and description

  • 1.1.3-sergii-test
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
decreased by-7.83%
Maintainers
7
Weekly downloads
 
Created
Source

Generage Your react-intl Message IDs

Have your id generated for you! Just code:

<FormattedMessage
    defaultMessage={\`Hello {name}, you have {unreadCount, plural,
        =0 {no new messages}
        one {# new message}
        other {# new messages}
    }\`}
/>

And have your id generated by serializing defaultMessage and description

Supported Syntax

  • FormattedMessage:
<FormattedMessage defaultMessage="Hey there!" />
  • FormattedHTMLMessage:
<FormattedHTMLMessage defaultMessage="Hey there!" />
  • TranslatedText
<TranslatedText defaultMessage="Hey there!" />
  • defineMessages
defineMessages({ placeholder: { defaultMessage: 'Type smth!' } })
  • Basic syntax:
  <FormattedMessage defaultMessage="Hey there!" />
  • Multi-line strings:
    <FormattedMessage
        defaultMessage="Hey
        there! This is
        quite a long message
        which we might format differently"
    />
  • Back-quoted strings:
    <FormattedMessage
        defaultMessage={\`Hello {name}, you have {unreadCount, plural,
            =0 {no new messages}
            one {# new message}
            other {# new messages}
        }\`}
    />

Note: line breaks are eliminated, so the id doesn't not change after a multi-line string gets reformatted.

Dev

Publishing

npm publish --access public. No CI 'cause it'll barely ever change.

FAQs

Package last updated on 19 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc