Skip to content

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 19, 2017

This PR fixes 2 problems observed while running against Facebook code:

  • Avoids adding duplicate prop-types imports/requires if they already exist. (eg maybe the codemod was already run and then a regression slipped in.)
  • Make sure import type doesn't give false-positives when it comes to determining whether a given file uses import or require syntax.

Tests added for both fixes.

@bvaughn bvaughn requested review from acdlite and flarnie July 19, 2017 17:18
@bvaughn bvaughn requested a review from gaearon July 19, 2017 17:38
@bvaughn bvaughn changed the title PropTypes codemod handles partially modded files Edge-case fixes for PropTypes codemod Jul 19, 2017
@bvaughn bvaughn merged commit 4a55655 into reactjs:master Jul 19, 2017
@bvaughn bvaughn deleted the better-handle-partially-migrated-files branch July 19, 2017 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants