1.1.2-beta • Published 2 years ago
@deriv/eslint-plugin-localize-usage v1.1.2-beta
@deriv/eslint-plugin-localize-usage
Eslint rules for enforcing the correct usage of localize function and Localize component in the app
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install @deriv/eslint-plugin-localize-usage:
$ npm install @deriv/eslint-plugin-localize-usage --save-devNote: If you installed ESLint globally (using the -g flag) then you must also install @deriv/eslint-plugin-localize-usage globally.
Usage
Add localize-usage to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
  "plugins": ["@deriv/localize-usage"]
}Then configure the rules you want to use under the rules section.
{
  "rules": {
    "localize-usage/rule-name": "error"
  }
}You can also use the recommended config instead
{
  "extends": ["plugin:localize-usage/recommended"]
}Supported Rules
- localize-usage/only-string-literal-argument: Enforce using static strings as keys for localize functions which we use for translation
 - localize-usage/no-invalid-identifier-in-prop-value: Validate string literal passed to Localize component in i18n_default_text prop is valid and has all the identifiers in values prop
 
1.1.1-beta
2 years ago
1.1.2-beta
2 years ago
1.1.0-beta
2 years ago
1.0.7-beta
2 years ago
1.0.6-beta
2 years ago