From 8c123618f660bc8dd9a7c4d18b6f8a56ede0bc09 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2020 20:31:29 +0000 Subject: [PATCH 1/2] Bump prettier from 1.19.1 to 2.0.2 in /app Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.0.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/1.19.1...2.0.2) Signed-off-by: dependabot-preview[bot] --- app/package.json | 2 +- app/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/package.json b/app/package.json index 59b412c552..2d45e436da 100644 --- a/app/package.json +++ b/app/package.json @@ -38,7 +38,7 @@ "immutable": "4.0.0-rc.12", "jquery": "3.4.1", "popper.js": "1.16.1", - "prettier": "1.19.1", + "prettier": "2.0.2", "react": "16.13.1", "react-bootstrap": "1.0.0", "react-dom": "16.13.1", diff --git a/app/yarn.lock b/app/yarn.lock index 30a480577f..70cc02e3ef 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -6402,10 +6402,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08" + integrity sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg== pretty-format@^25.1.0: version "25.1.0" From f2554563834d173b4ed4653738e4fa9c3557be26 Mon Sep 17 00:00:00 2001 From: Jared Lockhart <119884+jaredlockhart@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:18:36 -0400 Subject: [PATCH 2/2] Re-lintjs with new prettier settings --- .../static/js/components/AddonForm.js | 4 ++-- .../static/js/components/Branch.js | 2 +- .../static/js/components/BranchManager.js | 6 ++--- .../static/js/components/DesignForm.js | 2 +- .../static/js/components/DesignInput.js | 2 +- .../static/js/components/GenericForm.js | 2 +- .../js/components/LabeledMultiSelect.js | 2 +- .../js/components/MultiPrefBranchFields.js | 4 ++-- app/experimenter/static/js/components/Pref.js | 8 +++---- .../static/js/components/PrefForm.js | 8 +++---- .../static/js/components/PrefManager.js | 2 +- .../static/js/components/RolloutForm.js | 10 ++++----- .../static/js/components/TimelinePopForm.js | 22 +++++++++---------- .../static/js/tests/AddonForm.test.js | 2 +- .../static/js/tests/GenericForm.test.js | 2 +- app/experimenter/static/js/tests/factory.js | 2 +- 16 files changed, 40 insertions(+), 40 deletions(-) diff --git a/app/experimenter/static/js/components/AddonForm.js b/app/experimenter/static/js/components/AddonForm.js index 7eb465f0b5..86996e7f45 100644 --- a/app/experimenter/static/js/components/AddonForm.js +++ b/app/experimenter/static/js/components/AddonForm.js @@ -26,7 +26,7 @@ export default class AddonForm extends React.PureComponent { label="Signed Add-On URL" name="addon_release_url" dataTestId="addonUrl" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("addon_release_url", value); }} value={this.props.data.get("addon_release_url")} @@ -51,7 +51,7 @@ export default class AddonForm extends React.PureComponent { radioLabel2="Multiple add-ons" radioValue1={false} radioValue2={true} - onChange={event => + onChange={(event) => this.props.handleDataChange( "is_branched_addon", event.target.value === "true", diff --git a/app/experimenter/static/js/components/Branch.js b/app/experimenter/static/js/components/Branch.js index 7281e918a7..e9646dfcc0 100644 --- a/app/experimenter/static/js/components/Branch.js +++ b/app/experimenter/static/js/components/Branch.js @@ -43,7 +43,7 @@ class Branch extends React.PureComponent { name={`variants[${this.props.index}][${name}]`} id={`variants-${this.props.index}-${name}`} value={value} - onChange={value => { + onChange={(value) => { this.handleBranchFieldChange(name, value); }} error={error} diff --git a/app/experimenter/static/js/components/BranchManager.js b/app/experimenter/static/js/components/BranchManager.js index 73b8208863..b4f20ef103 100644 --- a/app/experimenter/static/js/components/BranchManager.js +++ b/app/experimenter/static/js/components/BranchManager.js @@ -57,14 +57,14 @@ class BranchManager extends React.PureComponent { index={index} branch={branch} branchFieldsComponent={branchFieldsComponent} - remove={index => { + remove={(index) => { this.removeBranch(index); }} errors={errors.get(index, new Map())} - onChange={value => { + onChange={(value) => { this.handleBranchChange(index, value); }} - onErrorChange={errors => { + onErrorChange={(errors) => { this.handleBranchErrorChange(index, errors); }} /> diff --git a/app/experimenter/static/js/components/DesignForm.js b/app/experimenter/static/js/components/DesignForm.js index de6724cc11..a1ee258c74 100644 --- a/app/experimenter/static/js/components/DesignForm.js +++ b/app/experimenter/static/js/components/DesignForm.js @@ -131,7 +131,7 @@ class DesignForm extends React.PureComponent { .then(() => { location.replace(redirectUrl); }) - .catch(err => { + .catch((err) => { this.setState({ errors: fromJS(err.data), }); diff --git a/app/experimenter/static/js/components/DesignInput.js b/app/experimenter/static/js/components/DesignInput.js index 284aa8e4b2..5f0ab3546f 100644 --- a/app/experimenter/static/js/components/DesignInput.js +++ b/app/experimenter/static/js/components/DesignInput.js @@ -117,7 +117,7 @@ class DesignInput extends React.PureComponent { data-testid={this.props.dataTestId} type={this.props.type ? this.props.type : "text"} name={this.props.name} - onChange={event => { + onChange={(event) => { this.props.onChange(event.target.value); }} value={this.props.value} diff --git a/app/experimenter/static/js/components/GenericForm.js b/app/experimenter/static/js/components/GenericForm.js index d707981380..d23ec91353 100644 --- a/app/experimenter/static/js/components/GenericForm.js +++ b/app/experimenter/static/js/components/GenericForm.js @@ -22,7 +22,7 @@ export default class GenericForm extends React.PureComponent { label="Design" name="design" dataTestId="design" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("design", value); }} value={this.props.data.get("design")} diff --git a/app/experimenter/static/js/components/LabeledMultiSelect.js b/app/experimenter/static/js/components/LabeledMultiSelect.js index 4d41f05b6e..8259b3abca 100644 --- a/app/experimenter/static/js/components/LabeledMultiSelect.js +++ b/app/experimenter/static/js/components/LabeledMultiSelect.js @@ -89,7 +89,7 @@ class LabeledMultiSelect extends React.PureComponent { name={this.props.name} value={this.props.value} className={this.props.error ? "is-invalid" : ""} - onChange={selection => { + onChange={(selection) => { this.props.onChange(selection, this.props.name); }} /> diff --git a/app/experimenter/static/js/components/MultiPrefBranchFields.js b/app/experimenter/static/js/components/MultiPrefBranchFields.js index e004edae86..2d7f1cbe73 100644 --- a/app/experimenter/static/js/components/MultiPrefBranchFields.js +++ b/app/experimenter/static/js/components/MultiPrefBranchFields.js @@ -53,10 +53,10 @@ class MultiPrefBranchFields extends React.PureComponent { { + onDataChange={(value) => { this.props.onChange("preferences", value); }} - onErrorChange={errors => { + onErrorChange={(errors) => { this.props.onErrorChange("preferences", errors); }} variantIndex={this.props.index} diff --git a/app/experimenter/static/js/components/Pref.js b/app/experimenter/static/js/components/Pref.js index f234a69c18..3f60a596ae 100644 --- a/app/experimenter/static/js/components/Pref.js +++ b/app/experimenter/static/js/components/Pref.js @@ -72,7 +72,7 @@ class Pref extends React.PureComponent { label="Pref Branch" name="pref_branch" id={`pref-branch-${this.props.variantIndex}-${this.props.index}`} - onChange={value => { + onChange={(value) => { this.handlePrefValueChange("pref_branch", value); }} value={ @@ -103,7 +103,7 @@ class Pref extends React.PureComponent { label="Pref Type" name="pref_type" id={`pref-type-${this.props.variantIndex}-${this.props.index}`} - onChange={value => { + onChange={(value) => { this.handlePrefValueChange("pref_type", value); }} value={ @@ -130,7 +130,7 @@ class Pref extends React.PureComponent { label="Pref Name" name="pref_name" id={`pref-key-${this.props.variantIndex}-${this.props.index}`} - onChange={value => { + onChange={(value) => { this.handlePrefValueChange("pref_name", value); }} value={ @@ -149,7 +149,7 @@ class Pref extends React.PureComponent { label="Pref Value" name="pref_value" id={`pref-value-${this.props.variantIndex}-${this.props.index}`} - onChange={value => { + onChange={(value) => { this.handlePrefValueChange("pref_value", value); }} value={ diff --git a/app/experimenter/static/js/components/PrefForm.js b/app/experimenter/static/js/components/PrefForm.js index c4a2d342a5..d61409cd3d 100644 --- a/app/experimenter/static/js/components/PrefForm.js +++ b/app/experimenter/static/js/components/PrefForm.js @@ -32,7 +32,7 @@ export default class PrefForm extends React.PureComponent { label="Pref Name" name="pref_name" id="id_pref_name" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("pref_name", value); }} value={this.props.data.get("pref_name")} @@ -45,7 +45,7 @@ export default class PrefForm extends React.PureComponent { label="Pref Type" name="pref_type" id="id_pref_type" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("pref_type", value); }} value={this.props.data.get("pref_type")} @@ -65,7 +65,7 @@ export default class PrefForm extends React.PureComponent { label="Pref Branch" name="pref_branch" id="id_pref_branch" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("pref_branch", value); }} value={this.props.data.get("pref_branch")} @@ -97,7 +97,7 @@ export default class PrefForm extends React.PureComponent { radioLabel2="Different Prefs per branch" radioValue1={false} radioValue2={true} - onChange={event => { + onChange={(event) => { this.props.handleReloadAPIState( "is_multi_pref", event.target.value === "true", diff --git a/app/experimenter/static/js/components/PrefManager.js b/app/experimenter/static/js/components/PrefManager.js index 0c0decec22..fde6c4e08c 100644 --- a/app/experimenter/static/js/components/PrefManager.js +++ b/app/experimenter/static/js/components/PrefManager.js @@ -47,7 +47,7 @@ class PrefManager extends React.PureComponent { preference={preference} errors={errors.get(index, new Map())} remove={this.removePref} - onChange={value => this.handlePrefChange(index, value)} + onChange={(value) => this.handlePrefChange(index, value)} variantIndex={this.props.variantIndex} rolloutType={this.props.rolloutType} /> diff --git a/app/experimenter/static/js/components/RolloutForm.js b/app/experimenter/static/js/components/RolloutForm.js index e1d9417a32..e633370297 100644 --- a/app/experimenter/static/js/components/RolloutForm.js +++ b/app/experimenter/static/js/components/RolloutForm.js @@ -29,7 +29,7 @@ export default class RolloutForm extends React.PureComponent { id="id_addon_release_url" label="Signed Add-On URL" name="addon_release_url" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("addon_release_url", value); }} value={this.props.data.get("addon_release_url")} @@ -50,10 +50,10 @@ export default class RolloutForm extends React.PureComponent { { + onDataChange={(value) => { this.props.handleDataChange("preferences", value); }} - onErrorChange={errors => { + onErrorChange={(errors) => { this.props.handleErrorsChange("preferences", errors); }} rolloutType={this.props.data.get("rollout_type")} @@ -75,7 +75,7 @@ export default class RolloutForm extends React.PureComponent { radioLabel2="Add-On Rollout" radioValue1={TYPE_PREF} radioValue2={TYPE_ADDON} - onChange={event => + onChange={(event) => this.props.handleReloadAPIState( "rollout_type", event.target.value, @@ -90,7 +90,7 @@ export default class RolloutForm extends React.PureComponent { id="id_design" label="Description" name="design" - onChange={value => { + onChange={(value) => { this.props.handleDataChange("design", value); }} value={this.props.data.get("design")} diff --git a/app/experimenter/static/js/components/TimelinePopForm.js b/app/experimenter/static/js/components/TimelinePopForm.js index dbc0673c22..624d3c0028 100644 --- a/app/experimenter/static/js/components/TimelinePopForm.js +++ b/app/experimenter/static/js/components/TimelinePopForm.js @@ -85,7 +85,7 @@ class TimelinePopForm extends React.PureComponent { label="Population Percentage" name="population_percent" id="id_population_percent" - onChange={value => { + onChange={(value) => { this.handleDataChange("population_percent", value); }} value={this.state.data.get("population_percent")} @@ -104,7 +104,7 @@ class TimelinePopForm extends React.PureComponent { label="Proposed Enrollment Duration (days)" name="proposed_enrollment" id="id_proposed_enrollment" - onChange={value => { + onChange={(value) => { this.handleDataChange("proposed_enrollment", value); }} value={this.state.data.get("proposed_enrollment")} @@ -125,7 +125,7 @@ class TimelinePopForm extends React.PureComponent { label="Rollout Playbook" name="rollout_playbook" id="id_rollout_playbook" - onChange={value => { + onChange={(value) => { this.handleDataChange("rollout_playbook", value); }} value={this.state.data.get("rollout_playbook")} @@ -163,7 +163,7 @@ class TimelinePopForm extends React.PureComponent { .then(() => { location.replace(redirectUrl); }) - .catch(err => { + .catch((err) => { this.setState({ errors: fromJS(err.data), }); @@ -212,7 +212,7 @@ class TimelinePopForm extends React.PureComponent { label="Proposed Start Date" name="proposed_start_date" id="id_proposed_start_date" - onChange={value => { + onChange={(value) => { this.handleDataChange("proposed_start_date", value); }} value={this.state.data.get("proposed_start_date")} @@ -224,7 +224,7 @@ class TimelinePopForm extends React.PureComponent { label="Proposed Total Duration (days)" name="proposed_duration" id="id_proposed_duration" - onChange={value => { + onChange={(value) => { this.handleDataChange("proposed_duration", value); }} value={this.state.data.get("proposed_duration")} @@ -244,7 +244,7 @@ class TimelinePopForm extends React.PureComponent { label="Firefox Channel" name="firefox_channel" id="id_firefox_channel" - onChange={value => { + onChange={(value) => { this.handleDataChange("firefox_channel", value); }} value={this.state.data.get("firefox_channel")} @@ -265,7 +265,7 @@ class TimelinePopForm extends React.PureComponent { label="Firefox Min Version" name="firefox_min_version" id="id_firefox_min_version" - onChange={value => { + onChange={(value) => { this.handleDataChange("firefox_min_version", value); }} value={this.state.data.get("firefox_min_version")} @@ -283,7 +283,7 @@ class TimelinePopForm extends React.PureComponent { label="Firefox Max Version" name="firefox_max_version" id="id_firefox_max_version" - onChange={value => { + onChange={(value) => { this.handleDataChange("firefox_max_version", value); }} value={this.state.data.get("firefox_max_version")} @@ -335,7 +335,7 @@ class TimelinePopForm extends React.PureComponent { label="Platform" name="platform" id="id_platform" - onChange={value => { + onChange={(value) => { this.handleDataChange("platform", value); }} value={this.state.data.get("platform")} @@ -353,7 +353,7 @@ class TimelinePopForm extends React.PureComponent { label="Population filtering" name="client_matching" id="id_client_matching" - onChange={value => { + onChange={(value) => { this.handleDataChange("client_matching", value); }} value={this.state.data.get("client_matching")} diff --git a/app/experimenter/static/js/tests/AddonForm.test.js b/app/experimenter/static/js/tests/AddonForm.test.js index f572869997..17edf06f26 100644 --- a/app/experimenter/static/js/tests/AddonForm.test.js +++ b/app/experimenter/static/js/tests/AddonForm.test.js @@ -85,7 +85,7 @@ describe("The `DesignForm` component for Addon", () => { for (let variant of successResponse.variants) { expect(getByDisplayValue(variant.name)).toBeInTheDocument(); expect(getByDisplayValue(variant.description)).toBeInTheDocument(); - getAllByDisplayValue(variant.ratio).map(e => + getAllByDisplayValue(variant.ratio).map((e) => expect(e).toBeInTheDocument(), ); } diff --git a/app/experimenter/static/js/tests/GenericForm.test.js b/app/experimenter/static/js/tests/GenericForm.test.js index 217d2e6829..042f0a3123 100644 --- a/app/experimenter/static/js/tests/GenericForm.test.js +++ b/app/experimenter/static/js/tests/GenericForm.test.js @@ -70,7 +70,7 @@ describe("The `DesignForm` component for generic", () => { for (let variant of successResponse.variants) { expect(getByDisplayValue(variant.name)).toBeInTheDocument(); expect(getByDisplayValue(variant.description)).toBeInTheDocument(); - getAllByDisplayValue(variant.ratio).map(e => + getAllByDisplayValue(variant.ratio).map((e) => expect(e).toBeInTheDocument(), ); } diff --git a/app/experimenter/static/js/tests/factory.js b/app/experimenter/static/js/tests/factory.js index 72651b98f2..6ebbec06b5 100644 --- a/app/experimenter/static/js/tests/factory.js +++ b/app/experimenter/static/js/tests/factory.js @@ -85,7 +85,7 @@ export class Factory { const fields = this.getFields(); - Object.keys(fields).forEach(key => { + Object.keys(fields).forEach((key) => { if (defaults[key]) { this.data[key] = defaults[key]; } else if (fields[key] instanceof Field) {