eslint-plugin-i18n-lingui

1.3.1 • Public • Published

eslint-plugin-i18n-lingui

ESLint Plugin to enforce i18n best practices.

You should use this plugin if:

  1. You use lingui to localize your application.
  2. 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.

Package Sidebar

Install

npm i eslint-plugin-i18n-lingui

Weekly Downloads

92

Version

1.3.1

License

MIT

Unpacked Size

19.5 kB

Total Files

16

Last publish

Collaborators

  • npm_okc