-
Notifications
You must be signed in to change notification settings - Fork 24
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 option to check for duplicate values to identical-keys
#33
base: main
Are you sure you want to change the base?
Add option to check for duplicate values to identical-keys
#33
Conversation
Seeing the same snapshot error, looks like a dependency's behavior changed within a major version. If I roll back to the versions specified in package.json, snapshots render as expected. |
Interestingly, if I roll back and then install the latest versions again, it seems to work. Weird. |
Hey @rafaelgssa , will review this PR and your other PR this week Thanks! |
Had to get a security release out, but will be reviewing this PR this week. Going one by one through the open PRs 😄 . |
No problem! There's no rush. |
Hey, I updated both PRs to pass the checks. Could you please take a look? |
Thanks for the PR :), I have a few questions though, I'm a bit unclear on the use case based on the description. I think in JSON, duplicate values lead to undefined behavior? I haven't really seen JSON objects with duplicate keys. Because a Javascript object has a unique set of keys, so in the end there is only one value for a property right? Could you elaborate further on some use cases for having duplicate keys in your translations in the first place and your feature? |
It's not about duplicate keys, but duplicate values for the same path across files, compared to a reference file. Let's say you have two files like this:
Where That's what this option does, it will show an error for those paths, because they have duplicate values compared to the reference file. |
This is really useful when you have a main file, like
/en/messages.json
, from which all messages are copied to the other files, as it can detect messages that you probably forgot to translate. In cases where the value is expected to be duplicate, one can simply use the setting to ignore keys.I got an error while running
npm test
, but I also got it when I tested as soon as I cloned the repo, so maybe it's because I'm on Linux?Edit: Nope, looks like that's the same error that the Travis CI build reported.