Package Exports
- eslint-plugin-i18n-lingui
- eslint-plugin-i18n-lingui/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-i18n-lingui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-i18n-lingui
ESLint Plugin to enforce i18n best practices.
You should use this plugin if:
- You use lingui to localize your application.
- You want to avoid common pitfalls in wrapping source strings that could result poor quality translations.
Installation
npm install eslint-plugin-i18n-lingui --save-dev
yarn add eslint-plugin-i18n-lingui --dev
Usage
Add i18n-lingui
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix.
plugins: [
"i18n-lingui"
]
Then configure the rules you want to use under the rules
section.
rules: {
"i18n-lingui/rule-name": 1, // warning
"i18n-lingui/another-rule-name": 2, // error
}
List of supported rules
Has Fixer | Rule | Description |
---|---|---|
no-eval-in-placeholder | No evaluation of placeholder values in wrapped strings. | |
✔️ | prefer-unicode-ellipsis | Detects three periods (... ) and replaces it with unicode ellipses (… ) |
no-useless-string-wrapping | No wrapping a string that only contains an expression. | |
✔️ | prefer-smartquote | Detects apostrophe ' and double quotes " and replaces them with smartquotes. |