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

Fat pipe (||>) does not play nice with typescript-eslint v8 #1339

Closed
bbrk24 opened this issue Aug 6, 2024 · 3 comments · Fixed by #1636
Closed

Fat pipe (||>) does not play nice with typescript-eslint v8 #1339

bbrk24 opened this issue Aug 6, 2024 · 3 comments · Fixed by #1636
Assignees

Comments

@bbrk24
Copy link
Contributor

bbrk24 commented Aug 6, 2024

Evidence: bbrk24/Trilangle#142

error Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions

@edemaine
Copy link
Collaborator

edemaine commented Aug 6, 2024

Hopefully this can be fixed upstream: eslint/eslint#18758

@bbrk24
Copy link
Contributor Author

bbrk24 commented Aug 19, 2024

None of the pipelines that are triggering this end up being used as expressions -- the ones that are expressions, such as on the RHS of assignments, are fine. The erroring ones are all of the form

f()
  ||> .foo = 1
  ||> .bar = 2
  |> x.baz

where the pipeline is used as a statement and the last one is |> rather than ||>. Would it be reasonable to special-case pipeline statements and emit ; rather than ,? I believe that would circumvent this issue.

@edemaine
Copy link
Collaborator

edemaine commented Nov 23, 2024

Would it be reasonable to special-case pipeline statements and emit ; rather than ,? I believe that would circumvent this issue.

Yes. Maybe we can use blockContainingStatement to detect this situation.

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

Successfully merging a pull request may close this issue.

2 participants