-
-
Notifications
You must be signed in to change notification settings - Fork 75
Fix: Label Functions and Methods declartions as Ambient (fixes #162) #163
Conversation
LGTM |
I noticed in FunctionDeclaration we use the type DeclareFunction when defining ambient function. Should we use TSAmbientFunctionDeclaration as well? |
8923062
to
da6769e
Compare
LGTM |
I made the change for the node DeclareFunction. It is now TSAmbientFunctionDeclaration to make it align with this pull request. At the very least we should prefix it with TS unless there is another rule that uses DeclareFunction. |
…#162) Ambient functions do not have a body and will cuase rules to throw an excpetion. We use the types TSAmbientFunctionExpression and TSAmbientMethoDeclaration.
da6769e
to
aa1c276
Compare
LGTM |
When I looked at the test output of this |
@Pajn Yes we do need to label ambient classes. I was thinking of changing the type from Class to TSAmbientClass this way some eslint rules won't crash as they are not aware of empty body methods, which declared classes all have. This would break current linting rules that are meant for classes but it is better then having the crash. |
I'm so sorry it's taken so long to address these PRs @soda0289, so happy to have you on the team now! Let's take stock as soon as we merge in all the breaking changes and release v3! |
Ambient functions do not have a body and will cuase rules to throw
an exception. We use the types TSAmbientFunctionExpression and
TSAmbientMethodDefinition.