-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
@uniqueiniquity i installed package as "typescript-eslint-parser": "git+https://github.com/uniqueiniquity/typescript-eslint-parser.git#0625f29a9721c6f10a7522de6c9d236a671bd1ac" |
I will probably leave this as-is and re-run the tests when the parser gets updated. |
!context.parserServices.program | ||
) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does context.parserServices.program
exist when create
is first called, as implied by #230? If so, could you...
- ...return an empty object instead of one with
ForInStatement
? - ...move the
checker = context...getTypechecker()
call to outside this returned function?
The two would be nice as precedent for other rules that would have multiple methods using the type checker.
Apologies if this is well known; I'm very new to ESLint. 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use https://github.com/bradzacher/eslint-plugin-typescript/blob/master/lib/util.js#L114
you need access to context
and context is parameter of function create(context)
!context.parserServices.program | ||
) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TSLint will warn for each rule enabled that requires type information when it's not provided. Should there be some standard way for these to warn in a similar manner? Would that be a separate issue from this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraDescription
)../utils
.Adding equivalent of TSLint's
no-for-in-array
. Depends on eslint/typescript-eslint-parser#568 for type information.