Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Update react-scripts #247

Merged
merged 3 commits into from
Mar 7, 2019
Merged

Update react-scripts #247

merged 3 commits into from
Mar 7, 2019

Conversation

rajadain
Copy link
Contributor

@rajadain rajadain commented Mar 4, 2019

Overview

Updates react-scripts to improve infrastructure and ensure security with the latest version. Also updates eslint, which is a requirement of the new version of react-scripts we're now on. Also adds a browserslist item to package.json, another requirement.

Connects #236

Notes

The eslint upgrade introduced a number of failures:

$ eslint src/ --ext .js --ext .jsx
/usr/local/src/src/__tests__/utils.listItemCSV.tests.js
  36:49  error  There should be no line break before or after '='  operator-linebreak
  75:46  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/__tests__/utils.tests.js
  142:50  error  There should be no line break before or after '='  operator-linebreak
  161:36  error  There should be no line break before or after '='  operator-linebreak
  408:9   error  Expected no linebreak before this expression       implicit-arrow-linebreak

/usr/local/src/src/actions/auth.js
  47:48  error  There should be no line break before or after '='    operator-linebreak
  56:59  error  There should be no line break before or after '='    operator-linebreak
  82:54  error  '!==' should be placed at the beginning of the line  operator-linebreak

/usr/local/src/src/actions/facilityListDetails.js
  13:52  error  There should be no line break before or after '='  operator-linebreak
  21:58  error  There should be no line break before or after '='  operator-linebreak
  23:57  error  There should be no line break before or after '='  operator-linebreak
  25:61  error  There should be no line break before or after '='  operator-linebreak
  28:57  error  There should be no line break before or after '='  operator-linebreak
  30:56  error  There should be no line break before or after '='  operator-linebreak
  32:60  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/actions/filterOptions.js
  15:47  error  There should be no line break before or after '='  operator-linebreak
  18:48  error  There should be no line break before or after '='  operator-linebreak
  20:47  error  There should be no line break before or after '='  operator-linebreak
  22:51  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/actions/upload.js
  15:47  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/App.jsx
  46:16  error  Must use destructuring props assignment  react/destructuring-assignment

/usr/local/src/src/components/CellElement.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:62  error  Expected a line break before this closing brace     object-curly-newline
   27:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak
   32:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak
   37:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak
  126:23  error  Must use destructuring state assignment             react/destructuring-assignment
  144:35  error  `{item.matchName}` must be placed on a new line     react/jsx-one-expression-per-line
  147:38  error  `{item.matchAddress}` must be placed on a new line  react/jsx-one-expression-per-line
  157:35  error  `{item.itemName}` must be placed on a new line      react/jsx-one-expression-per-line
  160:38  error  `{item.itemAddress}` must be placed on a new line   react/jsx-one-expression-per-line
  185:23  error  Must use destructuring state assignment             react/destructuring-assignment
  203:35  error  `{item.matchName}` must be placed on a new line     react/jsx-one-expression-per-line
  206:38  error  `{item.matchAddress}` must be placed on a new line  react/jsx-one-expression-per-line
  216:35  error  `{item.itemName}` must be placed on a new line      react/jsx-one-expression-per-line
  219:38  error  `{item.itemAddress}` must be placed on a new line   react/jsx-one-expression-per-line

/usr/local/src/src/components/ContributeForm.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:46  error  Expected a line break before this closing brace     object-curly-newline
   62:16  error  Must use destructuring props assignment             react/destructuring-assignment
   83:9   error  Must use destructuring props assignment             react/destructuring-assignment
   88:16  error  Must use destructuring props assignment             react/destructuring-assignment
   93:36  error  Must use destructuring props assignment             react/destructuring-assignment
   95:30  error  Must use destructuring props assignment             react/destructuring-assignment
  115:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  119:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  131:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  163:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  202:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  274:13  error  Expected no linebreak before this expression        implicit-arrow-linebreak

/usr/local/src/src/components/ContributeFormSelectListToReplace.jsx
  48:13  error  A form label must be associated with a control      jsx-a11y/label-has-associated-control
  66:29  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/ContributeHeader.jsx
  34:54  error  `{' '}` must be placed on a new line  react/jsx-one-expression-per-line

/usr/local/src/src/components/ContributeTroubleshooting.jsx
  35:53  error  `{' '}` must be placed on a new line  react/jsx-one-expression-per-line

/usr/local/src/src/components/ControlledCheckboxInput.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:36  error  Expected a line break before this closing brace     object-curly-newline
  24:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/ControlledSelectInput.jsx
   2:8   error  Expected a line break after this opening brace   object-curly-newline
   2:38  error  Expected a line break before this closing brace  object-curly-newline
  30:9   error  Must use destructuring props assignment          react/destructuring-assignment

/usr/local/src/src/components/ErrorBoundary.jsx
  25:5   error  componentDidCatch should be placed after encodeErrorMessage  react/sort-comp
  36:9   error  Expected no linebreak before this expression                 implicit-arrow-linebreak
  39:13  error  Must use destructuring state assignment                      react/destructuring-assignment
  49:50  error  Must use destructuring state assignment                      react/destructuring-assignment
  55:16  error  Must use destructuring props assignment                      react/destructuring-assignment

/usr/local/src/src/components/FacilityDetailSidebar.jsx
    3:8   error  Expected a line break after this opening brace      object-curly-newline
    3:45  error  Expected a line break before this closing brace     object-curly-newline
   34:16  error  Must use destructuring props assignment             react/destructuring-assignment
   53:15  error  Must use destructuring props assignment             react/destructuring-assignment
   58:16  error  Must use destructuring props assignment             react/destructuring-assignment
   94:41  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  159:42  error  `, ` must be placed on a new line                   react/jsx-one-expression-per-line
  159:44  error  `{facilityLng}` must be placed on a new line        react/jsx-one-expression-per-line

/usr/local/src/src/components/FacilityDetailSidebarInfo.jsx
   8:5   error  Expected no linebreak before this expression        implicit-arrow-linebreak
  24:29  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FacilityListItems.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:38  error  Expected a line break before this closing brace     object-curly-newline
   57:16  error  Must use destructuring props assignment             react/destructuring-assignment
   61:16  error  Must use destructuring props assignment             react/destructuring-assignment
   86:37  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  147:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FacilityListItemsConfirmationTableRow.jsx
   41:13  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  168:13  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  170:13  error  Expected no linebreak before this expression  implicit-arrow-linebreak

/usr/local/src/src/components/FacilityListItemsDetailedTableRowCell.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:71  error  Expected a line break before this closing brace     object-curly-newline
  42:21  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FacilityListItemsErrorTableRow.jsx
   2:8   error  Expected a line break after this opening brace   object-curly-newline
   2:57  error  Expected a line break before this closing brace  object-curly-newline
  14:5   error  Expected no linebreak before this expression     implicit-arrow-linebreak
  21:5   error  'address' is missing in props validation         react/prop-types

/usr/local/src/src/components/FacilityListItemsMatchTableRow.jsx
   2:8   error  Expected a line break after this opening brace   object-curly-newline
   2:55  error  Expected a line break before this closing brace  object-curly-newline
  16:5   error  Expected no linebreak before this expression     implicit-arrow-linebreak
  23:5   error  'address' is missing in props validation         react/prop-types

/usr/local/src/src/components/FacilityListItemsTable.jsx
    2:8   error  Expected a line break after this opening brace   object-curly-newline
    2:47  error  Expected a line break before this closing brace  object-curly-newline
   65:9   error  Expected no linebreak before this expression     implicit-arrow-linebreak
   72:9   error  Expected no linebreak before this expression     implicit-arrow-linebreak
  244:13  error  Expected no linebreak before this expression     implicit-arrow-linebreak

/usr/local/src/src/components/FacilityListItemsTableRow.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:48  error  Expected a line break before this closing brace     object-curly-newline
  15:5   error  Expected no linebreak before this expression        implicit-arrow-linebreak
  28:5   error  'address' is missing in props validation            react/prop-types
  39:30  error  '?' should be placed at the beginning of the line   operator-linebreak
  65:25  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FacilityLists.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:38  error  Expected a line break before this closing brace     object-curly-newline
  23:16  error  Must use destructuring props assignment             react/destructuring-assignment
  27:16  error  Must use destructuring props assignment             react/destructuring-assignment
  63:41  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FacilityListsEmpty.jsx
  24:9  error  A form label must be associated with a control  jsx-a11y/label-has-associated-control

/usr/local/src/src/components/FacilityListsTable.jsx
  46:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FilterSidebar.jsx
   76:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
   93:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  105:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/FilterSidebarSearchTab.jsx
  196:37  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  201:37  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/LandingAlert.jsx
  22:29  error  Must use destructuring state assignment  react/destructuring-assignment
  38:48  error  `{' '}` must be placed on a new line     react/jsx-one-expression-per-line

/usr/local/src/src/components/LoginForm.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:45  error  Expected a line break before this closing brace     object-curly-newline
   44:16  error  Must use destructuring props assignment             react/destructuring-assignment
   70:52  error  `{' '}` must be placed on a new line                react/jsx-one-expression-per-line
   81:25  error  A form label must be associated with a control      jsx-a11y/label-has-associated-control
   95:25  error  A form label must be associated with a control      jsx-a11y/label-has-associated-control
  114:41  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/MapLayers.jsx
  15:25  error  Must use destructuring props assignment  react/destructuring-assignment

/usr/local/src/src/components/NavbarDropdown.jsx
  60:13  error  Expected no linebreak before this expression  implicit-arrow-linebreak

/usr/local/src/src/components/OARMap.jsx
    2:8   error  Expected a line break after this opening brace   object-curly-newline
    2:53  error  Expected a line break before this closing brace  object-curly-newline
  196:16  error  Must use destructuring props assignment          react/destructuring-assignment
  200:9   error  Expected no linebreak before this expression     implicit-arrow-linebreak
  265:15  error  Must use destructuring props assignment          react/destructuring-assignment
  316:33  error  Must use destructuring state assignment          react/destructuring-assignment
  318:37  error  Must use destructuring state assignment          react/destructuring-assignment
  321:45  error  Must use destructuring props assignment          react/destructuring-assignment

/usr/local/src/src/components/OARMapPopup.jsx
  66:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/RegisterForm.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:45  error  Expected a line break before this closing brace     object-curly-newline
   59:16  error  Must use destructuring props assignment             react/destructuring-assignment
   78:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
   90:58  error  '&&' should be placed at the beginning of the line  operator-linebreak
   98:45  error  `{' '}` must be placed on a new line                react/jsx-one-expression-per-line
  180:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak

/usr/local/src/src/components/RegisterFormField.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:63  error  Expected a line break before this closing brace     object-curly-newline
  32:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/ResetPasswordForm.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:38  error  Expected a line break before this closing brace     object-curly-newline
   35:9   error  Must use destructuring props assignment             react/destructuring-assignment
   36:16  error  Must use destructuring props assignment             react/destructuring-assignment
   40:16  error  Must use destructuring props assignment             react/destructuring-assignment
   79:25  error  A form label must be associated with a control      jsx-a11y/label-has-associated-control
   93:25  error  A form label must be associated with a control      jsx-a11y/label-has-associated-control
  111:41  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  182:13  error  Expected no linebreak before this expression        implicit-arrow-linebreak
  184:13  error  Expected no linebreak before this expression        implicit-arrow-linebreak
  186:13  error  Expected no linebreak before this expression        implicit-arrow-linebreak

/usr/local/src/src/components/SendResetPasswordEmailForm.jsx
   3:8   error  Expected a line break after this opening brace      object-curly-newline
   3:38  error  Expected a line break before this closing brace     object-curly-newline
  34:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/components/ShowOnly.jsx
  12:46  error  `{children}` must be placed on a new line  react/jsx-one-expression-per-line

/usr/local/src/src/components/StaticMap.jsx
  23:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak

/usr/local/src/src/components/TablePaginationWrapper.jsx
  11:9   error  Must use destructuring props assignment  react/destructuring-assignment
  15:9   error  Must use destructuring props assignment  react/destructuring-assignment
  15:40  error  Must use destructuring props assignment  react/destructuring-assignment
  19:9   error  Must use destructuring props assignment  react/destructuring-assignment
  19:40  error  Must use destructuring props assignment  react/destructuring-assignment
  23:9   error  Must use destructuring props assignment  react/destructuring-assignment
  27:27  error  Must use destructuring props assignment  react/destructuring-assignment
  27:46  error  Must use destructuring props assignment  react/destructuring-assignment

/usr/local/src/src/components/Translate.jsx
  59:41  error  Expected no linebreak before this expression  implicit-arrow-linebreak

/usr/local/src/src/components/UserAPITokens.jsx
   3:8   error  Expected a line break after this opening brace      object-curly-newline
   3:38  error  Expected a line break before this closing brace     object-curly-newline
  41:16  error  Must use destructuring props assignment             react/destructuring-assignment
  45:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak
  48:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak
  51:9   error  Must use destructuring props assignment             react/destructuring-assignment
  72:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  76:33  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  84:17  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  99:23  error  Must use destructuring state assignment             react/destructuring-assignment

/usr/local/src/src/components/UserProfile.jsx
    2:8   error  Expected a line break after this opening brace      object-curly-newline
    2:36  error  Expected a line break before this closing brace     object-curly-newline
   98:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines
  107:57  error  '&&' should be placed at the beginning of the line  operator-linebreak
  181:9   error  Expected no linebreak before this expression        implicit-arrow-linebreak

/usr/local/src/src/components/UserProfileField.jsx
   2:8   error  Expected a line break after this opening brace      object-curly-newline
   2:45  error  Expected a line break before this closing brace     object-curly-newline
  34:13  error  Parentheses around JSX should be on separate lines  react/jsx-wrap-multilines

/usr/local/src/src/reducers/FacilityListDetailsReducer.js
  71:36  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/util/constants.js
  174:37  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/util/propTypes.js
    1:8   error  Expected a line break after this opening brace     object-curly-newline
    1:71  error  Expected a line break before this closing brace    object-curly-newline
   29:9   error  Expected no linebreak before this expression       implicit-arrow-linebreak
   40:9   error  Expected no linebreak before this expression       implicit-arrow-linebreak
   45:9   error  Expected no linebreak before this expression       implicit-arrow-linebreak
  161:46  error  There should be no line break before or after '='  operator-linebreak

/usr/local/src/src/util/util.js
   45:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
   48:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  249:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  252:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  293:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  306:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  314:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  329:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  332:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  335:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  338:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak
  341:5  error  Expected no linebreak before this expression  implicit-arrow-linebreak

/usr/local/src/src/util/withQueryStringSync.jsx
  12:33  error  Useless path segments for "../util/propTypes", should be "./propTypes"  import/no-useless-path-segments
  17:8   error  Useless path segments for "../util/util", should be "./util"            import/no-useless-path-segments
  63:20  error  Must use destructuring props assignment                                 react/destructuring-assignment

✖ 213 problems (213 errors, 0 warnings)
  160 errors and 0 warnings potentially fixable with the `--fix` option.

These errors will be fixed in #251.

Testing Instructions

@rajadain rajadain changed the title Tt/update react scripts Update react-scripts Mar 5, 2019
@rajadain rajadain requested a review from kellyi March 5, 2019 17:46
@rajadain rajadain marked this pull request as ready for review March 5, 2019 17:46
@kellyi
Copy link
Contributor

kellyi commented Mar 5, 2019

Setting this up!

@kellyi
Copy link
Contributor

kellyi commented Mar 5, 2019

There is a minor issue on my machine where the map won't render full-height until the window is resized. If this is replicated, we can make an issue for that. This only happens in dev-server, not in the production build.

I was able to reproduce this problem in development and it's happening in both Chrome and Firefox. Everything else is working.

I think it probably makes sense to try to fix the map styling problem here if that's possible rather than making a new issue for it, since it was working prior to the upgrade and it potentially hinders continued continued development until it's remedied.

@rajadain
Copy link
Contributor Author

rajadain commented Mar 5, 2019

Thanks for confirming it's real. Taking a look now.

@rajadain
Copy link
Contributor Author

rajadain commented Mar 5, 2019

The styling issue seems to be a bug in react-scripts 2.1.4 and 2.1.5: facebook/create-react-app#6399. Seems to have been fixed, will be released in 2.1.6, but in the interim the recommended solution is to downgrade to 2.1.3. I'm downgrading now.

@rajadain rajadain force-pushed the tt/update-react-scripts branch 2 times, most recently from 0240909 to cd65bf2 Compare March 5, 2019 19:57
@rajadain
Copy link
Contributor Author

rajadain commented Mar 5, 2019

Cool, I think this works correctly now. Ready for another look.

@kellyi
Copy link
Contributor

kellyi commented Mar 5, 2019

Heads up that there's a merge conflict -- I made some changes to package.json in #237

@rajadain
Copy link
Contributor Author

rajadain commented Mar 6, 2019

Rebased on develop. Ready for another look!

Copy link
Contributor

@kellyi kellyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kellyi
Copy link
Contributor

kellyi commented Mar 6, 2019

Oh wait, just one quick comment: json2csv is no longer used in the app, so consider removing before merging.

src/app/package.json Outdated Show resolved Hide resolved
@kellyi kellyi removed their assignment Mar 6, 2019
This more recent version of react-scripts includes securty
updates, but also requires newer versions of eslint, as well
as the new browserslist key in package.json, which are currently
filled with default values.

The very latest version of react-script, 2.1.5, has a bug
that causes styles to not load correctly in the development
envrionment facebook/create-react-app#6399, so we use the
most recent version without that bug, namely 2.1.3.
With the eslint upgrades come new eslint rules, but we don't
have the bandwidth to correct the 213 reported errors. Thus,
these new rules are disabled for the next few days, after
which we hope to find the time to return, reverse this commit,
and fix the lint issues.
This isn't used anywhere anymore.
@rajadain rajadain merged commit 0d1003c into develop Mar 7, 2019
@rajadain rajadain deleted the tt/update-react-scripts branch March 7, 2019 18:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants