Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 758 Bytes

README.md

File metadata and controls

39 lines (31 loc) · 758 Bytes

Getting started

Installation

npm install @connectedcars/eslint-plugin-react-i18n

ESlint config

Open your eslint config file and add the following under rules:

"@connectedcars/react-i18n/checks": "error"

Options

It's also possible to change some of the default options such as:

"@connectedcars/react-i18n/checks": [
  "error",
  {
    "globalData": [
      "p",
      "div",
      "strong"
    ],
    "replaceStringRegex": {
      "pattern": "{__KEY__}"
    },
    "expressions": {
      "t": ["singular", "data", "context"],
      "tx": ["singular", "data", "context"],
      "tn": ["count", "singular", "plural", "data", "context"],
      "tnx": ["count", "singular", "plural", "data", "context"],
    }
  }
]