Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-intl-messages-linter

P0lip11MIT0.0.1

Lint react-intl messages used in your React components.

react, react-intl, linting, linter, react-intl-messages-linter, intl

readme

react-intl-messages-linter

Install

yarn add --dev react-intl-messages-linter

Usage

lint-react-intl-messages [options] path

Command line options/flags

-q, --quiet [true]          Report errors only   
-i, --ignore                Pattern of files to ignore
--webpack                   Path to webpack config

Disclaimer

Note that this tool was made to help you spotting missing messages. It does not aim to replace proper unit/integrations tests you should have in most (if not all) cases. There are a couple of caveats and it may be unable to detect missing messages under unsupported circumstances or report a false positive.

Assumptions and caveats

  • Names of import specifiers must match the following regexp /[az]*messages$/i
  • Path of message imports must match /./[a-z-]messages(?:.js)?$/i
  • Reasonable shadowing
  • Computed messages are not supported well... just yet
  • Messages with circular (imported) dependencies are not supported

TODO:

  • add some documentation :D
  • get rid of as many of above caveats as possible
  • make unsafe usages more robust and reliable
  • add feature to ignore files

LICENSE

MIT