lingui / eslint-plugin

Set of ESLint rules for Lingui projects
https://www.npmjs.com/package/eslint-plugin-lingui
MIT License
18 stars 6 forks source link

Create a `recomended` set of rules #5

Open thekip opened 11 months ago

thekip commented 11 months ago

"lingui/recommended"

This is my proposition for recomended set:

{
  "rules": {
    "lingui/missing-lingui-transformation": 2,
    "lingui/t-call-in-function": 2,
    "lingui/no-single-varibles-to-translate": 2,
    "lingui/i18n-only-identifiers": 1,
    "lingui/no-single-tag-to-translate": 2,
    "lingui/no-trans-inside-trans": 2,
  }
}

Explanation:

Almost all rules are very helpfull. I removed lingui/text-restrictions from recomended because there so many variations how it could be setup. And we should think carefully about sensisble defaults.

I also marked lingui/i18n-only-identifiers as warning instead of error/ I personally think that this is a very important rule, but for some small projects it might be cumbersome to create an additional variable just to provide more context for the translator, that's why only warning.

yslpn commented 3 months ago

Agree! It is usual when there is some recommended set of rules.