eslint-plugin-unicorn
eslint-plugin-unicorn copied to clipboard
Add `no-duplicate-literal-elements` rule
add no-duplicate-literal-elements
rule to fixes #1559
Thanks for working on this.
It should handle array too: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1559#issuecomment-951072358
It should handle array too: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1559#issuecomment-951072358
OK, thx.
I will make up.
Hello @sindresorhus,
We have some question about CI / lint-test
and CI / integration
which includes some failing test.
But not sure how to fix.
Could you provide some suggestion for that, Thank you every much!!!
@kayac-chang Please write your comments in English. It's fine to use Google Translate, but you should not force everyone else to have to do that.
@sindresorhus Thank you for your review. I have made corrections and added Array checks, doc updates, and new tests.
~But I have the same problem as @kayac-chang~
~It's about CI / lint-test
and CI / integration
which includes some failing tests.~
~But not sure how to fix it.~
~Could you provide some suggestions for that, Thank you very much.~
The latest CI fail message is easier to understand, I will try to fix it.
Thank you very much.
By the way, my English is not good. So if there is something wrong with the text, please let me know or provide suggestions, thank you very much.
This rule just reported the first duplicate index now.
And I have tried to fix the CI fail.
I don't think this rule should limited to Literals,
const set = new Set([
undefined,
undefined,
foo,
foo,
foo.bar,
foo.bar,
])
This is obviously duplicated, I think we can try analyze the value, instead of only checking literals.
I don't think this rule should limited to Literals,
const set = new Set([ undefined, undefined, foo, foo, foo.bar, foo.bar, ])
This is obviously duplicated, I think we can try analyze the value, instead of only checking literals.
This is an interesting suggestion, we need to confirm with @sindresorhus and @futpib .
And do I need to update the rule name?
This is an interesting suggestion, we need to confirm with @sindresorhus and @futpib .
Yeah, makes sense.
And do I need to update the rule name?
Maybe no-duplicate-elements
.
Bump :)
Sorry, I didn't ignore this PR. It's just that I don't have a way forward.
It's just that I don't have a way forward.
What are you stuck on?
Closing for lack of activity.