eslint-plugin-react-intl-universal
v1.0.4
Published
ESLint plugin for React Intl Universal
Downloads
508
Maintainers
Readme
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
- eslint-plugin-react-intl by GoDaddy, many parts of my project were based on yours.
- eslint-plugin-i18next by edvardchen, i made an adaptation of the no-literal-string created by him in my project.
License
eslint-plugin-react-intl-universal is licensed under the MIT License.