lingui / eslint-plugin

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

Some linting rules unusable due to false positives #41

Open Bertg opened 4 months ago

Bertg commented 4 months ago

Describe the bug

We are working to adopt eslint-plugin-lingui and most rules are fine, however lingui/text-restrictions is pretty much unusable.

Our source code contains a lot of template literals with other tagFunctions. A lot of this is for Lingui, but we also have graphql statements and just plain string interpolation going on. The plugin will match ALL of these strings, which makes using this rule pretty much a non starter.

We also disabled lingui/no-unlocalized-strings for the same reasons.

To Reproduce

Create a project containing other string literals with or without tagFunction. Obvious tagFunction like grphql templates will also be linted by eslint-plugin-lingui

Expected behavior

I'm not sure what the ideal behaviour here would be.

I think that lingui/text-restrictions shoudl only apply to strings that are 100% sure to be processed by lingui. So either inside of a specific Lingui tag, or template literals processed by the specific taFunctions of lingui (t, plural, ...)

timofei-iatsenko commented 4 months ago

As you can see, there are not much activity from our side in development of this plugin. I'm encouraging the community to help with this plugin, since i don't have a bandwidth to do so. If you find this plugin useful, and you're lacking some functionality, we would be happy to accept any help.