-
-
Notifications
You must be signed in to change notification settings - Fork 75
Breaking: Normalzie type parameters (fixes #197) #196
Conversation
Thanks for the pull request, @Pajn! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
The only known downstream consumer is https://github.com/nzakas/eslint-plugin-typescript. I am onboard with this change, I think we would have done it in the first place, but the |
Great! I will fix some tests then |
e88a9a4
to
7505189
Compare
LGTM |
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.
@Pajn please update this commit to follow the conventions for a breaking change http://eslint.org/docs/developer-guide/contributing/pull-requests
7505189
to
b243747
Compare
LGTM |
I updated the commit message. Is there anything else I should do as well? |
@Pajn Looks like the tests are failing. I'm pretty sure they were working before. Did you forget to push some changes? |
Hmm, maybe some other commit intervene. I'll rebase and fix them ASAP, might be next week though. |
And another #233 😄 |
b243747
to
26af67a
Compare
Sorry for not responding. I have been very busy with a move to a different city. |
LGTM |
Thanks, @Pajn! |
The
deeplyCopy
function does a great job of supporting strange TS nodes however I run in to a few where it would have been nice if it had normalized type arguments and type parameters just as for "supported" nodes.The nodes in question are
For type arguments:
For type parameters:
Now this do break some tests because previously such nodes were outputted as they appeared in the TypeScript AST and is therefore a breaking change. If this actually breaks anyone though is harder to tell, as far as I understand there aren't many TS specific Eslint rules around which could have been using these props. I have not updated any tests yet so you can see the breakage in the Travis logs.
Alternatives for doing this:
TypeScript have a lot of strange syntax so it's a risk that there are more types than the above listed. Specifically supporting these nodes would limit the impact on today unknown types. This would however likely plan out in me opening PRs to support these unknown nodes when I found them.
The
deeplyCopy
function already outputs enough to support these nodes without any change intypescript-eslint-parser
however that would require prettier to support both formats as supported nodes already are normalized.