eslint-plugin-require-intl-translation
v1.1.3
Published
Updates the package to allow for <a> tags to have plain text
Downloads
1
Maintainers
Readme
eslint-plugin-require-intl-translation
This is a plugin to ensure that Intl translations are being made. Since they should be stored in an object for translation, this disables plain text between html tags.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-require-intl-translation
:
$ npm install eslint-plugin-require-intl-translation --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-require-intl-translation
globally.
Usage
Add require-intl-translation
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"require-intl-translation"
]
}
Then configure the rules you want to use under the rules section. Currently there's just one rule: 'missing-formatted-message'.
{
"rules": {
"require-intl-translation/missing-formatted-message": 2
}
}
Supported Rules
- missing-formatted-message
TODO
- Add in a library for enforcing components contain both an id and defaultMessage attribute
- Allow enforceable rules on naming of ids for both defineMessages and
- Make the tag a configurable option
- Potentially allow for emails to stay as they are (check that it's just one word)
- Don't allow for trailing spaces, or lines that are only whitespace
- Ensure that if the string contains brackets, it contains values matching that variable inside
- Ignore when it's just a number (and nothing else)