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

[type-annotation-spacing] fails in object types under different conditions #152

Closed
zuzusik opened this issue Aug 9, 2018 · 1 comment · Fixed by #174
Closed

[type-annotation-spacing] fails in object types under different conditions #152

zuzusik opened this issue Aug 9, 2018 · 1 comment · Fixed by #174
Labels
bug/incomplete rule parser bug bugs with typescript-eslint-parser / typescript-estree
Milestone

Comments

@zuzusik
Copy link

zuzusik commented Aug 9, 2018

rule config:

"typescript/type-annotation-spacing": ["error", {"before": true, "after": true}]

code:

class Some {
  // fails on every `:` inside object typing (expected)
  a : {some: string, other: {more: number}}; 

  // doesn't fail (not expected)
  someMethod : (args : {some: string, other: {more: number}}) => void; 

  // doesn't fail (not expected)
  doSomething(args : {some: string, other: {more: number}}) : void {}
}

// doesn't fail (not expected)
function some(args : {some: string, other: {more: number}}) : void {} 

// doesn't fail (not expected)
const a : {some: string, other: {more: number}} = {some: '1', other: {more: 2}};
@bradzacher
Copy link
Owner

This is a problem with how eslint traverses the tree that typescript-eslint-parser provides: eslint/typescript-eslint-parser#532 (comment)

@bradzacher bradzacher changed the title type-annotation-spacing fails in object types under different conditions [type-annotation-spacing] fails in object types under different conditions Nov 16, 2018
@bradzacher bradzacher added this to the 1.0.0 milestone Nov 19, 2018
armano2 added a commit to armano2/eslint-plugin-typescript that referenced this issue Nov 19, 2018
armano2 added a commit to armano2/eslint-plugin-typescript that referenced this issue Nov 20, 2018
@bradzacher bradzacher added the parser bug bugs with typescript-eslint-parser / typescript-estree label Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/incomplete rule parser bug bugs with typescript-eslint-parser / typescript-estree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants