ESLint rule for spaces in union types in TypeScript

Viewed 790

Is there an ESLint rule for TypeScript that allows enforcing using space in the following situation?

// good
let a: string | number = 4;

// bad
let a: string|number = 4;

The only stuff that might be helpful are type-annotation-spacing and space-infix-ops rules but they do not seem to work with union types.

2 Answers

Maybe not what you want, but won't eslint-plugin-prettier do this for you?

Related