Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

chore(deps): update dependency @netlify/eslint-config-node to ^2.2.7 #324

Merged
merged 3 commits into from Feb 15, 2021

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 15, 2021

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@netlify/eslint-config-node ^2.2.5 -> ^2.2.7 age adoption passing confidence

Release Notes

netlify/eslint-config-node

v2.2.7

Compare Source


Renovate configuration

馃搮 Schedule: At any time (no schedule defined).

馃殾 Automerge: Disabled by config. Please merge this manually once you are satisfied.

鈾伙笍 Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.

馃敃 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

@github-actions github-actions bot added the type: chore work needed to keep the product and development running smoothly label Feb 15, 2021
@@ -111,6 +111,7 @@ const waitForDeploy = async (api, deployId, siteId, timeout) => {
const getUploadList = (required, shaMap) => {
if (!required || !shaMap) return []
// TODO: use `Array.flatMap()` instead once we remove support for Node <11.0.0
// eslint-disable-next-line unicorn/prefer-spread
return [].concat(...required.map((sha) => shaMap[sha]))
Copy link
Contributor

@erezrokah erezrokah Feb 15, 2021

Choose a reason for hiding this comment

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

@ehmicky what do think about this change? I don't think array spread can be easily used to flatten arrays like concat.
However on Node.js >=11 Array.flat would be a better choice.

Copy link
Contributor

@ehmicky ehmicky Feb 15, 2021

Choose a reason for hiding this comment

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

The suggested change only works when the number of array to flattened is known (as in the examples in the PR). This is not the case for required above.
Specifically, [...required.map(...)] would not flatten arrays.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like required is an array of strings, not an array of arrays though.

const { id: deployId, required: requiredFiles, required_functions: requiredFns } = deploy

https://github.com/netlify/open-api/blob/master/swagger.yml#L2321

If that's the case, then the following should work:

  return required.map((sha) => shaMap[sha])

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe shaMap is a mapping between a string (sha) to an array of objects.
We would like to get a flattened array of all those objects.
Please correct me if I'm wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right!
Then we probably need to keep the current code as is.

@erezrokah erezrokah merged commit a2f9366 into master Feb 15, 2021
@erezrokah erezrokah deleted the renovate/netlify-packages branch February 15, 2021 15:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants