eslint/typescript-eslint-parser

Missing visitor-keys

armano2 opened this issue · 4 comments

I did some checking what we can and what we are not able to visit and i found some missing stuff:

missing typeParameters

  • NewExpression - new foo<Foo>() #565
  • CallExpression - foo<Foo>() #565
  • TSAbstractClassDeclaration: #561 - abstract class Foo<Bar> {}

missing superTypeParameters

class foo extends bar<Foo>

  • ClassDeclaration: #561
  • ClassExpression: #561
  • TSAbstractClassDeclaration: #561

missing implements

class foo implements bar, class foo implements bar, baz

  • ClassDeclaration: #562
  • ClassExpression: #562
  • TSAbstractClassDeclaration: #562

missing import equals

import foo = require('foo')

  • TSImportEqualsDeclaration #571
    • name
    • moduleReference
  • TSExternalModuleReference #571
    • expression

invalid order:

  • TSAbstractClassProperty : #560
    • key
    • typeAnnotation
    • value

missing decorators:

  • TSAbstractClassProperty: #560
  • TSAbstractClassDeclaration #561

small update

@mysticatea i have question about implements do you think that it should be variable?

implements references to type -> interface which is type

No.

TypeScript has two namespaces: variables and types.

// Those are not redeclaration 
// because `interface` defines only in types and `const` defines only in variables.
interface A {}
const A = 0

// On the other hand, `class` defines in both types and variables.
class B {}

Then, the scopeManager doesn't have things of types namespace.
I think that we should provide a way to access types namespace, but we don't have it now.

ok, i was thinking correctly,

i just wanted to confirm that :)