azat-io / eslint-plugin-perfectionist

🦄 ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
https://eslint-plugin-perfectionist.azat.io
MIT License
1.62k stars 28 forks source link

feat: add sort-intersection-types rule #123

Closed JoshuaKGoldberg closed 1 month ago

JoshuaKGoldberg commented 1 month ago

Description

Fixes #84.

I copy & pasted the existing sort-union-types rule, find-and-replaced "union" to "intersection", then updated tests to use & intersection types.

Additional context

I didn't add the nullable-last option because I figured that's not a common scenario with intersection types. Maybe I'm wrong there?


What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following

azat-io commented 1 month ago

Looks awesome! Thank you! ❤️