From 8968a8576784d73b1628b0f36ecd2df274336c0e Mon Sep 17 00:00:00 2001 From: lorenzo Date: Thu, 28 Sep 2017 14:50:38 +0300 Subject: [PATCH 1/4] eslint arrow-spacing --- .eslintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index e5213b61765..9b6e2958d6e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -239,6 +239,7 @@ }], // http://eslint.org/docs/rules/space-before-function-paren "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops "space-in-parens": [2, "never"], // http://eslint.org/docs/rules/space-in-parens - "spaced-comment": [2, "always"] // http://eslint.org/docs/rules/spaced-comment + "spaced-comment": [2, "always"], // http://eslint.org/docs/rules/spaced-comment + "arrow-spacing": [2, { "before": true, "after": true }] // https://eslint.org/docs/rules/arrow-spacing } } From b80efbd462121daa107e0416d9b548c112977c1d Mon Sep 17 00:00:00 2001 From: lorenzo Date: Thu, 28 Sep 2017 21:57:00 +0300 Subject: [PATCH 2/4] linted new rule --- .../plugins/core/accounts/client/components/loginButtons.js | 2 +- .../orders/client/__tests__/components/orderSummary.spec.js | 4 ++-- .../plugins/core/orders/client/components/invoiceActions.js | 2 +- .../plugins/core/orders/client/containers/invoiceContainer.js | 2 +- .../core/orders/client/templates/workflow/shippingInvoice.js | 2 +- imports/plugins/core/router/client/startup.js | 2 +- imports/plugins/included/shippo/server/jobs/shippo.js | 2 +- .../plugins/included/ui-search/lib/components/searchModal.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/imports/plugins/core/accounts/client/components/loginButtons.js b/imports/plugins/core/accounts/client/components/loginButtons.js index bd242028a5e..911ba2dfdfd 100644 --- a/imports/plugins/core/accounts/client/components/loginButtons.js +++ b/imports/plugins/core/accounts/client/components/loginButtons.js @@ -12,7 +12,7 @@ class LoginButtons extends Component { } renderLoginButtons() { - const enabledServices = this.props.loginServices().filter((service) =>{ + const enabledServices = this.props.loginServices().filter((service) => { return service.enabled; }); diff --git a/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js b/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js index 794adbbf25b..b21bfd3e020 100644 --- a/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js +++ b/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js @@ -27,8 +27,8 @@ test("OrderSummary snapshot test", () => { // Initializing all the props passed into order summary component const dateFormat = jest.fn(); const tracking = jest.fn(); - const shipmentStatus = jest.fn(()=>({})); - const printableLabels = jest.fn(()=>({})); + const shipmentStatus = jest.fn(() =>({})); + const printableLabels = jest.fn(() =>({})); const profileShippingAddress = {}; const order = { shipping: [{ shipmentMethod: {} }], diff --git a/imports/plugins/core/orders/client/components/invoiceActions.js b/imports/plugins/core/orders/client/components/invoiceActions.js index f73839903c0..dbc618f63d1 100644 --- a/imports/plugins/core/orders/client/components/invoiceActions.js +++ b/imports/plugins/core/orders/client/components/invoiceActions.js @@ -95,7 +95,7 @@ class InvoiceActions extends Component { amount: true } }} - onChange={(event, data)=>{ + onChange={(event, data) => { this.setState({ value: data.numberValue }); diff --git a/imports/plugins/core/orders/client/containers/invoiceContainer.js b/imports/plugins/core/orders/client/containers/invoiceContainer.js index 3b8c59ff46e..a400233213f 100644 --- a/imports/plugins/core/orders/client/containers/invoiceContainer.js +++ b/imports/plugins/core/orders/client/containers/invoiceContainer.js @@ -285,7 +285,7 @@ class InvoiceContainer extends Component { cancelButtonColor: "#98afbc", confirmButtonText: i18next.t("order.cancelOrderNoRestock"), cancelButtonText: i18next.t("order.cancelOrderThenRestock") - }, (isConfirm, cancel)=> { + }, (isConfirm, cancel) => { let returnToStock; if (isConfirm) { returnToStock = false; diff --git a/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js b/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js index 5b11c3e91e4..fcb903e901a 100644 --- a/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js +++ b/imports/plugins/core/orders/client/templates/workflow/shippingInvoice.js @@ -153,7 +153,7 @@ Template.coreOrderShippingInvoice.events({ cancelButtonColor: "#98afbc", confirmButtonText: i18next.t("order.cancelOrderNoRestock"), cancelButtonText: i18next.t("order.cancelOrderThenRestock") - }, (isConfirm, cancel)=> { + }, (isConfirm, cancel) => { let returnToStock; if (isConfirm) { returnToStock = false; diff --git a/imports/plugins/core/router/client/startup.js b/imports/plugins/core/router/client/startup.js index 91bbe48b360..c4c42b18670 100644 --- a/imports/plugins/core/router/client/startup.js +++ b/imports/plugins/core/router/client/startup.js @@ -19,7 +19,7 @@ Meteor.startup(function () { // Otherwise initBrowserRouter is called twice each time a Reaction.Subscriptions.Packages.ready() and // Reaction.Subscriptions.PrimaryShop.ready() are true - Tracker.nonreactive(()=> { + Tracker.nonreactive(() => { initBrowserRouter(); }); } diff --git a/imports/plugins/included/shippo/server/jobs/shippo.js b/imports/plugins/included/shippo/server/jobs/shippo.js index 1f6bea9ea0c..ddfe2762bb1 100644 --- a/imports/plugins/included/shippo/server/jobs/shippo.js +++ b/imports/plugins/included/shippo/server/jobs/shippo.js @@ -62,7 +62,7 @@ export default function () { // As this is run by the Server and we don't have userId()/this.userId // which "shippo/fetchTrackingStatusForOrders" need, we use dispatch:run-as-user // An alternative way is https://forums.meteor.com/t/cant-set-logged-in-user-for-rest-calls/18656/3 - Meteor.runAsUser(ownerId, ()=> { + Meteor.runAsUser(ownerId, () => { Meteor.call("shippo/fetchTrackingStatusForOrders", error => { if (error) { job.done(error.toString(), { repeatId: true }); diff --git a/imports/plugins/included/ui-search/lib/components/searchModal.js b/imports/plugins/included/ui-search/lib/components/searchModal.js index 48c207e6dec..119e36be383 100644 --- a/imports/plugins/included/ui-search/lib/components/searchModal.js +++ b/imports/plugins/included/ui-search/lib/components/searchModal.js @@ -90,7 +90,7 @@ class SearchModal extends Component {

Suggested tags

{this.props.tags.map((tag) => ( - this.props.handleTagClick(tag._id)}>{tag.name} + this.props.handleTagClick(tag._id)}>{tag.name} ))}
From bc1c095c4dd75a1856527ce6ea5bd86bade50948 Mon Sep 17 00:00:00 2001 From: Mike Murray Date: Thu, 28 Sep 2017 12:14:33 -0700 Subject: [PATCH 3/4] Fix lint issue --- imports/plugins/core/router/client/startup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imports/plugins/core/router/client/startup.js b/imports/plugins/core/router/client/startup.js index 47d7df0ffd1..544438b2710 100644 --- a/imports/plugins/core/router/client/startup.js +++ b/imports/plugins/core/router/client/startup.js @@ -25,7 +25,7 @@ Meteor.startup(function () { // initBrowserRouter calls Router.initPackageRoutes which calls shopSub.ready which is reactive, // So we have to call initBrowserRouter in a non reactive context. // Otherwise initBrowserRouter is called twice each time a subscription becomes "ready" - Tracker.nonreactive(()=> { + Tracker.nonreactive(() => { // Make sure we have shops before we try to make routes for them if (Array.isArray(shops) && shops.length) { initBrowserRouter(); From 0622c1b916b81df3c7c29ae8724a18d4fccec433 Mon Sep 17 00:00:00 2001 From: Spencer Norman Date: Thu, 28 Sep 2017 14:06:19 -0600 Subject: [PATCH 4/4] Fix arrow function linter issues Fixes 2 arrow function linter issues in jest test file --- .../orders/client/__tests__/components/orderSummary.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js b/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js index b21bfd3e020..81140e81fc9 100644 --- a/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js +++ b/imports/plugins/core/orders/client/__tests__/components/orderSummary.spec.js @@ -27,8 +27,8 @@ test("OrderSummary snapshot test", () => { // Initializing all the props passed into order summary component const dateFormat = jest.fn(); const tracking = jest.fn(); - const shipmentStatus = jest.fn(() =>({})); - const printableLabels = jest.fn(() =>({})); + const shipmentStatus = jest.fn(() => ({})); + const printableLabels = jest.fn(() => ({})); const profileShippingAddress = {}; const order = { shipping: [{ shipmentMethod: {} }],