Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

space-infix-ops: false positive for generics on type declarations #486

Closed
OliverJAsh opened this issue Jun 11, 2018 · 5 comments
Closed

Comments

@OliverJAsh
Copy link

What version of TypeScript are you using?
2.9.1

What version of typescript-eslint-parser are you using?
16.0.0

What code were you trying to parse?

With space-infix-ops rule enabled:

type Foo<T> = T;

What did you expect to happen?
No error.

What happened?
False positive for space-infix-ops.

  1:9  error  Infix operators must be spaced  space-infix-ops
@OliverJAsh
Copy link
Author

This also effects generics nested inside of constrained generics:

type Bar < T > = T;
type Foo < T extends Bar <any>> = T;
  2:26  error  Infix operators must be spaced  space-infix-ops

@zuzusik
Copy link

zuzusik commented Jul 8, 2018

I did a quick search over the code and looks like the support of GenericTypeAnnotation which was added here https://github.com/eslint/typescript-eslint-parser/pull/53/files#diff-6ecca2b7675f672f87297d93eec1e4baR479 was dropped at some point

I assume the fix would be get back the support of GenericTypeAnnotation

@madbence
Copy link

eslint/eslint#10935 fixed this i think (eslint@5.7.0), can you confirm @OliverJAsh ?

@joe-re
Copy link

joe-re commented Oct 25, 2018

This was fixed on my local to update eslint to 5.7.0. thanks!

@kaicataldo
Copy link
Member

It looks like this can be closed now that the space-infix-ops has been updated. 🎉

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

No branches or pull requests

6 participants