0.0.2 • Published 9 years ago
eslint-plugin-hss-i18n v0.0.2
eslint-plugin-hss-i18n
Detect common errors when using I18n at Hearsay Social
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-hss-i18n:
$ npm install eslint-plugin-hss-i18n --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-hss-i18n globally.
Usage
Add i18n to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"hss-i18n"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"hss-i18n/no-interpolate-literal": "error",
"hss-i18n/require-gettext-literal": "error"
}
}Supported Rules
hss-i18n/no-interpolate-literal: Prevent calling I18n.interpolate on untranslated string literalshss-i18n/require-gettext-literal: Prevent calling I18n.gettext with anything other than a literal string.