From f42fadf075a84f777be44fe2f6be6e17c47ca0f0 Mon Sep 17 00:00:00 2001 From: Sergio Cinos Date: Wed, 11 Nov 2020 11:26:17 +0100 Subject: [PATCH] Apply autofix for rule one-var --- .../event-countdown-block/blocks/src/view.js | 8 +- .../src/panel/indices-to-html/index.js | 8 +- .../src/panel/templates/actions.jsx | 3 +- .../src/panel/templates/block-user.jsx | 24 +- .../src/panel/templates/body.jsx | 4 +- .../panel/templates/comment-reply-input.jsx | 12 +- .../src/panel/templates/follow-link.jsx | 3 +- .../src/panel/templates/summary-in-single.jsx | 3 +- bin/build-metadata.js | 4 +- client/blocks/conversations/empty.jsx | 18 +- client/blocks/domain-to-plan-nudge/index.jsx | 6 +- client/blocks/edit-gravatar/test/index.jsx | 8 +- .../image-editor/image-editor-buttons.jsx | 4 +- .../blocks/image-editor/image-editor-crop.jsx | 52 ++-- client/blocks/image-editor/index.jsx | 8 +- .../test/image-editor-toolbar.jsx | 3 +- client/blocks/keyring-connect-button/index.js | 6 +- client/blocks/post-status/index.jsx | 4 +- .../custom-css.jsx | 12 +- .../customize-theme.jsx | 6 +- .../product-purchase-features-list/index.jsx | 4 +- .../test/product-purchase-features-list.jsx | 3 +- client/blocks/product-selector/index.jsx | 3 +- client/blocks/reader-avatar/index.jsx | 3 +- client/blocks/reader-post-card/index.jsx | 4 +- client/blocks/reader-post-card/photo.jsx | 3 +- client/blocks/signup-form/index.jsx | 14 +- client/components/chart/legend.jsx | 10 +- client/components/chart/x-axis.jsx | 4 +- .../data/query-user-purchases/index.jsx | 4 +- client/components/date-picker/index.jsx | 3 +- .../domain-registration-suggestion/index.jsx | 3 +- .../domains/domain-search-results/index.jsx | 3 +- .../with-contact-details-validation.jsx | 4 +- client/components/drop-zone/index.jsx | 6 +- client/components/drop-zone/test/index.jsx | 29 +- .../forms/counted-textarea/test/index.jsx | 4 +- client/components/forms/form-button/index.jsx | 4 +- .../forms/form-phone-input/index.jsx | 10 +- client/components/forms/range/index.jsx | 3 +- client/components/forms/range/test/index.jsx | 18 +- .../components/forms/sortable-list/index.jsx | 7 +- client/components/happiness-support/index.jsx | 4 +- client/components/happychat/functional.js | 3 +- client/components/infinite-list/index.jsx | 29 +- .../components/infinite-list/scroll-helper.js | 21 +- .../infinite-list/test/scroll-helper.js | 76 ++--- client/components/line-chart/index.js | 6 +- .../locale-suggestions/list-item.jsx | 4 +- .../cancel-purchase-form/index.jsx | 88 +++--- .../step-components/downgrade-step.jsx | 4 +- .../step-components/test/business-at-step.jsx | 3 +- client/components/phone-input/index.jsx | 14 +- client/components/phone-input/phone-number.js | 10 +- client/components/popover/menu.jsx | 4 +- client/components/post-schedule/clock.jsx | 3 +- client/components/rating/test/index.js | 14 +- client/components/resizable-iframe/index.jsx | 4 +- client/components/search/test/index.jsx | 3 +- .../components/section-nav/docs/example.jsx | 8 +- client/components/section-nav/item.jsx | 3 +- client/components/section-nav/test/index.jsx | 6 +- client/components/select-dropdown/index.jsx | 3 +- client/components/site-selector/index.jsx | 3 +- .../components/site-users-fetcher/index.jsx | 3 +- client/components/theme/test/index.jsx | 3 +- .../tinymce/plugins/embed/test/dialog.js | 3 +- .../plugins/simple-payments/dialog/index.jsx | 5 +- .../tinymce/plugins/wplink/plugin.js | 7 +- client/components/token-field/index.jsx | 12 +- client/components/token-field/test/index.jsx | 4 +- .../track-input-changes/test/index.jsx | 4 +- .../app/dashboard/manage-external-view.js | 20 +- .../lib/generate-variations/index.js | 5 +- .../views/label-settings/label-settings.js | 3 +- client/jetpack-connect/signup.js | 4 +- client/layout/masterbar/logged-in.jsx | 20 +- client/lib/abtest/index.js | 3 +- client/lib/accessible-focus/index.js | 4 +- client/lib/account-password-data/index.js | 12 +- .../lib/analytics/ad-tracking/record-order.js | 4 +- client/lib/cart-values/cart-items.js | 8 +- client/lib/cart-values/test/index.js | 123 ++++---- client/lib/cart/store/index.js | 3 +- .../lib/cart/store/test/cart-synchronizer.js | 25 +- client/lib/cart/store/test/index.js | 6 +- client/lib/checkout/index.js | 4 +- client/lib/create-selector/test/index.js | 3 +- client/lib/data-poller/index.js | 6 +- client/lib/data-poller/poller.js | 4 +- client/lib/domains/nameservers/test/store.js | 4 +- .../registration/availability-messages.js | 4 +- client/lib/email-followers/store.js | 10 +- client/lib/email-followers/test/store.js | 17 +- client/lib/follow-list/test/index.js | 5 +- client/lib/followers/test/store.js | 17 +- client/lib/form-state/test/index.js | 18 +- client/lib/formatting/removep.js | 4 +- client/lib/formatting/wpautop.js | 4 +- client/lib/happychat/test/index.js | 19 +- client/lib/highlight/index.js | 16 +- client/lib/importer/url-validation.js | 3 +- client/lib/keyboard-shortcuts/index.js | 8 +- client/lib/keyboard-shortcuts/test/index.js | 10 +- .../lib/media-serialization/strategies/dom.js | 4 +- client/lib/media/utils/canvas-to-blob.js | 6 +- .../utils/get-thumbnail-size-dimensions.js | 3 +- client/lib/media/utils/playtime.js | 6 +- client/lib/mixins/data-observe/test/index.js | 46 +-- client/lib/people/log-store.js | 8 +- client/lib/people/test/log-store.js | 3 +- client/lib/plugins/log-store.js | 8 +- client/lib/plugins/notices.jsx | 30 +- client/lib/plugins/store.js | 70 ++--- client/lib/plugins/test/log-store.js | 3 +- client/lib/plugins/test/mocks/wpcom.js | 168 +++++------ client/lib/plugins/test/store.js | 16 +- client/lib/plugins/test/utils.js | 50 ++-- client/lib/plugins/wporg-data/list-store.js | 10 +- client/lib/post-metadata/index.js | 4 +- client/lib/post-metadata/test/index.js | 30 +- client/lib/products-values/sort.js | 6 +- client/lib/query-manager/index.js | 8 +- client/lib/react-pass-to-children/index.js | 4 +- .../lib/react-pass-to-children/test/index.js | 4 +- client/lib/scroll-to/index.js | 4 +- client/lib/search-url/test/index.js | 4 +- client/lib/signup/step-actions/index.js | 6 +- client/lib/store-transactions/index.js | 18 +- client/lib/store/test/index.js | 56 ++-- client/lib/translator-jumpstart/index.js | 60 ++-- client/lib/user/utils.js | 4 +- client/lib/users/actions.js | 4 +- client/lib/users/test/store.js | 22 +- client/lib/version-compare/index.js | 72 ++--- client/lib/viewers/store.js | 12 +- client/lib/viewers/test/store.js | 9 +- client/lib/wpcom-undocumented/lib/site.js | 12 +- .../wpcom-undocumented/lib/undocumented.js | 16 +- client/lib/wporg/jsonp.js | 14 +- client/mailing-lists/main.jsx | 10 +- .../chat-generic-closure.jsx | 3 +- .../chat-holiday-closure.jsx | 3 +- .../me/help/help-unverified-warning/index.jsx | 8 +- .../push-notification-settings/index.jsx | 16 +- client/me/profile-link/index.jsx | 20 +- .../me/purchases/cancel-purchase/button.jsx | 11 +- .../me/purchases/concierge-banner/index.jsx | 6 +- .../purchases/confirm-cancel-domain/index.jsx | 4 +- client/me/purchases/manage-purchase/index.jsx | 4 +- client/me/purchases/product-link/index.jsx | 6 +- .../security-account-recovery/edit-email.jsx | 4 +- client/me/security-checkup/account-email.jsx | 3 +- .../account-recovery-email.jsx | 3 +- .../account-recovery-phone.jsx | 3 +- .../two-factor-authentication.jsx | 3 +- .../two-factor-backup-codes.jsx | 3 +- client/me/security-section-nav/index.jsx | 4 +- .../my-sites/checkout/cart/test/cart-item.js | 3 +- .../domain-registration-details.jsx | 18 +- .../failed-purchase-details.jsx | 84 +++--- .../checkout/checkout-thank-you/index.jsx | 4 +- .../premium-plan-details.jsx | 4 +- .../checkout/credit-card-payment-box.jsx | 22 +- client/my-sites/checkout/checkout/index.jsx | 13 +- client/my-sites/checkout/checkout/notices.jsx | 8 +- .../checkout/checkout/payment-box.jsx | 8 +- .../checkout/checkout/secure-payment-form.jsx | 4 +- client/my-sites/checkout/controller.jsx | 3 +- .../components/domain-warnings/index.jsx | 77 ++--- .../components/domain-warnings/test/index.js | 46 +-- .../domain-connect-authorize-records.jsx | 8 +- .../domain-connect-authorize.jsx | 12 +- .../edit-contact-info/form-card.jsx | 6 +- .../domains/domain-management/list/index.jsx | 4 +- .../domain-management/list/test/index.js | 4 +- .../domain-management/security/index.jsx | 3 +- .../transfer/transfer-to-other-user/index.jsx | 24 +- client/my-sites/draft/index.jsx | 3 +- .../email-forwarding-add-new.jsx | 22 +- .../gsuite-users-card/index.jsx | 14 +- client/my-sites/importer/file-importer.jsx | 28 +- .../my-sites/invites/invite-accept/index.jsx | 4 +- .../marketing/buttons/preview-buttons.jsx | 13 +- .../marketing/buttons/preview-widget.js | 4 +- client/my-sites/marketing/buttons/tray.jsx | 6 +- .../marketing/connections/account-dialog.jsx | 12 +- .../marketing/connections/connection.jsx | 14 +- .../marketing/connections/service-action.jsx | 4 +- client/my-sites/media-library/content.jsx | 3 +- client/my-sites/media-library/list-item.tsx | 3 +- .../media-library/list-no-content.jsx | 4 +- client/my-sites/media-library/test/list.jsx | 3 +- client/my-sites/people/delete-user/index.jsx | 6 +- .../my-sites/people/followers-list/index.jsx | 24 +- .../my-sites/people/invite-people/index.jsx | 16 +- .../people/people-list-item/index.jsx | 4 +- .../my-sites/people/people-notices/index.jsx | 20 +- .../my-sites/people/people-profile/index.jsx | 4 +- client/my-sites/people/team-list/team.jsx | 10 +- client/my-sites/plan-features/index.jsx | 10 +- client/my-sites/plugins/controller.js | 3 +- client/my-sites/plugins/main.jsx | 8 +- .../plugins/plugin-action/test/index.jsx | 10 +- .../plugin-autoupdate-toggle/index.jsx | 16 +- .../plugins/plugin-site-list/index.jsx | 4 +- client/my-sites/plugins/plugin.jsx | 20 +- .../my-sites/plugins/plugins-list/index.jsx | 10 +- .../plugins/plugins-list/test/index.jsx | 4 +- client/my-sites/post-type-filter/index.jsx | 3 +- .../my-sites/post-type-list/empty-content.jsx | 3 +- client/my-sites/sidebar/index.jsx | 20 +- client/my-sites/site-settings/amp/jetpack.jsx | 3 +- .../my-sites/site-settings/form-general.jsx | 7 +- .../jetpack-sync-panel/index.jsx | 4 +- .../site-settings/spam-filtering-settings.jsx | 6 +- .../site-settings/wrap-settings-form.jsx | 4 +- client/my-sites/stats/post-trends/index.jsx | 40 +-- .../stats/stats-detail-weeks/index.jsx | 5 +- .../stats/stats-list/action-follow.jsx | 34 +-- .../stats/stats-list/stats-list-item.jsx | 42 +-- .../stats/stats-post-detail/index.jsx | 3 +- .../my-sites/stats/stats-post-likes/index.jsx | 3 +- client/my-sites/stats/wordads/earnings.jsx | 60 ++-- client/my-sites/theme/main.jsx | 3 +- client/my-sites/theme/test/main.jsx | 3 +- .../my-sites/themes/current-theme/index.jsx | 6 +- client/my-sites/themes/test/logged-out.jsx | 4 +- client/my-sites/themes/theme-options.js | 4 +- .../types/post-type-unsupported/index.jsx | 5 +- client/notices/index.js | 4 +- .../post-editor/editor-media-modal/index.jsx | 3 +- client/post-editor/media-modal/markup.js | 7 +- client/post-editor/media-modal/test/index.jsx | 7 +- client/post-editor/media-modal/test/markup.js | 4 +- .../media-modal/test/preload-image.js | 3 +- client/reader/embed-helper.jsx | 4 +- client/reader/feed-error/index.jsx | 34 +-- client/reader/feed-stream/empty.jsx | 34 +-- client/reader/full-post/controller.js | 16 +- client/reader/liked-stream/empty.jsx | 34 +-- client/reader/list-manage/list-item.tsx | 6 +- client/reader/list-stream/empty.jsx | 34 +-- client/reader/list-stream/index.jsx | 8 +- client/reader/list-stream/missing.jsx | 34 +-- client/reader/search/controller.js | 6 +- client/reader/sidebar/helper.js | 18 +- client/reader/stream/empty.jsx | 18 +- client/reader/stream/index.jsx | 3 +- client/reader/stream/x-post.jsx | 3 +- client/server/api/integration/index.js | 13 +- client/server/bundler/utils.js | 3 +- client/server/config/parser.js | 40 +-- client/server/devdocs/index.js | 14 +- client/server/pages/index.js | 3 +- client/server/pages/test/analytics.js | 7 +- client/server/pages/test/index.js | 3 +- client/server/sanitize/index.js | 4 +- client/server/user-bootstrap/index.js | 24 +- client/signup/main.jsx | 6 +- client/signup/navigation-link/index.jsx | 4 +- client/signup/steps/domains/index.jsx | 18 +- client/signup/steps/p2-site/index.jsx | 12 +- client/signup/steps/plans/index.jsx | 3 +- .../steps/site-picker/site-picker-submit.jsx | 6 +- client/signup/steps/site/index.jsx | 12 +- client/signup/steps/user/index.jsx | 3 +- client/signup/steps/user/test/index.js | 7 +- client/signup/utils.js | 14 +- client/state/country-states/test/reducer.js | 8 +- .../wpcom/email-accounts/test/index.js | 10 +- .../wpcom/email-forwarding/add/test/index.js | 18 +- .../wpcom/email-forwarding/get/test/index.js | 10 +- .../email-forwarding/remove/test/index.js | 14 +- .../resend-email-verification/test/index.js | 18 +- .../wpcom/gravatar-upload/test/index.js | 3 +- .../wpcom/gsuite-users/test/index.js | 10 +- .../state/domains/suggestions/test/actions.js | 3 +- .../happychat/test/middleware-calypso.js | 3 +- client/state/happychat/test/middleware.js | 4 +- client/state/http/index.js | 3 +- client/state/jetpack-sync/selectors.js | 16 +- client/state/jetpack-sync/test/actions.js | 3 +- .../state/jetpack/connection/test/reducer.js | 164 +++++------ client/state/jetpack/modules/test/reducer.js | 274 +++++++++--------- client/state/jetpack/settings/test/reducer.js | 118 ++++---- .../state/media/thunks/test/upload-media.js | 3 +- client/state/notices/test/middleware.js | 3 +- .../get-deserialized-posts-query-details.js | 3 +- client/state/posts/utils/get-preview-url.js | 3 +- client/state/preferences/test/actions.js | 3 +- client/state/purchases/reducer.js | 3 +- client/state/purchases/test/actions.js | 8 +- .../state/push-notifications/test/actions.js | 3 +- client/state/reader/posts/sizes.js | 14 +- client/state/reader/streams/reducer.js | 11 +- client/state/receipts/test/reducer.js | 48 +-- .../test/get-jetpack-connection-owner.js | 10 +- .../test/get-jetpack-connection-status.js | 20 +- .../selectors/test/get-jetpack-module.js | 36 +-- .../selectors/test/get-jetpack-modules.js | 24 +- .../selectors/test/get-jetpack-setting.js | 34 +-- .../selectors/test/get-jetpack-settings.js | 18 +- .../test/get-jetpack-user-connection.js | 20 +- .../test/is-activating-jetpack-module.js | 30 +- .../test/is-deactivating-jetpack-module.js | 30 +- .../test/is-fetching-jetpack-modules.js | 30 +- .../test/is-jetpack-module-active.js | 30 +- .../test/is-jetpack-site-connected.js | 30 +- .../is-jetpack-site-in-development-mode.js | 40 +-- .../test/is-jetpack-site-in-staging-mode.js | 30 +- .../test/is-jetpack-user-connection-owner.js | 30 +- ...is-requesting-jetpack-connection-status.js | 30 +- .../is-requesting-jetpack-user-connection.js | 30 +- .../state/sharing/publicize/test/reducer.js | 126 ++++---- client/state/sharing/services/test/reducer.js | 8 +- client/state/signup/verticals/test/actions.js | 6 +- client/state/sites/domains/test/actions.js | 3 +- client/state/sites/plans/test/actions.js | 4 +- client/state/sites/plans/test/reducer.js | 196 ++++++------- client/state/sites/products/test/actions.js | 4 +- client/state/sites/products/test/reducer.js | 150 +++++----- .../has-jetpack-site-custom-domain.js | 4 +- .../is-jetpack-site-secondary-network-site.js | 4 +- client/state/sites/test/actions.js | 3 +- client/state/sites/vouchers/test/actions.js | 3 +- client/state/stored-cards/test/actions.js | 6 +- client/state/test/initial-state.js | 52 +++- client/state/themes/utils.js | 3 +- client/state/wordads/approve/test/actions.js | 3 +- .../babel-plugin-i18n-calypso/src/index.js | 8 +- packages/calypso-analytics/src/tracks.ts | 3 +- packages/eslint-config-wpcalypso/package.json | 2 +- .../lib/rules/i18n-ellipsis.js | 4 +- .../lib/rules/i18n-mismatched-placeholders.js | 4 +- .../lib/rules/i18n-named-placeholders.js | 4 +- .../rules/i18n-no-collapsible-whitespace.js | 8 +- .../lib/rules/i18n-no-placeholders-only.js | 4 +- .../rules/post-message-no-wildcard-targets.js | 4 +- .../lib/rules/test/i18n-ellipsis.js | 6 +- .../test/i18n-mismatched-placeholders.js | 6 +- .../lib/rules/test/i18n-named-placeholders.js | 6 +- .../test/i18n-no-collapsible-whitespace.js | 8 +- .../rules/test/i18n-no-placeholders-only.js | 6 +- .../lib/rules/test/i18n-no-this-translate.js | 4 +- .../lib/rules/test/i18n-no-variables.js | 6 +- .../lib/rules/test/import-docblock.js | 4 +- .../lib/rules/test/jsx-gridicon-size.js | 4 +- .../test/post-message-no-wildcard-targets.js | 6 +- .../rules/test/redux-no-bound-selectors.js | 4 +- .../lib/util/get-text-content-from-node.js | 3 +- .../i18n-calypso-cli/formatters/multiline.js | 4 +- packages/i18n-calypso/test/index.js | 24 +- packages/popup-monitor/src/index.js | 4 +- .../index.js | 3 +- packages/wpcom.js/src/lib/site.media.js | 10 +- packages/wpcom.js/src/lib/util/pinghub.js | 22 +- test/e2e/lib/data-helper.js | 4 +- test/e2e/lib/flows/login-flow.js | 4 +- test/e2e/lib/mocha-hooks.js | 6 +- test/e2e/lib/pages/media-page.js | 23 +- test/e2e/specs/wp-log-in-out-spec.js | 32 +- test/e2e/specs/wp-plan-purchase-spec.js | 3 +- 363 files changed, 2889 insertions(+), 2587 deletions(-) diff --git a/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/view.js b/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/view.js index 859a93faec3bd..18fd5de0dcd65 100644 --- a/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/view.js +++ b/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/view.js @@ -13,10 +13,10 @@ import { __, _x } from '@wordpress/i18n'; const view = ( { attributes, className, isEditView } ) => { // Expected values in save. - let days = ' ', - hours = ' ', - mins = ' ', - secs = ' '; + let days = ' '; + let hours = ' '; + let mins = ' '; + let secs = ' '; if ( isEditView ) { // Zero out. diff --git a/apps/notifications/src/panel/indices-to-html/index.js b/apps/notifications/src/panel/indices-to-html/index.js index a15d6bd3dccbc..c71e8845983e6 100644 --- a/apps/notifications/src/panel/indices-to-html/index.js +++ b/apps/notifications/src/panel/indices-to-html/index.js @@ -23,8 +23,8 @@ import noticon2gridicon from '../utils/noticon2gridicon'; */ function render_range( new_sub_text, new_sub_range, range_info, range_data, options ) { // Its time to build the outer shell of the range we're recursing into. - let new_container = null, - type_mappings; + let new_container = null; + let type_mappings; const new_classes = []; let range_info_type = range_info.type; @@ -183,8 +183,8 @@ function render_range( new_sub_text, new_sub_range, range_info, range_data, opti * @param {object} options Options for building chunks */ function build_chunks( sub_text, sub_ranges, range_data, container, options ) { - let text_start = null, - text_stop = null; + let text_start = null; + let text_stop = null; const ranges = JSON.parse( JSON.stringify( sub_ranges ) ); // clone through serialization diff --git a/apps/notifications/src/panel/templates/actions.jsx b/apps/notifications/src/panel/templates/actions.jsx index 9e95c4f7a9c1d..cd781af6f161e 100644 --- a/apps/notifications/src/panel/templates/actions.jsx +++ b/apps/notifications/src/panel/templates/actions.jsx @@ -23,7 +23,8 @@ import { getActions, getReferenceId } from '../helpers/notes'; const getType = ( note ) => ( null === getReferenceId( note, 'comment' ) ? 'post' : 'comment' ); const getInitialReplyValue = ( note, translate ) => { - let ranges, username; + let ranges; + let username; if ( 'user' === note.subject[ 0 ].ranges[ 0 ].type ) { // Build the username from the subject line diff --git a/apps/notifications/src/panel/templates/block-user.jsx b/apps/notifications/src/panel/templates/block-user.jsx index c6375ef9968a8..c002858334c75 100644 --- a/apps/notifications/src/panel/templates/block-user.jsx +++ b/apps/notifications/src/panel/templates/block-user.jsx @@ -35,11 +35,11 @@ export class UserBlock extends React.Component { * @returns {string} - Time stamp formatted for display or '' if input invalid */ getTimeString = ( timestamp ) => { - var DAY_IN_SECONDS = 3600 * 24, - MAX_LENGTH = 15, - parsedTime = Date.parse( timestamp ), - momentTime, - timeString; + var DAY_IN_SECONDS = 3600 * 24; + var MAX_LENGTH = 15; + var parsedTime = Date.parse( timestamp ); + var momentTime; + var timeString; if ( isNaN( parsedTime ) ) { return ''; @@ -65,13 +65,13 @@ export class UserBlock extends React.Component { }; render() { - var grav = this.props.block.media[ 0 ], - home_url = '', - home_title = '', - timeIndicator, - homeTemplate, - followLink, - noteActions; + var grav = this.props.block.media[ 0 ]; + var home_url = ''; + var home_title = ''; + var timeIndicator; + var homeTemplate; + var followLink; + var noteActions; if ( this.props.block.meta ) { if ( this.props.block.meta.links ) { diff --git a/apps/notifications/src/panel/templates/body.jsx b/apps/notifications/src/panel/templates/body.jsx index 7fd866ac10c6e..754a0c4c6afb6 100644 --- a/apps/notifications/src/panel/templates/body.jsx +++ b/apps/notifications/src/panel/templates/body.jsx @@ -52,8 +52,8 @@ export const NoteBody = createReactClass( { }, UNSAFE_componentWillMount: function () { - var note = this.props.note, - hasReplyBlock; + var note = this.props.note; + var hasReplyBlock; if ( note.meta && note.meta.ids.reply_comment ) { hasReplyBlock = diff --git a/apps/notifications/src/panel/templates/comment-reply-input.jsx b/apps/notifications/src/panel/templates/comment-reply-input.jsx index a937dc075c716..2977c50f0652b 100644 --- a/apps/notifications/src/panel/templates/comment-reply-input.jsx +++ b/apps/notifications/src/panel/templates/comment-reply-input.jsx @@ -150,12 +150,12 @@ const CommentReplyInput = createReactClass( { }, handleSubmit( event ) { - var wpObject, - submitComment, - component = this, - statusMessage, - successMessage = this.props.translate( 'Reply posted!' ), - linkMessage = this.props.translate( 'View your comment.' ); + var wpObject; + var submitComment; + var component = this; + var statusMessage; + var successMessage = this.props.translate( 'Reply posted!' ); + var linkMessage = this.props.translate( 'View your comment.' ); if ( event ) { event.preventDefault(); diff --git a/apps/notifications/src/panel/templates/follow-link.jsx b/apps/notifications/src/panel/templates/follow-link.jsx index 8835652d6974d..d80d93c195b41 100644 --- a/apps/notifications/src/panel/templates/follow-link.jsx +++ b/apps/notifications/src/panel/templates/follow-link.jsx @@ -69,7 +69,8 @@ export const FollowLink = createReactClass( { }, render: function () { - var gridicon_icon, link_text; + var gridicon_icon; + var link_text; if ( this.state.isFollowing ) { gridicon_icon = 'reader-following'; diff --git a/apps/notifications/src/panel/templates/summary-in-single.jsx b/apps/notifications/src/panel/templates/summary-in-single.jsx index ccad818e6c760..f57e2010fe6e5 100644 --- a/apps/notifications/src/panel/templates/summary-in-single.jsx +++ b/apps/notifications/src/panel/templates/summary-in-single.jsx @@ -94,7 +94,8 @@ var Header = React.createFactory( class SummaryInSingle extends React.Component { render() { - var header_url, parser; + var header_url; + var parser; if ( ! this.props.note.header || 0 === this.props.note.header.length ) { return ; } diff --git a/bin/build-metadata.js b/bin/build-metadata.js index d341e6e98f493..a89876d52bf0b 100755 --- a/bin/build-metadata.js +++ b/bin/build-metadata.js @@ -216,8 +216,8 @@ function removeAllNumberKeys( obj ) { function removeRegionCodeAndCountryDialCodeIfSameWithCountryDialCode( countryData ) { for ( let key in countryData ) { if ( countryData.hasOwnProperty( key ) ) { - const country = countryData[ key ], - { countryDialCode, dialCode } = country; + const country = countryData[ key ]; + const { countryDialCode, dialCode } = country; if ( countryDialCode === dialCode ) { delete country.regionCode; delete country.countryDialCode; diff --git a/client/blocks/conversations/empty.jsx b/client/blocks/conversations/empty.jsx index fbcdde8b77546..f0377e14e58e7 100644 --- a/client/blocks/conversations/empty.jsx +++ b/client/blocks/conversations/empty.jsx @@ -30,15 +30,15 @@ class ConversationsEmptyContent extends React.Component { /* eslint-disable wpcalypso/jsx-classname-namespace */ render() { const action = ( - - { this.props.translate( 'Find posts to follow' ) } - - ), - secondaryAction = null; + + { this.props.translate( 'Find posts to follow' ) } + + ); + const secondaryAction = null; return ( { - const siteId = props.siteId || getSelectedSiteId( state ), - productSlug = PLAN_PERSONAL, - productId = getPlan( PLAN_PERSONAL ).getProductId(); + const siteId = props.siteId || getSelectedSiteId( state ); + const productSlug = PLAN_PERSONAL; + const productId = getPlan( PLAN_PERSONAL ).getProductId(); return { isEligible: isEligibleForDomainToPaidPlanUpsell( state, siteId ), diff --git a/client/blocks/edit-gravatar/test/index.jsx b/client/blocks/edit-gravatar/test/index.jsx index bc851c74e7324..554cb4a7e70fa 100644 --- a/client/blocks/edit-gravatar/test/index.jsx +++ b/client/blocks/edit-gravatar/test/index.jsx @@ -23,7 +23,13 @@ jest.mock( 'lib/oauth-token', () => ( { jest.mock( 'lib/user', () => () => {} ); describe( 'EditGravatar', () => { - let EditGravatar, FilePicker, Gravatar, ImageEditor, VerifyEmailDialog, DropZone, sandbox; + let EditGravatar; + let FilePicker; + let Gravatar; + let ImageEditor; + let VerifyEmailDialog; + let DropZone; + let sandbox; const user = { email_verified: false, }; diff --git a/client/blocks/image-editor/image-editor-buttons.jsx b/client/blocks/image-editor/image-editor-buttons.jsx index e0e7cd8137088..cdf60f9ff3377 100644 --- a/client/blocks/image-editor/image-editor-buttons.jsx +++ b/client/blocks/image-editor/image-editor-buttons.jsx @@ -75,8 +75,8 @@ class ImageEditorButtons extends Component { } export default connect( ( state ) => { - const { src } = getImageEditorFileInfo( state ), - hasChanges = imageEditorHasChanges( state ); + const { src } = getImageEditorFileInfo( state ); + const hasChanges = imageEditorHasChanges( state ); return { src, diff --git a/client/blocks/image-editor/image-editor-crop.jsx b/client/blocks/image-editor/image-editor-crop.jsx index 9e39aa39764d3..d6aadd6dfc0cb 100644 --- a/client/blocks/image-editor/image-editor-crop.jsx +++ b/client/blocks/image-editor/image-editor-crop.jsx @@ -145,15 +145,15 @@ class ImageEditorCrop extends Component { return; } - const rotated = props.degrees % 180 !== 0, - newState = Object.assign( {}, this.state, newValues ), - newWidth = newState.right - newState.left, - newHeight = newState.bottom - newState.top; + const rotated = props.degrees % 180 !== 0; + const newState = Object.assign( {}, this.state, newValues ); + const newWidth = newState.right - newState.left; + const newHeight = newState.bottom - newState.top; - let imageWidth, - imageHeight, - finalWidth = newWidth, - finalHeight = newHeight; + let imageWidth; + let imageHeight; + let finalWidth = newWidth; + let finalHeight = newHeight; switch ( aspectRatio ) { case AspectRatios.ORIGINAL: @@ -218,8 +218,8 @@ class ImageEditorCrop extends Component { const { right, bottom } = this.state; const { minCropSize } = this.props; - let top = y, - left = x; + let top = y; + let left = x; if ( right - left <= minCropSize.width ) { left = right - minCropSize.width; @@ -239,8 +239,8 @@ class ImageEditorCrop extends Component { const { left, bottom } = this.state; const { minCropSize } = this.props; - let top = y, - right = x; + let top = y; + let right = x; if ( right - left <= minCropSize.width ) { right = left + minCropSize.width; @@ -260,8 +260,8 @@ class ImageEditorCrop extends Component { const { left, top } = this.state; const { minCropSize } = this.props; - let bottom = y, - right = x; + let bottom = y; + let right = x; if ( right - left <= minCropSize.width ) { right = left + minCropSize.width; @@ -281,8 +281,8 @@ class ImageEditorCrop extends Component { const { right, top } = this.state; const { minCropSize } = this.props; - let bottom = y, - left = x; + let bottom = y; + let left = x; if ( right - left <= minCropSize.width ) { left = right - minCropSize.width; @@ -299,9 +299,9 @@ class ImageEditorCrop extends Component { } onBorderDrag( x, y ) { - const { top, left, right, bottom } = this.state, - width = right - left, - height = bottom - top; + const { top, left, right, bottom } = this.state; + const width = right - left; + const height = bottom - top; this.setState( { top: y, @@ -316,10 +316,10 @@ class ImageEditorCrop extends Component { const { topBound, leftBound, rightBound, bottomBound } = this.props.bounds; - const currentTop = top - topBound, - currentLeft = left - leftBound, - currentWidth = right - left, - currentHeight = bottom - top; + const currentTop = top - topBound; + const currentLeft = left - leftBound; + const currentWidth = right - left; + const currentHeight = bottom - top; const imageWidth = rightBound - leftBound; let imageHeight = bottomBound - topBound; @@ -355,9 +355,9 @@ class ImageEditorCrop extends Component { render() { const { top, left, right, bottom } = this.state; - const width = right - left, - height = bottom - top, - handleClassName = 'image-editor__crop-handle'; + const width = right - left; + const height = bottom - top; + const handleClassName = 'image-editor__crop-handle'; const { topBound, leftBound, rightBound, bottomBound } = this.props.bounds; diff --git a/client/blocks/image-editor/index.jsx b/client/blocks/image-editor/index.jsx index f2c95f8e74337..6bbfc0984a74a 100644 --- a/client/blocks/image-editor/index.jsx +++ b/client/blocks/image-editor/index.jsx @@ -108,10 +108,10 @@ class ImageEditor extends React.Component { updateFileInfo = ( media ) => { const { site } = this.props; - let src, - fileName = 'default', - mimeType = 'image/png', - title = 'default'; + let src; + let fileName = 'default'; + let mimeType = 'image/png'; + let title = 'default'; if ( media ) { src = diff --git a/client/blocks/image-editor/test/image-editor-toolbar.jsx b/client/blocks/image-editor/test/image-editor-toolbar.jsx index 012fc52a5a67c..17ea89040fa5b 100644 --- a/client/blocks/image-editor/test/image-editor-toolbar.jsx +++ b/client/blocks/image-editor/test/image-editor-toolbar.jsx @@ -17,7 +17,8 @@ import { ImageEditorToolbar } from '../image-editor-toolbar'; import { useSandbox } from 'calypso/test-helpers/use-sinon'; describe( 'ImageEditorToolbar', () => { - let defaultProps, wrapper; + let defaultProps; + let wrapper; useSandbox( ( sandbox ) => { defaultProps = { diff --git a/client/blocks/keyring-connect-button/index.js b/client/blocks/keyring-connect-button/index.js index 31244994f865f..989880c4fce0d 100644 --- a/client/blocks/keyring-connect-button/index.js +++ b/client/blocks/keyring-connect-button/index.js @@ -170,9 +170,9 @@ class KeyringConnectButton extends Component { const { primary, service, translate } = this.props; const { isConnecting, isRefreshing } = this.state; const status = service ? this.getConnectionStatus() : 'unknown'; - let localPrimary = false, - warning = false, - label; + let localPrimary = false; + let warning = false; + let label; const isPending = 'unknown' === status || isRefreshing || isConnecting; diff --git a/client/blocks/post-status/index.jsx b/client/blocks/post-status/index.jsx index 78966aa36b83b..1981d76f69d4a 100644 --- a/client/blocks/post-status/index.jsx +++ b/client/blocks/post-status/index.jsx @@ -25,7 +25,9 @@ export function PostStatus( { translate, post, showAll, showIcon = true } ) { } const { sticky, status } = post; - let text, classModifier, icon; + let text; + let classModifier; + let icon; if ( sticky ) { text = translate( 'Sticky' ); classModifier = 'is-sticky'; diff --git a/client/blocks/product-purchase-features-list/custom-css.jsx b/client/blocks/product-purchase-features-list/custom-css.jsx index 4c47ea021371f..4bec95c61b885 100644 --- a/client/blocks/product-purchase-features-list/custom-css.jsx +++ b/client/blocks/product-purchase-features-list/custom-css.jsx @@ -21,12 +21,12 @@ function isCustomizeEnabled() { } function getEditCSSLink( selectedSite ) { - const adminUrl = selectedSite.URL + '/wp-admin/', - customizerInAdmin = - adminUrl + - 'customize.php?return=' + - encodeURIComponent( window.location.href ) + - '§ion=jetpack_custom_css'; + const adminUrl = selectedSite.URL + '/wp-admin/'; + const customizerInAdmin = + adminUrl + + 'customize.php?return=' + + encodeURIComponent( window.location.href ) + + '§ion=jetpack_custom_css'; return isCustomizeEnabled() ? '/customize/custom-css/' + selectedSite.slug : customizerInAdmin; } diff --git a/client/blocks/product-purchase-features-list/customize-theme.jsx b/client/blocks/product-purchase-features-list/customize-theme.jsx index fc65dd42a8b13..152eb97c1a00c 100644 --- a/client/blocks/product-purchase-features-list/customize-theme.jsx +++ b/client/blocks/product-purchase-features-list/customize-theme.jsx @@ -21,9 +21,9 @@ function isCustomizeEnabled() { } function getCustomizeLink( selectedSite ) { - const adminUrl = selectedSite.URL + '/wp-admin/', - customizerInAdmin = - adminUrl + 'customize.php?return=' + encodeURIComponent( window.location.href ); + const adminUrl = selectedSite.URL + '/wp-admin/'; + const customizerInAdmin = + adminUrl + 'customize.php?return=' + encodeURIComponent( window.location.href ); return isCustomizeEnabled() ? '/customize/' + selectedSite.slug : customizerInAdmin; } diff --git a/client/blocks/product-purchase-features-list/index.jsx b/client/blocks/product-purchase-features-list/index.jsx index 4fe1a84c381fb..067b6e1f83a03 100644 --- a/client/blocks/product-purchase-features-list/index.jsx +++ b/client/blocks/product-purchase-features-list/index.jsx @@ -403,8 +403,8 @@ export class ProductPurchaseFeaturesList extends Component { export default connect( ( state, ownProps ) => { - const selectedSite = getSelectedSite( state ), - selectedSiteId = getSelectedSiteId( state ); + const selectedSite = getSelectedSite( state ); + const selectedSiteId = getSelectedSiteId( state ); const isAutomatedTransfer = isSiteAutomatedTransfer( state, selectedSiteId ); return { diff --git a/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx b/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx index 8d45d4d94195c..df159671e61d7 100644 --- a/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx +++ b/client/blocks/product-purchase-features-list/test/product-purchase-features-list.jsx @@ -56,7 +56,8 @@ describe( 'ProductPurchaseFeaturesList getFeatures() tests', () => { }, }; - let spy, spyWrong; + let spy; + let spyWrong; afterEach( () => { if ( spy ) { diff --git a/client/blocks/product-selector/index.jsx b/client/blocks/product-selector/index.jsx index ceeef1e305dd8..adf63d29eaa83 100644 --- a/client/blocks/product-selector/index.jsx +++ b/client/blocks/product-selector/index.jsx @@ -564,7 +564,8 @@ export class ProductSelector extends Component { ? addQueryArgs( { site: selectedSiteSlug }, product.link.url ) : product.link.url; - let purchase, isCurrent; + let purchase; + let isCurrent; if ( this.currentPlanIncludesProduct( product ) ) { purchase = this.getPurchaseByCurrentPlan(); isCurrent = currentPlanInSelectedTimeframe; diff --git a/client/blocks/reader-avatar/index.jsx b/client/blocks/reader-avatar/index.jsx index 2a921bdfaa3b1..63f804ec520ee 100644 --- a/client/blocks/reader-avatar/index.jsx +++ b/client/blocks/reader-avatar/index.jsx @@ -75,7 +75,8 @@ const ReaderAvatar = ( { const hasBothIcons = hasSiteIcon && hasAvatar; - let siteIconSize, gravatarSize; + let siteIconSize; + let gravatarSize; if ( isCompact ) { siteIconSize = 32; gravatarSize = hasBothIcons ? 24 : 32; diff --git a/client/blocks/reader-post-card/index.jsx b/client/blocks/reader-post-card/index.jsx index 90a55222a82d9..f44a93ad87354 100644 --- a/client/blocks/reader-post-card/index.jsx +++ b/client/blocks/reader-post-card/index.jsx @@ -70,8 +70,8 @@ class ReaderPostCard extends React.Component { }; handleCardClick = ( event ) => { - const rootNode = ReactDom.findDOMNode( this ), - selection = window.getSelection && window.getSelection(); + const rootNode = ReactDom.findDOMNode( this ); + const selection = window.getSelection && window.getSelection(); // if the click has modifier or was not primary, ignore it if ( event.button > 0 || event.metaKey || event.controlKey || event.shiftKey || event.altKey ) { diff --git a/client/blocks/reader-post-card/photo.jsx b/client/blocks/reader-post-card/photo.jsx index 91d552973ea99..4cde7858a7d23 100644 --- a/client/blocks/reader-post-card/photo.jsx +++ b/client/blocks/reader-post-card/photo.jsx @@ -78,7 +78,8 @@ class PostPhoto extends React.Component { backgroundPosition: 'center', }; - let newWidth, newHeight; + let newWidth; + let newHeight; if ( this.props.isExpanded ) { const cardWidth = this.state.cardWidth; const { width: naturalWidth, height: naturalHeight } = imageSize; diff --git a/client/blocks/signup-form/index.jsx b/client/blocks/signup-form/index.jsx index 93516c5fc6358..4adc133b4bdb6 100644 --- a/client/blocks/signup-form/index.jsx +++ b/client/blocks/signup-form/index.jsx @@ -65,12 +65,12 @@ import wooDnaConfig from 'calypso/jetpack-connect/woo-dna-config'; */ import './style.scss'; -const VALIDATION_DELAY_AFTER_FIELD_CHANGES = 2000, - debug = debugModule( 'calypso:signup-form:form' ); +const VALIDATION_DELAY_AFTER_FIELD_CHANGES = 2000; +const debug = debugModule( 'calypso:signup-form:form' ); -let usernamesSearched = [], - timesUsernameValidationFailed = 0, - timesPasswordValidationFailed = 0; +let usernamesSearched = []; +let timesUsernameValidationFailed = 0; +let timesPasswordValidationFailed = 0; const resetAnalyticsData = () => { usernamesSearched = []; @@ -331,8 +331,8 @@ class SignupForm extends Component { } handleChangeEvent = ( event ) => { - const name = event.target.name, - value = event.target.value; + const name = event.target.name; + const value = event.target.value; this.setState( { notice: null } ); diff --git a/client/components/chart/legend.jsx b/client/components/chart/legend.jsx index 69655781381c5..ec7fa58954716 100644 --- a/client/components/chart/legend.jsx +++ b/client/components/chart/legend.jsx @@ -31,13 +31,13 @@ export default class ChartLegend extends React.Component { }; render() { - const legendColors = [ 'chart__legend-color is-dark-blue' ], - activeTab = this.props.activeTab; + const legendColors = [ 'chart__legend-color is-dark-blue' ]; + const activeTab = this.props.activeTab; const legendItems = this.props.availableCharts.map( function ( legendItem, index ) { - const colorClass = legendColors[ index ], - checked = -1 !== this.props.activeCharts.indexOf( legendItem ), - tab = find( this.props.tabs, { attr: legendItem } ); + const colorClass = legendColors[ index ]; + const checked = -1 !== this.props.activeCharts.indexOf( legendItem ); + const tab = find( this.props.tabs, { attr: legendItem } ); return ( { }, [ dataCount, labelWidth, chartWidth ] ); const labels = data.map( function ( item, index ) { - const x = index * spacing + ( spacing - labelWidth ) / 2, - rightIndex = data.length - index - 1; + const x = index * spacing + ( spacing - labelWidth ) / 2; + const rightIndex = data.length - index - 1; let label; if ( rightIndex % divisor === 0 ) { diff --git a/client/components/data/query-user-purchases/index.jsx b/client/components/data/query-user-purchases/index.jsx index 571e5ecd7d21a..2347b7451f909 100644 --- a/client/components/data/query-user-purchases/index.jsx +++ b/client/components/data/query-user-purchases/index.jsx @@ -17,8 +17,8 @@ import { fetchUserPurchases } from 'calypso/state/purchases/actions'; class QueryUserPurchases extends Component { requestUserPurchases( nextProps ) { - const userChanged = nextProps && this.props.userId !== nextProps.userId, - props = nextProps || this.props; + const userChanged = nextProps && this.props.userId !== nextProps.userId; + const props = nextProps || this.props; if ( ( ! props.isFetchingUserPurchases && ! props.hasLoadedUserPurchasesFromServer ) || diff --git a/client/components/date-picker/index.jsx b/client/components/date-picker/index.jsx index 503989b1b14d7..0c8019e7ce881 100644 --- a/client/components/date-picker/index.jsx +++ b/client/components/date-picker/index.jsx @@ -93,7 +93,8 @@ class DatePicker extends PureComponent { return []; } - let i, event; + let i; + let event; const eventsInDay = []; for ( i = 0; i < this.props.events.length; i++ ) { diff --git a/client/components/domains/domain-registration-suggestion/index.jsx b/client/components/domains/domain-registration-suggestion/index.jsx index 377db6476f013..c2db2627c3a74 100644 --- a/client/components/domains/domain-registration-suggestion/index.jsx +++ b/client/components/domains/domain-registration-suggestion/index.jsx @@ -300,7 +300,8 @@ class DomainRegistrationSuggestion extends React.Component { return null; } - let title, progressBarProps; + let title; + let progressBarProps; if ( isRecommended ) { title = showStrikedOutPrice ? translate( 'Our Recommendation' ) : translate( 'Best Match' ); progressBarProps = { diff --git a/client/components/domains/domain-search-results/index.jsx b/client/components/domains/domain-search-results/index.jsx index 06858e227261b..2f4ccce0c361b 100644 --- a/client/components/domains/domain-search-results/index.jsx +++ b/client/components/domains/domain-search-results/index.jsx @@ -96,7 +96,8 @@ class DomainSearchResults extends React.Component { const domain = get( availableDomain, 'domain_name', lastDomainSearched ); - let availabilityElement, offer; + let availabilityElement; + let offer; if ( domain && diff --git a/client/components/domains/registrant-extra-info/with-contact-details-validation.jsx b/client/components/domains/registrant-extra-info/with-contact-details-validation.jsx index c41e367ea6668..8c50b8e531979 100644 --- a/client/components/domains/registrant-extra-info/with-contact-details-validation.jsx +++ b/client/components/domains/registrant-extra-info/with-contact-details-validation.jsx @@ -41,7 +41,9 @@ export function disableSubmitButton( children ) { * } */ export function interpretIMJVError( error, schema ) { - let explicitPath, errorCode, errorMessage; + let explicitPath; + let errorCode; + let errorMessage; if ( schema ) { // Search up the schema for an explicit errorField & message diff --git a/client/components/drop-zone/index.jsx b/client/components/drop-zone/index.jsx index 382054a9eb573..daf8813e74c42 100644 --- a/client/components/drop-zone/index.jsx +++ b/client/components/drop-zone/index.jsx @@ -139,9 +139,9 @@ export class DropZone extends React.Component { // as the `detail` property. // // See: https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events - const detail = window.CustomEvent && event instanceof window.CustomEvent ? event.detail : event, - isValidDrag = this.props.onVerifyValidTransfer( detail.dataTransfer ), - isDraggingOverDocument = isValidDrag && this.dragEnterNodes.length; + const detail = window.CustomEvent && event instanceof window.CustomEvent ? event.detail : event; + const isValidDrag = this.props.onVerifyValidTransfer( detail.dataTransfer ); + const isDraggingOverDocument = isValidDrag && this.dragEnterNodes.length; this.setState( { isDraggingOverDocument: isDraggingOverDocument, diff --git a/client/components/drop-zone/test/index.jsx b/client/components/drop-zone/test/index.jsx index f0931cd123afe..e3e36785b8191 100644 --- a/client/components/drop-zone/test/index.jsx +++ b/client/components/drop-zone/test/index.jsx @@ -23,7 +23,8 @@ class Wrapper extends React.Component { } describe( 'index', () => { - let container, sandbox; + let container; + let sandbox; const requiredProps = { hideDropZone: () => {}, showDropZone: () => {}, @@ -73,8 +74,8 @@ describe( 'index', () => { } ); test( 'should render default content if none is provided', () => { - const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ), - content = TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content' ); + const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ); + const content = TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content' ); TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content-icon' ); TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content-text' ); @@ -83,10 +84,10 @@ describe( 'index', () => { test( 'should accept children to override the default content', () => { const tree = ReactDom.render( - React.createElement( DropZone, requiredProps, 'Hello World' ), - container - ), - content = TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content' ); + React.createElement( DropZone, requiredProps, 'Hello World' ), + container + ); + const content = TestUtils.findRenderedDOMComponentWithClass( tree, 'drop-zone__content' ); expect( content.textContent ).to.equal( 'Hello World' ); } ); @@ -106,8 +107,8 @@ describe( 'index', () => { } ); test( 'should highlight the drop zone when dragging over the body', () => { - const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ), - dragEnterEvent = new window.MouseEvent( 'dragenter' ); + const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ); + const dragEnterEvent = new window.MouseEvent( 'dragenter' ); window.dispatchEvent( dragEnterEvent ); @@ -117,8 +118,8 @@ describe( 'index', () => { test( 'should start observing the body for mutations when dragging over', () => { return new Promise( ( done ) => { - const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ), - dragEnterEvent = new window.MouseEvent( 'dragenter' ); + const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ); + const dragEnterEvent = new window.MouseEvent( 'dragenter' ); window.dispatchEvent( dragEnterEvent ); @@ -131,9 +132,9 @@ describe( 'index', () => { test( 'should stop observing the body for mutations upon drag ending', () => { return new Promise( ( done ) => { - const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ), - dragEnterEvent = new window.MouseEvent( 'dragenter' ), - dragLeaveEvent = new window.MouseEvent( 'dragleave' ); + const tree = ReactDom.render( React.createElement( DropZone, requiredProps ), container ); + const dragEnterEvent = new window.MouseEvent( 'dragenter' ); + const dragLeaveEvent = new window.MouseEvent( 'dragleave' ); window.dispatchEvent( dragEnterEvent ); window.dispatchEvent( dragLeaveEvent ); diff --git a/client/components/forms/counted-textarea/test/index.jsx b/client/components/forms/counted-textarea/test/index.jsx index 32d2b2c927dc4..e10a552027a15 100644 --- a/client/components/forms/counted-textarea/test/index.jsx +++ b/client/components/forms/counted-textarea/test/index.jsx @@ -41,8 +41,8 @@ describe( 'index', () => { } ); test( 'should pass props to the child textarea', () => { - const value = 'Hello World!', - placeholder = 'placeholder test'; + const value = 'Hello World!'; + const placeholder = 'placeholder test'; renderer.render( diff --git a/client/components/forms/form-button/index.jsx b/client/components/forms/form-button/index.jsx index a9c63ffa95bb2..f2bfe38efe0d3 100644 --- a/client/components/forms/form-button/index.jsx +++ b/client/components/forms/form-button/index.jsx @@ -31,8 +31,8 @@ class FormButton extends React.Component { }; render() { - const { children, className, isPrimary, ...props } = this.props, - buttonClasses = classNames( className, 'form-button' ); + const { children, className, isPrimary, ...props } = this.props; + const buttonClasses = classNames( className, 'form-button' ); return (