Skip to content
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

Union types should contain a space around the vertical bar #94

Open
MrMarCode opened this issue Aug 1, 2023 · 1 comment
Open

Union types should contain a space around the vertical bar #94

MrMarCode opened this issue Aug 1, 2023 · 1 comment
Assignees

Comments

@MrMarCode
Copy link

It was noted that union types should have a space around the vertical bar separator. For example: client: Got|Promise<Got> should get flagged and should expect client: Got | Promise<Got> instead.

@pbredenberg pbredenberg self-assigned this Mar 28, 2024
@MatheusBaldi
Copy link

@MrMarCode there is a rule for this behavior (I guess it's actually for the bitwise or operator, but works here as well) space-infix-ops from eslint, but it has been deprecated together with many other formatting rules and moved to another package, the eslint stylistic.
In the docs for the typescript-eslint space-infix-ops there are two issues referenced that talk about this change, but it also says the old rules would continue to work. For the space-infix-ops though, the rule was not working, so I changed them to use the eslint stylistic plugins, which was already installed and not being used, and it worked.

I don't know for now if all the rules must be update to use stylistic, but I've migrated and tested all of them locally and they're working. I'll open a draft PR with the changes. Any suggestion is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants