1.0.4 • Published 2 years ago

eslint-plugin-react-intl-universal v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

eslint-plugin-react-intl-universal

react-intl-universal linting rules for Alibaba React Intl Universal internationalization library.

Installation

$ npm install eslint-plugin-react-intl-universal --save-dev
$ yarn add -D eslint-plugin-react-intl-universal

Usage

Add react-intl-universal to the plugins section of your .eslintrc configuration file.

{
  "plugins": ["react-intl-universal"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "react-intl-universal/no-literal-string": "error",
    "react-intl-universal/id-missing": ["error", { "locales": ["src/locales/en-US.json"] }]
  }
}

or

{
  "extends": ["plugin:react-intl-universal/recommended"]
}
  • By default id-missing rule, list of locale files, defaults to ['locales/en-US.json']

Supported Rules

  • id-missing - This rule was based on the rule in this repository.
  • no-literal-string - This rule aims to avoid developers to display literal string directly to users without translating them.

Thanks

License

eslint-plugin-react-intl-universal is licensed under the MIT License.