Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting support for i18next #4519

Closed
wants to merge 3 commits into from
Closed

Conversation

zoran995
Copy link
Collaborator

@zoran995 zoran995 commented Jul 7, 2020

What this PR does

Added "i18next/no-literal-string" rule to lint rules for .js and .jsx files, and extracted some of the strings to the translation.json. Lint support for i18next is added using eslint-plugin-i18next dependency. It would be nice to merge this as soon as possible, so there is no double work later. Some basic details about this are introduced in #4227

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • no tests
  • I've updated CHANGES.md with what I changed.

@soyarsauce soyarsauce self-requested a review August 17, 2020 04:31
@soyarsauce soyarsauce self-assigned this Aug 17, 2020
@soyarsauce
Copy link
Contributor

@steve9164 what do you think about this?

I lean in favour of it given how much the i18n has progressed in terriajs now, however bits of it goes against the philosophy of avoiding using "disable-next-line" - although one could argue it's cleaner in certain scenarios rather than using // eslint-disable-line i18next/no-literal-string on an already long row of code.

Given that, it's not as severe for that particular case as accidentally disabling linting for a string if prettier re-flows code in the same way that it may for types.

@tephenavies
Copy link
Member

Thanks for the PR.

I think it's a good idea. We really need a complete overhaul of our eslint config though. There are some modifications here that seem unnecessary given the eslint rules (inconsistent application ignoring of "use strict";, ignoring strings in require which I think can be avoided by further adjusting config).

Also there are many merge conflicts.

Before anybody puts further effort into this we should decide when we are going to prioritise fixing up eslint. See also #3303.

@zoran995
Copy link
Collaborator Author

This has been stale for too long; the only way to get this is to redo the work.

@zoran995 zoran995 closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants