DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.35k stars 29 forks source link

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

Open bbrk24 opened 1 month ago

bbrk24 commented 1 month ago

Evidence: bbrk24/Trilangle#142

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

edemaine commented 1 month ago

Hopefully this can be fixed upstream: https://github.com/eslint/eslint/issues/18758

bbrk24 commented 1 month ago

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.