npm install @connectedcars/eslint-plugin-react-i18n
Open your eslint config file and add the following under rules
:
"@connectedcars/react-i18n/checks": "error"
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"],
}
}
]