check rules for signavio-i18n
npm install eslint-plugin-signavio-i18ncheck rules for signavio-i18n
You'll first need to install ESLint:
```
$ npm i eslint --save-dev
Next, install eslint-plugin-signavio-i18n:
``
$ npm install eslint-plugin-signavio-i18n --save-dev
Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-signavio-i18n globally.
Add signavio-i18n to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
`json`
{
"plugins": [
"signavio-i18n"
]
}
Then configure the rules you want to use under the rules section.
`json`
{
"rules": {
"signavio-i18n/rule-name": 2
}
}
Checks if translator comment matches provided pattern.
This considered to be warning:
`javascript
//'signavio-i18n/translator-comment-matches-pattern': [1, '.*, PEX-'],
// translators: toast message when user is already added
KEY: i18n('text')
// translators: toast message when user is already added PEX-5594
KEY: i18n('text')
`
This considered to be valid, note the comma before PEX-5594:
`javascript
//'signavio-i18n/translator-comment-matches-pattern': [1, '.*, PEX-'],
// translators: toast message when user is already added, PEX-5594
KEY: i18n('text')
`
All translator comments must start with translators:
This considered to be warning:
`javascript`
// toast message when user is already added
KEY: i18n('text')
This considered to be valid:
`javascript`
// translators: toast message when user is already added
KEY: i18n('text')
Keys used in the template, must be present in the passed configuration object.
This considered to be warning:
`javascript`
i18n(
'Here come __firstParam__, __secondParam__ and __missingParam__.',
{
firstParam,
secondParam,
}
)
This considered to be valid:
`javascript``
i18n(
'Here come __firstParam__, __secondParam__ and __thirdParam__.',
{
firstParam,
secondParam,
thirdParam,
}
)
* Fill in provided rules here