# no-duplicate-set-values πŸ“ Disallow duplicate values in `Set` constructor array literals. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). `Set` values are unique, so repeated static values in a `Set` constructor array literal are redundant. This rule also reports repeated reference expressions, like `foo.bar`. It does not model mutations or side effects between elements. ## Examples ```js // ❌ const set = new Set([ 'foo', 'bar', 'foo', ]); // βœ… const set = new Set([ 'foo', 'bar', ]); ``` ```js // ❌ const foo = 2; const set = new Set([foo, 2]); // βœ… const foo = 2; const set = new Set([foo, 3]); ``` ```js // ❌ const set = new Set([foo.bar, foo.bar]); // βœ… const set = new Set([foo.bar, foo.baz]); ``` This rule only checks `new Set([...])` with an array literal argument. It does not check arrays, maps, non-array iterables, or chained `Set#add()` calls.