@putout/plugin-remove-duplicates-from-union

putout plugin adds ability to find and remove duplicates from union

Usage no npm install needed!

<script type="module">
  import putoutPluginRemoveDuplicatesFromUnion from 'https://cdn.skypack.dev/@putout/plugin-remove-duplicates-from-union';
</script>

README

@putout/plugin-remove-duplicates-from-union NPM version

putout plugin adds ability to find and remove duplicates from union (for typescript). Moved to @putout/plugin-typescript.

Install

npm i @putout/plugin-remove-duplicates-from-union -D

Rule

{
    "rules": {
        "remove-duplicates-from-union": "on"
    }
}

❌ Incorrect code example

type x = boolean[]
    | A
    | string
    | A
    | string[]
    | boolean[];

✅ Correct code Example

type x = boolean[]
    | A
    | string
    | string[];

License

MIT