diff --git a/client/reader/search/controller.js b/client/reader/search/controller.js
index 74b47b42dea4b..7fd8faf743710 100644
--- a/client/reader/search/controller.js
+++ b/client/reader/search/controller.js
@@ -30,9 +30,9 @@ function replaceSearchUrl( newValue, sort ) {
const exported = {
search: function ( context, next ) {
- const basePath = '/read/search',
- fullAnalyticsPageTitle = analyticsPageTitle + ' > Search',
- mcKey = 'search';
+ const basePath = '/read/search';
+ const fullAnalyticsPageTitle = analyticsPageTitle + ' > Search';
+ const mcKey = 'search';
const { sort = 'relevance', q, show = SEARCH_TYPES.POSTS } = context.query;
const searchSlug = q;
diff --git a/client/reader/sidebar/helper.js b/client/reader/sidebar/helper.js
index 403eff235fd2f..4714ed92498df 100644
--- a/client/reader/sidebar/helper.js
+++ b/client/reader/sidebar/helper.js
@@ -7,15 +7,15 @@ import { assign, some, startsWith } from 'lodash';
const exported = {
itemLinkClass: function ( path, currentPath, additionalClasses ) {
const basePathLowerCase = decodeURIComponent( currentPath )
- .split( '?' )[ 0 ]
- .replace( /\/manage$/, '' )
- .toLowerCase(),
- pathLowerCase = decodeURIComponent( path )
- .replace( /\/manage$/, '' )
- .toLowerCase();
-
- let selected = basePathLowerCase === pathLowerCase,
- isActionButtonSelected = false;
+ .split( '?' )[ 0 ]
+ .replace( /\/manage$/, '' )
+ .toLowerCase();
+ const pathLowerCase = decodeURIComponent( path )
+ .replace( /\/manage$/, '' )
+ .toLowerCase();
+
+ let selected = basePathLowerCase === pathLowerCase;
+ let isActionButtonSelected = false;
// Following is a special case, because it can be at / or /following
if ( pathLowerCase === '/' && ! selected ) {
diff --git a/client/reader/stream/empty.jsx b/client/reader/stream/empty.jsx
index 1be70ec0469ec..c0c76b5933a21 100644
--- a/client/reader/stream/empty.jsx
+++ b/client/reader/stream/empty.jsx
@@ -30,15 +30,15 @@ class FollowingEmptyContent extends React.Component {
render() {
/* eslint-disable wpcalypso/jsx-classname-namespace */
const action = (
-
{
const { feedId, blogId } = ownProps.postKey;
- let feed, site;
+ let feed;
+ let site;
if ( feedId ) {
feed = getFeed( state, feedId );
site = feed && feed.blog_ID ? getSite( state, feed.blog_ID ) : undefined;
diff --git a/client/server/api/integration/index.js b/client/server/api/integration/index.js
index 56a7af006a04f..2324b082cd6f7 100644
--- a/client/server/api/integration/index.js
+++ b/client/server/api/integration/index.js
@@ -13,7 +13,10 @@ import unmodifiedConfig from 'calypso/config';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'api', () => {
- let app, config, localRequest, sandbox;
+ let app;
+ let config;
+ let localRequest;
+ let sandbox;
useSandbox( ( newSandbox ) => ( sandbox = newSandbox ) );
@@ -68,8 +71,8 @@ describe( 'api', () => {
test( 'should return a login error with a bad login', function () {
return new Promise( ( done ) => {
- const end = sandbox.stub( request.Request.prototype, 'end' ),
- response = { error: 'invalid_request' };
+ const end = sandbox.stub( request.Request.prototype, 'end' );
+ const response = { error: 'invalid_request' };
end.callsArgWithAsync( 0, { status: 400 }, { body: response } );
@@ -100,8 +103,8 @@ describe( 'api', () => {
test( 'should return a successful login', function () {
return new Promise( ( done ) => {
- const response = { access_token: '1234' },
- end = sandbox.stub( request.Request.prototype, 'end' );
+ const response = { access_token: '1234' };
+ const end = sandbox.stub( request.Request.prototype, 'end' );
end.callsArgWithAsync( 0, null, { body: response } );
diff --git a/client/server/bundler/utils.js b/client/server/bundler/utils.js
index e77386fe27814..88a2cad4e964f 100644
--- a/client/server/bundler/utils.js
+++ b/client/server/bundler/utils.js
@@ -10,7 +10,8 @@ const URL_BASE_PATH = '/calypso';
function hashFile( path ) {
const md5 = crypto.createHash( 'md5' );
- let data, hash;
+ let data;
+ let hash;
try {
data = fs.readFileSync( path );
diff --git a/client/server/config/parser.js b/client/server/config/parser.js
index 70c9a2005fa8c..02f6b6f5537f5 100644
--- a/client/server/config/parser.js
+++ b/client/server/config/parser.js
@@ -5,10 +5,10 @@
/**
* Module dependencies
*/
-const fs = require( 'fs' ),
- path = require( 'path' ),
- assign = require( 'lodash/assign' ),
- debug = require( 'debug' )( 'config' );
+const fs = require( 'fs' );
+const path = require( 'path' );
+const assign = require( 'lodash/assign' );
+const debug = require( 'debug' )( 'config' );
function getDataFromFile( file ) {
let fileData = {};
@@ -25,22 +25,22 @@ function getDataFromFile( file ) {
module.exports = function ( configPath, defaultOpts ) {
const opts = assign(
- {
- env: 'development',
- },
- defaultOpts
- ),
- data = {},
- configFiles = [
- path.resolve( configPath, '_shared.json' ),
- path.resolve( configPath, opts.env + '.json' ),
- path.resolve( configPath, opts.env + '.local.json' ),
- ],
- realSecretsPath = path.resolve( configPath, 'secrets.json' ),
- emptySecretsPath = path.resolve( configPath, 'empty-secrets.json' ),
- secretsPath = fs.existsSync( realSecretsPath ) ? realSecretsPath : emptySecretsPath,
- enabledFeatures = opts.enabledFeatures ? opts.enabledFeatures.split( ',' ) : [],
- disabledFeatures = opts.disabledFeatures ? opts.disabledFeatures.split( ',' ) : [];
+ {
+ env: 'development',
+ },
+ defaultOpts
+ );
+ const data = {};
+ const configFiles = [
+ path.resolve( configPath, '_shared.json' ),
+ path.resolve( configPath, opts.env + '.json' ),
+ path.resolve( configPath, opts.env + '.local.json' ),
+ ];
+ const realSecretsPath = path.resolve( configPath, 'secrets.json' );
+ const emptySecretsPath = path.resolve( configPath, 'empty-secrets.json' );
+ const secretsPath = fs.existsSync( realSecretsPath ) ? realSecretsPath : emptySecretsPath;
+ const enabledFeatures = opts.enabledFeatures ? opts.enabledFeatures.split( ',' ) : [];
+ const disabledFeatures = opts.disabledFeatures ? opts.disabledFeatures.split( ',' ) : [];
configFiles.forEach( function ( file ) {
assign( data, getDataFromFile( file ) );
diff --git a/client/server/devdocs/index.js b/client/server/devdocs/index.js
index 8f8dd98671b5c..b9ece8070dd6e 100644
--- a/client/server/devdocs/index.js
+++ b/client/server/devdocs/index.js
@@ -116,13 +116,13 @@ function makeSnippet( doc, query ) {
// find up to 4 matches in the document and extract snippets to be joined together
// TODO: detect when snippets overlap and merge them.
while ( ( match = termRegex.exec( doc.body ) ) !== null && snippets.length < 4 ) {
- const matchStr = match[ 1 ],
- index = match.index + 1,
- before = doc.body.substring( index - SNIPPET_PAD_LENGTH, index ),
- after = doc.body.substring(
- index + matchStr.length,
- index + matchStr.length + SNIPPET_PAD_LENGTH
- );
+ const matchStr = match[ 1 ];
+ const index = match.index + 1;
+ const before = doc.body.substring( index - SNIPPET_PAD_LENGTH, index );
+ const after = doc.body.substring(
+ index + matchStr.length,
+ index + matchStr.length + SNIPPET_PAD_LENGTH
+ );
snippets.push( before + '' + matchStr + '' + after );
}
diff --git a/client/server/pages/index.js b/client/server/pages/index.js
index 586f88e21379a..2fb1c6f392308 100644
--- a/client/server/pages/index.js
+++ b/client/server/pages/index.js
@@ -269,7 +269,8 @@ function setUpLoggedOutRoute( req, res, next ) {
}
function setUpLoggedInRoute( req, res, next ) {
- let redirectUrl, start;
+ let redirectUrl;
+ let start;
res.set( {
'X-Frame-Options': 'SAMEORIGIN',
diff --git a/client/server/pages/test/analytics.js b/client/server/pages/test/analytics.js
index 41b81f4776c8e..0861972c30ac8 100644
--- a/client/server/pages/test/analytics.js
+++ b/client/server/pages/test/analytics.js
@@ -18,8 +18,11 @@ const TWO_SECONDS = 2000;
describe( 'index', () => {
describe( 'logSectionResponse middleware', () => {
// Stub request, response, and next
- let request, response, next;
- let request2, response2;
+ let request;
+ let response;
+ let next;
+ let request2;
+ let response2;
beforeEach( () => {
request = { context: {} };
request2 = { context: {} };
diff --git a/client/server/pages/test/index.js b/client/server/pages/test/index.js
index 91b4df21c7b11..0827bc899fa82 100644
--- a/client/server/pages/test/index.js
+++ b/client/server/pages/test/index.js
@@ -943,7 +943,8 @@ const assertSection = ( { url, entry, sectionName, sectionGroup } ) => {
} );
describe( 'for authenticated users', () => {
- let theStore, theAction;
+ let theStore;
+ let theAction;
beforeEach( () => {
theStore = {
diff --git a/client/server/sanitize/index.js b/client/server/sanitize/index.js
index 0bc2f368e965e..7821bb305943f 100644
--- a/client/server/sanitize/index.js
+++ b/client/server/sanitize/index.js
@@ -12,8 +12,8 @@
*/
function jsSlashEncoder( charStr ) {
- const code = charStr.charCodeAt( 0 ),
- hex = code.toString( 16 ).toUpperCase();
+ const code = charStr.charCodeAt( 0 );
+ const hex = code.toString( 16 ).toUpperCase();
if ( code < 0x80 ) {
// ASCII
diff --git a/client/server/user-bootstrap/index.js b/client/server/user-bootstrap/index.js
index cecfe89ea8ef5..e1b9ef6e74eda 100644
--- a/client/server/user-bootstrap/index.js
+++ b/client/server/user-bootstrap/index.js
@@ -13,18 +13,18 @@ import { filterUserObject } from 'calypso/lib/user/shared-utils';
import { getActiveTestNames } from 'calypso/lib/abtest/utility';
import config from 'calypso/config';
-const debug = debugFactory( 'calypso:bootstrap' ),
- AUTH_COOKIE_NAME = 'wordpress_logged_in',
- SUPPORT_SESSION_COOKIE_NAME = 'support_session_id',
- /**
- * WordPress.com REST API /me endpoint.
- */
- API_PATH = 'https://public-api.wordpress.com/rest/v1/me',
- apiQuery = {
- meta: 'flags',
- abtests: getActiveTestNames( { appendDatestamp: true, asCSV: true } ),
- },
- url = `${ API_PATH }?${ stringify( apiQuery ) }`;
+const debug = debugFactory( 'calypso:bootstrap' );
+const AUTH_COOKIE_NAME = 'wordpress_logged_in';
+const SUPPORT_SESSION_COOKIE_NAME = 'support_session_id';
+/**
+ * WordPress.com REST API /me endpoint.
+ */
+const API_PATH = 'https://public-api.wordpress.com/rest/v1/me';
+const apiQuery = {
+ meta: 'flags',
+ abtests: getActiveTestNames( { appendDatestamp: true, asCSV: true } ),
+};
+const url = `${ API_PATH }?${ stringify( apiQuery ) }`;
const getApiKey = () => config( 'wpcom_calypso_rest_api_key' );
const getSupportSessionApiKey = () => config( 'wpcom_calypso_support_session_rest_api_key' );
diff --git a/client/signup/main.jsx b/client/signup/main.jsx
index 280e4a6ac12be..6d1ad5f1d46d3 100644
--- a/client/signup/main.jsx
+++ b/client/signup/main.jsx
@@ -345,9 +345,9 @@ class Signup extends React.Component {
}
updateShouldShowLoadingScreen = ( progress = this.props.progress ) => {
- const hasInvalidSteps = !! getFirstInvalidStep( this.props.flowName, progress ),
- waitingForServer = ! hasInvalidSteps && this.isEveryStepSubmitted( progress ),
- startLoadingScreen = waitingForServer && ! this.state.shouldShowLoadingScreen;
+ const hasInvalidSteps = !! getFirstInvalidStep( this.props.flowName, progress );
+ const waitingForServer = ! hasInvalidSteps && this.isEveryStepSubmitted( progress );
+ const startLoadingScreen = waitingForServer && ! this.state.shouldShowLoadingScreen;
if ( ! this.isEveryStepSubmitted( progress ) ) {
this.goToFirstInvalidStep( progress );
diff --git a/client/signup/navigation-link/index.jsx b/client/signup/navigation-link/index.jsx
index 9c8e35f958d68..4927e37e09186 100644
--- a/client/signup/navigation-link/index.jsx
+++ b/client/signup/navigation-link/index.jsx
@@ -130,7 +130,9 @@ export class NavigationLink extends Component {
return null;
}
- let backGridicon, forwardGridicon, text;
+ let backGridicon;
+ let forwardGridicon;
+ let text;
if ( this.props.direction === 'back' ) {
backGridicon = ;
diff --git a/client/signup/steps/domains/index.jsx b/client/signup/steps/domains/index.jsx
index 25bf6ae7f8fa2..87318ab2b48c9 100644
--- a/client/signup/steps/domains/index.jsx
+++ b/client/signup/steps/domains/index.jsx
@@ -230,9 +230,11 @@ class DomainsStep extends React.Component {
};
getThemeArgs = () => {
- const themeSlug = this.getThemeSlug(),
- themeSlugWithRepo = this.getThemeSlugWithRepo( themeSlug ),
- theme = this.isPurchasingTheme() ? themeItem( themeSlug, 'signup-with-theme' ) : undefined;
+ const themeSlug = this.getThemeSlug();
+ const themeSlugWithRepo = this.getThemeSlugWithRepo( themeSlug );
+ const theme = this.isPurchasingTheme()
+ ? themeItem( themeSlug, 'signup-with-theme' )
+ : undefined;
return { themeSlug, themeSlugWithRepo, themeItem: theme };
};
@@ -541,9 +543,9 @@ class DomainsStep extends React.Component {
};
mappingForm = () => {
- const initialState = this.props.step ? this.props.step.mappingForm : undefined,
- initialQuery =
- this.props.step && this.props.step.domainForm && this.props.step.domainForm.lastQuery;
+ const initialState = this.props.step ? this.props.step.mappingForm : undefined;
+ const initialQuery =
+ this.props.step && this.props.step.domainForm && this.props.step.domainForm.lastQuery;
return (
@@ -691,7 +693,9 @@ class DomainsStep extends React.Component {
const { flowName, isAllDomains, translate, sites } = this.props;
const hasSite = Object.keys( sites ).length > 0;
- let backUrl, backLabelText, isExternalBackUrl;
+ let backUrl;
+ let backLabelText;
+ let isExternalBackUrl;
if ( 'transfer' === this.props.stepSectionName || 'mapping' === this.props.stepSectionName ) {
backUrl = getStepUrl(
diff --git a/client/signup/steps/p2-site/index.jsx b/client/signup/steps/p2-site/index.jsx
index e4b2841c8432d..86b1962009558 100644
--- a/client/signup/steps/p2-site/index.jsx
+++ b/client/signup/steps/p2-site/index.jsx
@@ -50,8 +50,8 @@ const WPCOM_SUBDOMAIN_SUFFIX_SUGGESTIONS = [ 'p2', 'team', 'work' ];
/**
* Module variables
*/
-let siteUrlsSearched = [],
- timesValidationFailed = 0;
+let siteUrlsSearched = [];
+let timesValidationFailed = 0;
class P2Site extends React.Component {
static displayName = 'P2Site';
@@ -319,10 +319,10 @@ class P2Site extends React.Component {
getErrorMessagesWithLogin = ( fieldName ) => {
const link = login( {
- isNative: config.isEnabled( 'login/native-login-links' ),
- redirectTo: window.location.href,
- } ),
- messages = formState.getFieldErrorMessages( this.state.form, fieldName );
+ isNative: config.isEnabled( 'login/native-login-links' ),
+ redirectTo: window.location.href,
+ } );
+ const messages = formState.getFieldErrorMessages( this.state.form, fieldName );
if ( ! messages ) {
return;
diff --git a/client/signup/steps/plans/index.jsx b/client/signup/steps/plans/index.jsx
index ca4876f1c50f5..5cb8ac69e1f48 100644
--- a/client/signup/steps/plans/index.jsx
+++ b/client/signup/steps/plans/index.jsx
@@ -200,7 +200,8 @@ export class PlansStep extends Component {
const subHeaderText = this.getSubHeaderText();
const fallbackSubHeaderText = this.props.fallbackSubHeaderText || subHeaderText;
- let backUrl, backLabelText;
+ let backUrl;
+ let backLabelText;
if ( 0 === positionInFlow && hasInitializedSitesBackUrl ) {
backUrl = hasInitializedSitesBackUrl;
diff --git a/client/signup/steps/site-picker/site-picker-submit.jsx b/client/signup/steps/site-picker/site-picker-submit.jsx
index 227a1a2b21f38..b9ef5a97897f8 100644
--- a/client/signup/steps/site-picker/site-picker-submit.jsx
+++ b/client/signup/steps/site-picker/site-picker-submit.jsx
@@ -17,9 +17,9 @@ export const siteHasPaidPlan = ( selectedSite ) =>
export class SitePickerSubmit extends React.Component {
UNSAFE_componentWillMount() {
- const { stepSectionName, stepName, goToStep, selectedSite } = this.props,
- hasPaidPlan = siteHasPaidPlan( selectedSite ),
- { ID: siteId, slug: siteSlug } = selectedSite;
+ const { stepSectionName, stepName, goToStep, selectedSite } = this.props;
+ const hasPaidPlan = siteHasPaidPlan( selectedSite );
+ const { ID: siteId, slug: siteSlug } = selectedSite;
this.props.submitSignupStep( {
stepName,
diff --git a/client/signup/steps/site/index.jsx b/client/signup/steps/site/index.jsx
index e6e4231b2b57b..6f6d44a1d018f 100644
--- a/client/signup/steps/site/index.jsx
+++ b/client/signup/steps/site/index.jsx
@@ -39,8 +39,8 @@ const VALIDATION_DELAY_AFTER_FIELD_CHANGES = 1500;
/**
* Module variables
*/
-let siteUrlsSearched = [],
- timesValidationFailed = 0;
+let siteUrlsSearched = [];
+let timesValidationFailed = 0;
class Site extends React.Component {
static displayName = 'Site';
@@ -204,10 +204,10 @@ class Site extends React.Component {
getErrorMessagesWithLogin = ( fieldName ) => {
const link = login( {
- isNative: config.isEnabled( 'login/native-login-links' ),
- redirectTo: window.location.href,
- } ),
- messages = formState.getFieldErrorMessages( this.state.form, fieldName );
+ isNative: config.isEnabled( 'login/native-login-links' ),
+ redirectTo: window.location.href,
+ } );
+ const messages = formState.getFieldErrorMessages( this.state.form, fieldName );
if ( ! messages ) {
return;
diff --git a/client/signup/steps/user/index.jsx b/client/signup/steps/user/index.jsx
index 5c5521556fd28..1d6113890745c 100644
--- a/client/signup/steps/user/index.jsx
+++ b/client/signup/steps/user/index.jsx
@@ -389,7 +389,8 @@ export class UserStep extends Component {
renderSignupForm() {
const { oauth2Client, wccomFrom, flowName } = this.props;
- let socialService, socialServiceResponse;
+ let socialService;
+ let socialServiceResponse;
let isSocialSignupEnabled = this.props.isSocialSignupEnabled;
const hashObject = this.props.initialContext && this.props.initialContext.hash;
if ( this.props.isSocialSignupEnabled && ! isEmpty( hashObject ) ) {
diff --git a/client/signup/steps/user/test/index.js b/client/signup/steps/user/test/index.js
index cea3c558624b9..cd99265574aed 100644
--- a/client/signup/steps/user/test/index.js
+++ b/client/signup/steps/user/test/index.js
@@ -41,7 +41,8 @@ jest.mock( 'signup/utils', () => ( {
} ) );
describe( '#signupStep User', () => {
- let testElement, rendered;
+ let testElement;
+ let rendered;
test( 'should show community subheader text if User step is first in the flow', () => {
testElement = React.createElement( User, {
@@ -66,7 +67,9 @@ describe( '#signupStep User', () => {
} );
describe( '#updateComponentProps', () => {
- let node, spyComponentProps, component;
+ let node;
+ let spyComponentProps;
+ let component;
beforeEach( () => {
node = document.createElement( 'div' );
diff --git a/client/signup/utils.js b/client/signup/utils.js
index 6ce0fa56162e1..2abb387b626b8 100644
--- a/client/signup/utils.js
+++ b/client/signup/utils.js
@@ -44,13 +44,13 @@ function isStepSectionName( pathFragment ) {
}
export function getStepUrl( flowName, stepName, stepSectionName, localeSlug ) {
- const flow = flowName ? `/${ flowName }` : '',
- step = stepName ? `/${ stepName }` : '',
- section = stepSectionName ? `/${ stepSectionName }` : '',
- // when the user is logged in, the locale slug is meaningless in a
- // signup URL, as the page will be translated in the language the user
- // has in their settings.
- locale = localeSlug && ! user().get() ? `/${ localeSlug }` : '';
+ const flow = flowName ? `/${ flowName }` : '';
+ const step = stepName ? `/${ stepName }` : '';
+ const section = stepSectionName ? `/${ stepSectionName }` : '';
+ // when the user is logged in, the locale slug is meaningless in a
+ // signup URL, as the page will be translated in the language the user
+ // has in their settings.
+ const locale = localeSlug && ! user().get() ? `/${ localeSlug }` : '';
if ( flowName === defaultFlowName ) {
// we don't include the default flow name in the route
diff --git a/client/state/country-states/test/reducer.js b/client/state/country-states/test/reducer.js
index b17669dd67ee4..77f9b289b0463 100644
--- a/client/state/country-states/test/reducer.js
+++ b/client/state/country-states/test/reducer.js
@@ -60,14 +60,14 @@ describe( 'reducer', () => {
describe( 'persistence', () => {
test( 'persists state', () => {
- const original = deepFreeze( { us: originalCountryStates } ),
- state = items( original, { type: SERIALIZE } );
+ const original = deepFreeze( { us: originalCountryStates } );
+ const state = items( original, { type: SERIALIZE } );
expect( state ).to.eql( original );
} );
test( 'loads valid persisted state', () => {
- const original = deepFreeze( { us: originalCountryStates } ),
- state = items( original, { type: DESERIALIZE } );
+ const original = deepFreeze( { us: originalCountryStates } );
+ const state = items( original, { type: DESERIALIZE } );
expect( state ).to.eql( original );
} );
diff --git a/client/state/data-layer/wpcom/email-accounts/test/index.js b/client/state/data-layer/wpcom/email-accounts/test/index.js
index 782cb816af405..765cf39ff4829 100644
--- a/client/state/data-layer/wpcom/email-accounts/test/index.js
+++ b/client/state/data-layer/wpcom/email-accounts/test/index.js
@@ -21,11 +21,11 @@ const isErrorNotice = ( action ) => {
describe( 'wpcom-api', () => {
describe( 'email accounts request', () => {
- const siteId = 1,
- action = {
- type: EMAIL_ACCOUNTS_REQUEST,
- siteId,
- };
+ const siteId = 1;
+ const action = {
+ type: EMAIL_ACCOUNTS_REQUEST,
+ siteId,
+ };
describe( '#getEmailAccounts', () => {
test( 'should dispatch an HTTP request to the get email-accounts endpoint', () => {
diff --git a/client/state/data-layer/wpcom/email-forwarding/add/test/index.js b/client/state/data-layer/wpcom/email-forwarding/add/test/index.js
index e19e9a3c69e37..fcfe5ff0a76f6 100644
--- a/client/state/data-layer/wpcom/email-forwarding/add/test/index.js
+++ b/client/state/data-layer/wpcom/email-forwarding/add/test/index.js
@@ -18,15 +18,15 @@ import { http } from 'calypso/state/data-layer/wpcom-http/actions';
describe( 'wpcom-api', () => {
describe( 'email forwarding add forward request', () => {
- const domainName = 'example.com',
- mailbox = 'test',
- destination = '123@abc.com',
- action = {
- type: EMAIL_FORWARDING_ADD_REQUEST,
- domainName,
- mailbox,
- destination,
- };
+ const domainName = 'example.com';
+ const mailbox = 'test';
+ const destination = '123@abc.com';
+ const action = {
+ type: EMAIL_FORWARDING_ADD_REQUEST,
+ domainName,
+ mailbox,
+ destination,
+ };
describe( '#addEmailForward', () => {
test( 'should dispatch an HTTP request to the email forward new endpoint', () => {
diff --git a/client/state/data-layer/wpcom/email-forwarding/get/test/index.js b/client/state/data-layer/wpcom/email-forwarding/get/test/index.js
index 5dafceaeb54b4..774a60604b697 100644
--- a/client/state/data-layer/wpcom/email-forwarding/get/test/index.js
+++ b/client/state/data-layer/wpcom/email-forwarding/get/test/index.js
@@ -18,11 +18,11 @@ import { http } from 'calypso/state/data-layer/wpcom-http/actions';
describe( 'wpcom-api', () => {
describe( 'email forwarding get forwards request', () => {
- const domainName = 'example.com',
- action = {
- type: EMAIL_FORWARDING_REQUEST,
- domainName,
- };
+ const domainName = 'example.com';
+ const action = {
+ type: EMAIL_FORWARDING_REQUEST,
+ domainName,
+ };
describe( '#getEmailForwards', () => {
test( 'should dispatch an HTTP request to the get email forwards endpoint', () => {
diff --git a/client/state/data-layer/wpcom/email-forwarding/remove/test/index.js b/client/state/data-layer/wpcom/email-forwarding/remove/test/index.js
index 6e7f954e1ad21..9c3a607cb8338 100644
--- a/client/state/data-layer/wpcom/email-forwarding/remove/test/index.js
+++ b/client/state/data-layer/wpcom/email-forwarding/remove/test/index.js
@@ -18,13 +18,13 @@ import { http } from 'calypso/state/data-layer/wpcom-http/actions';
describe( 'wpcom-api', () => {
describe( 'email forwarding remove forward request', () => {
- const domainName = 'example.com',
- mailbox = 'test',
- action = {
- type: EMAIL_FORWARDING_REMOVE_REQUEST,
- domainName,
- mailbox,
- };
+ const domainName = 'example.com';
+ const mailbox = 'test';
+ const action = {
+ type: EMAIL_FORWARDING_REMOVE_REQUEST,
+ domainName,
+ mailbox,
+ };
describe( '#removeEmailForward', () => {
test( 'should dispatch an HTTP request to the email forward delete endpoint', () => {
diff --git a/client/state/data-layer/wpcom/email-forwarding/resend-email-verification/test/index.js b/client/state/data-layer/wpcom/email-forwarding/resend-email-verification/test/index.js
index f98784cf82ed0..90b7ca5b24200 100644
--- a/client/state/data-layer/wpcom/email-forwarding/resend-email-verification/test/index.js
+++ b/client/state/data-layer/wpcom/email-forwarding/resend-email-verification/test/index.js
@@ -22,15 +22,15 @@ import { http } from 'calypso/state/data-layer/wpcom-http/actions';
describe( 'wpcom-api', () => {
describe( 'email forwarding resend verification email request', () => {
- const domainName = 'example.com',
- mailbox = 'test',
- destination = '123@abc.com',
- action = {
- type: EMAIL_FORWARDING_RESEND_VERIFICATION_REQUEST,
- domainName,
- mailbox,
- destination,
- };
+ const domainName = 'example.com';
+ const mailbox = 'test';
+ const destination = '123@abc.com';
+ const action = {
+ type: EMAIL_FORWARDING_RESEND_VERIFICATION_REQUEST,
+ domainName,
+ mailbox,
+ destination,
+ };
describe( '#requestResendEmailVerification', () => {
test( 'should dispatch an HTTP request to the email forward resend-verification endpoint', () => {
diff --git a/client/state/data-layer/wpcom/gravatar-upload/test/index.js b/client/state/data-layer/wpcom/gravatar-upload/test/index.js
index de4628dabc673..92b9328e911fc 100644
--- a/client/state/data-layer/wpcom/gravatar-upload/test/index.js
+++ b/client/state/data-layer/wpcom/gravatar-upload/test/index.js
@@ -42,7 +42,8 @@ describe( '#uploadGravatar()', () => {
} );
describe( '#announceSuccess()', () => {
- let oFormData, oFileReader;
+ let oFormData;
+ let oFileReader;
const noop = () => {};
const tempImageSrc = 'tempImageSrc';
diff --git a/client/state/data-layer/wpcom/gsuite-users/test/index.js b/client/state/data-layer/wpcom/gsuite-users/test/index.js
index 91cf948eab1fa..9c450712d09e0 100644
--- a/client/state/data-layer/wpcom/gsuite-users/test/index.js
+++ b/client/state/data-layer/wpcom/gsuite-users/test/index.js
@@ -18,11 +18,11 @@ import { http } from 'calypso/state/data-layer/wpcom-http/actions';
describe( 'wpcom-api', () => {
describe( 'g suite users get users request', () => {
- const siteId = 1,
- action = {
- type: GSUITE_USERS_REQUEST,
- siteId,
- };
+ const siteId = 1;
+ const action = {
+ type: GSUITE_USERS_REQUEST,
+ siteId,
+ };
describe( '#getGSuiteUsers', () => {
test( 'should dispatch an HTTP request to the get google-apps endpoint', () => {
diff --git a/client/state/domains/suggestions/test/actions.js b/client/state/domains/suggestions/test/actions.js
index 92f1c037ee800..ca797b448e6ce 100644
--- a/client/state/domains/suggestions/test/actions.js
+++ b/client/state/domains/suggestions/test/actions.js
@@ -17,7 +17,8 @@ import useNock from 'calypso/test-helpers/use-nock';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/happychat/test/middleware-calypso.js b/client/state/happychat/test/middleware-calypso.js
index a57c2e7d7a204..65790d8376389 100644
--- a/client/state/happychat/test/middleware-calypso.js
+++ b/client/state/happychat/test/middleware-calypso.js
@@ -34,7 +34,8 @@ import {
} from 'calypso/state/action-types';
describe( 'middleware', () => {
- let actionMiddleware, store;
+ let actionMiddleware;
+ let store;
beforeEach( () => {
store = {
getState: jest.fn(),
diff --git a/client/state/happychat/test/middleware.js b/client/state/happychat/test/middleware.js
index 4d7ffdcc032c7..4d12867bbfc82 100644
--- a/client/state/happychat/test/middleware.js
+++ b/client/state/happychat/test/middleware.js
@@ -33,7 +33,9 @@ import {
} from 'calypso/state/happychat/constants';
describe( 'middleware', () => {
- let actionMiddleware, connection, store;
+ let actionMiddleware;
+ let connection;
+ let store;
beforeEach( () => {
connection = {
init: jest.fn(),
diff --git a/client/state/http/index.js b/client/state/http/index.js
index 7e74cdcc02d06..79e0725952edb 100644
--- a/client/state/http/index.js
+++ b/client/state/http/index.js
@@ -78,7 +78,8 @@ export const httpHandler = async ( { dispatch }, action ) => {
const queryString = encodeQueryParameters( queryParams );
- let response, json;
+ let response;
+ let json;
try {
response = await fetch( queryString.length ? `${ url }?${ queryString }` : url, {
method,
diff --git a/client/state/jetpack-sync/selectors.js b/client/state/jetpack-sync/selectors.js
index c982ad03eddd0..c516bffa4aea5 100644
--- a/client/state/jetpack-sync/selectors.js
+++ b/client/state/jetpack-sync/selectors.js
@@ -81,8 +81,8 @@ function isImmediateFullSync( state, siteId ) {
* @returns {number} The percentage of sync completed, expressed as an integer
*/
function getImmediateSyncProgressPercentage( state, siteId ) {
- const syncStatus = getSyncStatus( state, siteId ),
- progress = get( syncStatus, 'progress' );
+ const syncStatus = getSyncStatus( state, siteId );
+ const progress = get( syncStatus, 'progress' );
if ( ! progress ) {
return 0;
@@ -135,12 +135,12 @@ function getSyncProgressPercentage( state, siteId ) {
return getImmediateSyncProgressPercentage( state, siteId );
}
- const syncStatus = getSyncStatus( state, siteId ),
- queued = get( syncStatus, 'queue' ),
- sent = get( syncStatus, 'sent' ),
- total = get( syncStatus, 'total' ),
- queuedMultiplier = 0.1,
- sentMultiplier = 0.9;
+ const syncStatus = getSyncStatus( state, siteId );
+ const queued = get( syncStatus, 'queue' );
+ const sent = get( syncStatus, 'sent' );
+ const total = get( syncStatus, 'total' );
+ const queuedMultiplier = 0.1;
+ const sentMultiplier = 0.9;
if ( isPendingSyncStart( state, siteId ) || ! queued || ! sent || ! total ) {
return 0;
diff --git a/client/state/jetpack-sync/test/actions.js b/client/state/jetpack-sync/test/actions.js
index 2e2ebeaea34fc..d02db7abbae3f 100644
--- a/client/state/jetpack-sync/test/actions.js
+++ b/client/state/jetpack-sync/test/actions.js
@@ -19,7 +19,8 @@ import useNock from 'calypso/test-helpers/use-nock';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/jetpack/connection/test/reducer.js b/client/state/jetpack/connection/test/reducer.js
index 6f67b6cd87ba1..6c903a9a966ef 100644
--- a/client/state/jetpack/connection/test/reducer.js
+++ b/client/state/jetpack/connection/test/reducer.js
@@ -41,13 +41,13 @@ describe( 'reducer', () => {
} );
test( 'should update connection statuses in the items object', () => {
- const stateIn = ITEMS_FIXTURE,
- siteId = 12345678,
- action = {
- type: JETPACK_CONNECTION_STATUS_RECEIVE,
- siteId,
- status: ITEMS_FIXTURE[ 87654321 ],
- };
+ const stateIn = ITEMS_FIXTURE;
+ const siteId = 12345678;
+ const action = {
+ type: JETPACK_CONNECTION_STATUS_RECEIVE,
+ siteId,
+ status: ITEMS_FIXTURE[ 87654321 ],
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...ITEMS_FIXTURE,
@@ -56,13 +56,13 @@ describe( 'reducer', () => {
} );
test( 'should accummulate connection statuses for separate sites in the items object', () => {
- const stateIn = ITEMS_FIXTURE,
- siteId = 11223344,
- action = {
- type: JETPACK_CONNECTION_STATUS_RECEIVE,
- siteId,
- status: ITEMS_FIXTURE[ 87654321 ],
- };
+ const stateIn = ITEMS_FIXTURE;
+ const siteId = 11223344;
+ const action = {
+ type: JETPACK_CONNECTION_STATUS_RECEIVE,
+ siteId,
+ status: ITEMS_FIXTURE[ 87654321 ],
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...ITEMS_FIXTURE,
@@ -78,12 +78,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to true for the specified site when status request starts', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 12345678,
- action = {
- type: JETPACK_CONNECTION_STATUS_REQUEST,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 12345678;
+ const action = {
+ type: JETPACK_CONNECTION_STATUS_REQUEST,
+ siteId,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -92,12 +92,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to false for the specified site when status request completes successfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_CONNECTION_STATUS_REQUEST_SUCCESS,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_CONNECTION_STATUS_REQUEST_SUCCESS,
+ siteId,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -106,12 +106,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to false for the specified site when status request completes unsuccessfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_CONNECTION_STATUS_REQUEST_FAILURE,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_CONNECTION_STATUS_REQUEST_FAILURE,
+ siteId,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -127,13 +127,13 @@ describe( 'reducer', () => {
} );
test( 'should update user connection data in the items object', () => {
- const stateIn = DATA_ITEMS_FIXTURE,
- siteId = 12345678,
- action = {
- type: JETPACK_USER_CONNECTION_DATA_RECEIVE,
- siteId,
- data: DATA_ITEMS_FIXTURE[ 87654321 ],
- };
+ const stateIn = DATA_ITEMS_FIXTURE;
+ const siteId = 12345678;
+ const action = {
+ type: JETPACK_USER_CONNECTION_DATA_RECEIVE,
+ siteId,
+ data: DATA_ITEMS_FIXTURE[ 87654321 ],
+ };
const stateOut = dataItemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...DATA_ITEMS_FIXTURE,
@@ -142,13 +142,13 @@ describe( 'reducer', () => {
} );
test( 'should accummulate user connection data for separate sites in the items object', () => {
- const stateIn = DATA_ITEMS_FIXTURE,
- siteId = 11223344,
- action = {
- type: JETPACK_USER_CONNECTION_DATA_RECEIVE,
- siteId,
- data: DATA_ITEMS_FIXTURE[ 87654321 ],
- };
+ const stateIn = DATA_ITEMS_FIXTURE;
+ const siteId = 11223344;
+ const action = {
+ type: JETPACK_USER_CONNECTION_DATA_RECEIVE,
+ siteId,
+ data: DATA_ITEMS_FIXTURE[ 87654321 ],
+ };
const stateOut = dataItemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...DATA_ITEMS_FIXTURE,
@@ -164,12 +164,12 @@ describe( 'reducer', () => {
} );
test( 'should set dataRequests to true for the specified site when data request starts', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 12345678,
- action = {
- type: JETPACK_USER_CONNECTION_DATA_REQUEST,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 12345678;
+ const action = {
+ type: JETPACK_USER_CONNECTION_DATA_REQUEST,
+ siteId,
+ };
const stateOut = dataRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -178,12 +178,12 @@ describe( 'reducer', () => {
} );
test( 'should set dataRequests to false for the specified site when data request completes successfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_USER_CONNECTION_DATA_REQUEST_SUCCESS,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_USER_CONNECTION_DATA_REQUEST_SUCCESS,
+ siteId,
+ };
const stateOut = dataRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -192,12 +192,12 @@ describe( 'reducer', () => {
} );
test( 'should set dataRequests to false for the specified site when data request completes unsuccessfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_USER_CONNECTION_DATA_REQUEST_FAILURE,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_USER_CONNECTION_DATA_REQUEST_FAILURE,
+ siteId,
+ };
const stateOut = dataRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -213,12 +213,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to true for the specified site when disconnect request starts', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 12345678,
- action = {
- type: JETPACK_DISCONNECT_REQUEST,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 12345678;
+ const action = {
+ type: JETPACK_DISCONNECT_REQUEST,
+ siteId,
+ };
const stateOut = disconnectRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -227,12 +227,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to false for the specified site when disconnect request completes successfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_DISCONNECT_REQUEST_SUCCESS,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_DISCONNECT_REQUEST_SUCCESS,
+ siteId,
+ };
const stateOut = disconnectRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
...REQUESTS_FIXTURE,
@@ -241,12 +241,12 @@ describe( 'reducer', () => {
} );
test( 'should set requesting to false for the specified site when disconnect request completes unsuccessfully', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 87654321,
- action = {
- type: JETPACK_DISCONNECT_REQUEST_FAILURE,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 87654321;
+ const action = {
+ type: JETPACK_DISCONNECT_REQUEST_FAILURE,
+ siteId,
+ };
const stateOut = disconnectRequestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {
diff --git a/client/state/jetpack/modules/test/reducer.js b/client/state/jetpack/modules/test/reducer.js
index 3d0f811095230..825bf547980ab 100644
--- a/client/state/jetpack/modules/test/reducer.js
+++ b/client/state/jetpack/modules/test/reducer.js
@@ -34,81 +34,81 @@ describe( 'reducer', () => {
} );
test( 'should activate a module', () => {
- const stateIn = MODULES_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_ACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'module-a',
- };
+ const stateIn = MODULES_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_ACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'module-a',
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ 'module-a' ].active ).to.be.true;
} );
test( 'should deactivate a module', () => {
- const stateIn = MODULES_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'module-b',
- };
+ const stateIn = MODULES_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'module-b',
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ 'module-b' ].active ).to.be.false;
} );
test( 'should not persist state', () => {
- const stateIn = MODULES_FIXTURE,
- action = {
- type: SERIALIZE,
- };
+ const stateIn = MODULES_FIXTURE;
+ const action = {
+ type: SERIALIZE,
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.be.undefined;
} );
test( 'should not load persisted state', () => {
- const stateIn = MODULES_FIXTURE,
- action = {
- type: DESERIALIZE,
- };
+ const stateIn = MODULES_FIXTURE;
+ const action = {
+ type: DESERIALIZE,
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {} );
} );
test( 'should replace the items object for the site with a new list of modules', () => {
- const stateIn = MODULES_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULES_RECEIVE,
- siteId,
- modules: MODULES_FIXTURE[ siteId ],
- };
+ const stateIn = MODULES_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULES_RECEIVE,
+ siteId,
+ modules: MODULES_FIXTURE[ siteId ],
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ] ).to.eql( MODULES_FIXTURE[ siteId ] );
} );
test( 'should update modules activation state when updating settings', () => {
- const siteId = 123456,
- stateIn = {
- 123456: {
- 'related-posts': {
- module: 'related-posts',
- active: false,
- },
- 'infinite-scroll': {
- module: 'infinite-scroll',
- active: true,
- },
+ const siteId = 123456;
+ const stateIn = {
+ 123456: {
+ 'related-posts': {
+ module: 'related-posts',
+ active: false,
},
- },
- action = {
- type: JETPACK_SETTINGS_SAVE_SUCCESS,
- siteId,
- settings: {
- 'related-posts': true,
- 'infinite-scroll': false,
+ 'infinite-scroll': {
+ module: 'infinite-scroll',
+ active: true,
},
- };
+ },
+ };
+ const action = {
+ type: JETPACK_SETTINGS_SAVE_SUCCESS,
+ siteId,
+ settings: {
+ 'related-posts': true,
+ 'infinite-scroll': false,
+ },
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ] ).to.eql( {
'related-posts': {
@@ -123,27 +123,27 @@ describe( 'reducer', () => {
} );
test( 'should update modules activation state when receiving new settings', () => {
- const siteId = 123456,
- stateIn = {
- 123456: {
- 'related-posts': {
- module: 'related-posts',
- active: false,
- },
- 'infinite-scroll': {
- module: 'infinite-scroll',
- active: true,
- },
+ const siteId = 123456;
+ const stateIn = {
+ 123456: {
+ 'related-posts': {
+ module: 'related-posts',
+ active: false,
},
- },
- action = {
- type: JETPACK_SETTINGS_UPDATE,
- siteId,
- settings: {
- 'related-posts': true,
- 'infinite-scroll': false,
+ 'infinite-scroll': {
+ module: 'infinite-scroll',
+ active: true,
},
- };
+ },
+ };
+ const action = {
+ type: JETPACK_SETTINGS_UPDATE,
+ siteId,
+ settings: {
+ 'related-posts': true,
+ 'infinite-scroll': false,
+ },
+ };
const stateOut = itemsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ] ).to.eql( {
'related-posts': {
@@ -166,37 +166,37 @@ describe( 'reducer', () => {
describe( '#moduleActivation', () => {
test( 'should set [ siteId ][ moduleSlug ].activating to true when activating a module', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_ACTIVATE,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_ACTIVATE,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].activating ).to.be.true;
} );
test( 'should set [ siteId ][ moduleSlug ].activating to false when module has been activated', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_ACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_ACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].activating ).to.be.false;
} );
test( 'should set [ siteId ][ moduleSlug ].activating to false when activating a module fails', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_ACTIVATE_FAILURE,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_ACTIVATE_FAILURE,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].activating ).to.be.false;
} );
@@ -204,37 +204,37 @@ describe( 'reducer', () => {
describe( '#moduleDeactivation', () => {
test( 'should set [ siteId ][ moduleSlug ].deactivating to true when deactivating a module', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_DEACTIVATE,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_DEACTIVATE,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].deactivating ).to.be.true;
} );
test( 'should set [ siteId ][ moduleSlug ].deactivating to false when module has been deactivated', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].deactivating ).to.be.false;
} );
test( 'should set [ siteId ][ moduleSlug ].deactivating to false when deactivating a module fails', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULE_DEACTIVATE_FAILURE,
- siteId,
- moduleSlug: 'moduleSlug',
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULE_DEACTIVATE_FAILURE,
+ siteId,
+ moduleSlug: 'moduleSlug',
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ][ action.moduleSlug ].deactivating ).to.be.false;
} );
@@ -242,36 +242,36 @@ describe( 'reducer', () => {
describe( '#moduleListFetching', () => {
test( 'should set [ siteId ].fetchingModules to true when requesting the module list', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULES_REQUEST,
- siteId,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULES_REQUEST,
+ siteId,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ].fetchingModules ).to.be.true;
} );
test( 'should set [ siteId ].fetchingModules to false when the module list has been received', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULES_REQUEST_SUCCESS,
- siteId,
- modules: {},
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULES_REQUEST_SUCCESS,
+ siteId,
+ modules: {},
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ].fetchingModules ).to.be.false;
} );
test( 'should set [ siteId ].fetchingModules to false when requesting the module list fails', () => {
- const stateIn = REQUESTS_FIXTURE,
- siteId = 123456,
- action = {
- type: JETPACK_MODULES_REQUEST_FAILURE,
- siteId,
- modules: {},
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const siteId = 123456;
+ const action = {
+ type: JETPACK_MODULES_REQUEST_FAILURE,
+ siteId,
+ modules: {},
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut[ siteId ].fetchingModules ).to.be.false;
} );
@@ -279,19 +279,19 @@ describe( 'reducer', () => {
describe( 'persistence', () => {
test( 'should not persist state', () => {
- const stateIn = REQUESTS_FIXTURE,
- action = {
- type: SERIALIZE,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const action = {
+ type: SERIALIZE,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.be.undefined;
} );
test( 'should not load persisted state', () => {
- const stateIn = REQUESTS_FIXTURE,
- action = {
- type: DESERIALIZE,
- };
+ const stateIn = REQUESTS_FIXTURE;
+ const action = {
+ type: DESERIALIZE,
+ };
const stateOut = requestsReducer( deepFreeze( stateIn ), action );
expect( stateOut ).to.eql( {} );
} );
diff --git a/client/state/jetpack/settings/test/reducer.js b/client/state/jetpack/settings/test/reducer.js
index 56ab7ebc59d54..cd4b81f253869 100644
--- a/client/state/jetpack/settings/test/reducer.js
+++ b/client/state/jetpack/settings/test/reducer.js
@@ -43,18 +43,18 @@ describe( 'reducer', () => {
} );
test( 'should mark the module as active upon successful module activation', () => {
- const siteId = 12345678,
- initialState = {
- 12345678: {
- setting_123: 'test',
- 'module-a': false,
- },
+ const siteId = 12345678;
+ const initialState = {
+ 12345678: {
+ setting_123: 'test',
+ 'module-a': false,
},
- action = {
- type: JETPACK_MODULE_ACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'module-a',
- };
+ };
+ const action = {
+ type: JETPACK_MODULE_ACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'module-a',
+ };
const state = settingsReducer( deepFreeze( initialState ), action );
expect( state ).toEqual( {
12345678: {
@@ -65,18 +65,18 @@ describe( 'reducer', () => {
} );
test( 'should mark the module as inactive upon successful module deactivation', () => {
- const siteId = 12345678,
- initialState = {
- 12345678: {
- setting_123: 'test',
- 'module-a': true,
- },
+ const siteId = 12345678;
+ const initialState = {
+ 12345678: {
+ setting_123: 'test',
+ 'module-a': true,
},
- action = {
- type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
- siteId,
- moduleSlug: 'module-a',
- };
+ };
+ const action = {
+ type: JETPACK_MODULE_DEACTIVATE_SUCCESS,
+ siteId,
+ moduleSlug: 'module-a',
+ };
const state = settingsReducer( deepFreeze( initialState ), action );
expect( state ).toEqual( {
12345678: {
@@ -87,26 +87,26 @@ describe( 'reducer', () => {
} );
test( 'should update the module activation state upon receiving new modules', () => {
- const siteId = 12345678,
- initialState = {
- 12345678: {
- setting_123: 'test',
- 'module-a': true,
- 'module-b': false,
- },
+ const siteId = 12345678;
+ const initialState = {
+ 12345678: {
+ setting_123: 'test',
+ 'module-a': true,
+ 'module-b': false,
},
- action = {
- type: JETPACK_MODULES_RECEIVE,
- siteId,
- modules: {
- 'module-a': {
- active: false,
- },
- 'module-b': {
- active: true,
- },
+ };
+ const action = {
+ type: JETPACK_MODULES_RECEIVE,
+ siteId,
+ modules: {
+ 'module-a': {
+ active: false,
+ },
+ 'module-b': {
+ active: true,
},
- };
+ },
+ };
const state = settingsReducer( deepFreeze( initialState ), action );
expect( state ).toEqual( {
12345678: {
@@ -118,29 +118,29 @@ describe( 'reducer', () => {
} );
test( 'should update module settings with normalized ones when receiving new modules', () => {
- const siteId = 12345678,
- initialState = {
- 12345678: {
- setting_123: 'test',
- },
+ const siteId = 12345678;
+ const initialState = {
+ 12345678: {
+ setting_123: 'test',
},
- action = {
- type: JETPACK_MODULES_RECEIVE,
- siteId,
- modules: {
- minileven: {
- active: true,
- options: {
- wp_mobile_excerpt: {
- current_value: true,
- },
- some_other_option: {
- current_value: '123',
- },
+ };
+ const action = {
+ type: JETPACK_MODULES_RECEIVE,
+ siteId,
+ modules: {
+ minileven: {
+ active: true,
+ options: {
+ wp_mobile_excerpt: {
+ current_value: true,
+ },
+ some_other_option: {
+ current_value: '123',
},
},
},
- };
+ },
+ };
const state = settingsReducer( deepFreeze( initialState ), action );
expect( state ).toEqual( {
12345678: {
diff --git a/client/state/media/thunks/test/upload-media.js b/client/state/media/thunks/test/upload-media.js
index 28f131b2729dd..6fcab94481bd6 100644
--- a/client/state/media/thunks/test/upload-media.js
+++ b/client/state/media/thunks/test/upload-media.js
@@ -18,7 +18,8 @@ jest.mock( 'state/sites/media-storage/actions', () => ( {
} ) );
describe( 'media - thunks - uploadMedia', () => {
- let dispatch, fileUploader;
+ let dispatch;
+ let fileUploader;
const siteId = 1343323;
const site = { ID: siteId };
diff --git a/client/state/notices/test/middleware.js b/client/state/notices/test/middleware.js
index 4cd3647855bd2..1cc242d76bb6f 100644
--- a/client/state/notices/test/middleware.js
+++ b/client/state/notices/test/middleware.js
@@ -29,7 +29,8 @@ import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'middleware', () => {
describe( 'noticesMiddleware()', () => {
- let store, dispatchSpy;
+ let store;
+ let dispatchSpy;
useSandbox( ( sandbox ) => {
const spyMiddleware = () => ( next ) => {
dispatchSpy = sandbox.spy( next );
diff --git a/client/state/posts/utils/get-deserialized-posts-query-details.js b/client/state/posts/utils/get-deserialized-posts-query-details.js
index ebfa9831e1f3e..e102967e32e25 100644
--- a/client/state/posts/utils/get-deserialized-posts-query-details.js
+++ b/client/state/posts/utils/get-deserialized-posts-query-details.js
@@ -8,7 +8,8 @@ const REGEXP_SERIALIZED_QUERY = /^((\d+):)?(.*)$/;
* @returns {object} Deserialized posts query details
*/
export function getDeserializedPostsQueryDetails( serializedQuery ) {
- let siteId, query;
+ let siteId;
+ let query;
const matches = serializedQuery.match( REGEXP_SERIALIZED_QUERY );
if ( matches ) {
diff --git a/client/state/posts/utils/get-preview-url.js b/client/state/posts/utils/get-preview-url.js
index 1e005e2f095eb..c18aacf3c740e 100644
--- a/client/state/posts/utils/get-preview-url.js
+++ b/client/state/posts/utils/get-preview-url.js
@@ -4,7 +4,8 @@
import { getUrlParts, getUrlFromParts } from 'calypso/lib/url';
export function getPreviewURL( site, post, autosavePreviewUrl ) {
- let urlParts, previewUrl;
+ let urlParts;
+ let previewUrl;
if ( ! post || ! post.URL || post.status === 'trash' ) {
return '';
diff --git a/client/state/preferences/test/actions.js b/client/state/preferences/test/actions.js
index c6cf24bcf05e6..71e637ef56e1f 100644
--- a/client/state/preferences/test/actions.js
+++ b/client/state/preferences/test/actions.js
@@ -23,7 +23,8 @@ import useNock from 'calypso/test-helpers/use-nock';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/purchases/reducer.js b/client/state/purchases/reducer.js
index dd735648fc3c0..e3065b4394d22 100644
--- a/client/state/purchases/reducer.js
+++ b/client/state/purchases/reducer.js
@@ -66,7 +66,8 @@ function removeMissingPurchasesByPredicate( existingPurchases, newPurchases, pre
}
function updatePurchases( existingPurchases, action ) {
- let purchases, predicate;
+ let purchases;
+ let predicate;
if ( PURCHASES_SITE_FETCH_COMPLETED === action.type ) {
predicate = { blog_id: String( action.siteId ) };
diff --git a/client/state/purchases/test/actions.js b/client/state/purchases/test/actions.js
index e15fc00e4d91f..deb63e7c7930d 100644
--- a/client/state/purchases/test/actions.js
+++ b/client/state/purchases/test/actions.js
@@ -23,10 +23,10 @@ import {
import useNock from 'calypso/test-helpers/use-nock';
describe( 'actions', () => {
- const purchases = [ { ID: 1 } ],
- userId = 1337,
- siteId = 1234,
- purchaseId = 31337;
+ const purchases = [ { ID: 1 } ];
+ const userId = 1337;
+ const siteId = 1234;
+ const purchaseId = 31337;
const spy = sinon.spy();
diff --git a/client/state/push-notifications/test/actions.js b/client/state/push-notifications/test/actions.js
index f5a24c7ce0e6d..79b2bfd4198e5 100644
--- a/client/state/push-notifications/test/actions.js
+++ b/client/state/push-notifications/test/actions.js
@@ -18,7 +18,8 @@ import { useSandbox } from 'calypso/test-helpers/use-sinon';
const API_DOMAIN = 'https://public-api.wordpress.com:443';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/reader/posts/sizes.js b/client/state/reader/posts/sizes.js
index 2528d0728590b..728c7e39f6986 100644
--- a/client/state/reader/posts/sizes.js
+++ b/client/state/reader/posts/sizes.js
@@ -1,10 +1,10 @@
/**
* Module vars
*/
-export const READER_CONTENT_WIDTH = 800,
- PHOTO_ONLY_MIN_WIDTH = 440,
- PHOTO_ONLY_MAX_CHARACTER_COUNT = 85,
- GALLERY_MIN_IMAGES = 4,
- GALLERY_MIN_IMAGE_WIDTH = 300,
- MIN_IMAGE_WIDTH = 144,
- MIN_IMAGE_HEIGHT = 72;
+export const READER_CONTENT_WIDTH = 800;
+export const PHOTO_ONLY_MIN_WIDTH = 440;
+export const PHOTO_ONLY_MAX_CHARACTER_COUNT = 85;
+export const GALLERY_MIN_IMAGES = 4;
+export const GALLERY_MIN_IMAGE_WIDTH = 300;
+export const MIN_IMAGE_WIDTH = 144;
+export const MIN_IMAGE_HEIGHT = 72;
diff --git a/client/state/reader/streams/reducer.js b/client/state/reader/streams/reducer.js
index 2117c593136bb..6883cf0309c5b 100644
--- a/client/state/reader/streams/reducer.js
+++ b/client/state/reader/streams/reducer.js
@@ -25,7 +25,10 @@ import { combineXPosts } from './utils';
* Contains a list of post-keys representing the items of a stream.
*/
export const items = ( state = [], action ) => {
- let streamItems, gap, newState, newXPosts;
+ let streamItems;
+ let gap;
+ let newState;
+ let newXPosts;
switch ( action.type ) {
case READER_STREAMS_PAGE_RECEIVE:
@@ -94,7 +97,11 @@ export const PENDING_ITEMS_DEFAULT = { lastUpdated: null, items: [] };
* This is the data backing the orange "${number} new posts" pill.
*/
export const pendingItems = ( state = PENDING_ITEMS_DEFAULT, action ) => {
- let streamItems, maxDate, minDate, newItems, newXPosts;
+ let streamItems;
+ let maxDate;
+ let minDate;
+ let newItems;
+ let newXPosts;
switch ( action.type ) {
case READER_STREAMS_PAGE_RECEIVE:
streamItems = action.payload.streamItems;
diff --git a/client/state/receipts/test/reducer.js b/client/state/receipts/test/reducer.js
index d537af28bfaa4..8a1cf6a24ec40 100644
--- a/client/state/receipts/test/reducer.js
+++ b/client/state/receipts/test/reducer.js
@@ -39,18 +39,18 @@ describe( 'reducer', () => {
test( 'should return the original state with an error and requesting disabled when fetching failed', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: null,
- hasLoadedFromServer: true,
- isRequesting: true,
- },
- } ),
- state = items( original, {
- type: RECEIPT_FETCH_FAILED,
- receiptId: 11111111,
- error: 'Unable to fetch the receipt.',
- } );
+ 11111111: {
+ data: null,
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: true,
+ },
+ } );
+ const state = items( original, {
+ type: RECEIPT_FETCH_FAILED,
+ receiptId: 11111111,
+ error: 'Unable to fetch the receipt.',
+ } );
expect( state ).to.eql( {
11111111: {
@@ -64,18 +64,18 @@ describe( 'reducer', () => {
test( 'should return an updated state with new properties when fetching completes', () => {
const original = Object.freeze( {
- 11111111: {
- data: { amount: 10 },
- error: null,
- hasLoadedFromServer: true,
- isRequesting: true,
- },
- } ),
- state = items( original, {
- type: RECEIPT_FETCH_COMPLETED,
- receiptId: 11111111,
- receipt: { amount: 20 },
- } );
+ 11111111: {
+ data: { amount: 10 },
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: true,
+ },
+ } );
+ const state = items( original, {
+ type: RECEIPT_FETCH_COMPLETED,
+ receiptId: 11111111,
+ receipt: { amount: 20 },
+ } );
expect( state ).to.eql( {
11111111: {
diff --git a/client/state/selectors/test/get-jetpack-connection-owner.js b/client/state/selectors/test/get-jetpack-connection-owner.js
index 686914d56a545..1f13c152a701f 100644
--- a/client/state/selectors/test/get-jetpack-connection-owner.js
+++ b/client/state/selectors/test/get-jetpack-connection-owner.js
@@ -7,13 +7,13 @@ import { dataItems } from './fixtures/jetpack-connection';
describe( 'isJetpackUserConnectionOwner()', () => {
test( "should return the owner of the Jetpack site's connection", () => {
const state = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = getJetpackConnectionOwner( state, siteId );
expect( output ).toEqual( 'exampleuser' );
} );
diff --git a/client/state/selectors/test/get-jetpack-connection-status.js b/client/state/selectors/test/get-jetpack-connection-status.js
index 6687c3315d3b1..cb4442b9dc5aa 100644
--- a/client/state/selectors/test/get-jetpack-connection-status.js
+++ b/client/state/selectors/test/get-jetpack-connection-status.js
@@ -12,26 +12,26 @@ import { items as ITEMS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'getJetpackConnectionStatus()', () => {
test( 'should return connection status for a known site', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = getJetpackConnectionStatus( stateIn, siteId );
expect( output ).to.eql( ITEMS_FIXTURE[ siteId ] );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = getJetpackConnectionStatus( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/get-jetpack-module.js b/client/state/selectors/test/get-jetpack-module.js
index 18e8b8db7db69..5dddc93b12371 100644
--- a/client/state/selectors/test/get-jetpack-module.js
+++ b/client/state/selectors/test/get-jetpack-module.js
@@ -12,45 +12,45 @@ import { moduleData as MODULE_DATA_FIXTURE } from './fixtures/jetpack-modules';
describe( 'getJetpackModule()', () => {
test( 'should return data for a specified module for a known site', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: {
- 123456: MODULE_DATA_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: {
+ 123456: MODULE_DATA_FIXTURE,
},
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = getJetpackModule( stateIn, siteId, 'module-a' );
expect( output ).to.eql( MODULE_DATA_FIXTURE[ 'module-a' ] );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: {
- 654321: MODULE_DATA_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: {
+ 654321: MODULE_DATA_FIXTURE,
},
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = getJetpackModule( stateIn, siteId, 'module-a' );
expect( output ).to.be.null;
} );
test( 'should return null for an unknown module', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: {
- 123456: MODULE_DATA_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: {
+ 123456: MODULE_DATA_FIXTURE,
},
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = getJetpackModule( stateIn, siteId, 'module-z' );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/get-jetpack-modules.js b/client/state/selectors/test/get-jetpack-modules.js
index 1e8ad35788122..2dd10252ab5e5 100644
--- a/client/state/selectors/test/get-jetpack-modules.js
+++ b/client/state/selectors/test/get-jetpack-modules.js
@@ -12,30 +12,30 @@ import { moduleData as MODULE_DATA_FIXTURE } from './fixtures/jetpack-modules';
describe( 'getJetpackModules()', () => {
test( 'should return data for all modules for a known site', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: {
- 123456: MODULE_DATA_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: {
+ 123456: MODULE_DATA_FIXTURE,
},
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = getJetpackModules( stateIn, siteId );
expect( output ).to.eql( MODULE_DATA_FIXTURE );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: {
- 654321: MODULE_DATA_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: {
+ 654321: MODULE_DATA_FIXTURE,
},
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = getJetpackModules( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/get-jetpack-setting.js b/client/state/selectors/test/get-jetpack-setting.js
index 3c5ff83d34838..6f5b0b1d234db 100644
--- a/client/state/selectors/test/get-jetpack-setting.js
+++ b/client/state/selectors/test/get-jetpack-setting.js
@@ -12,40 +12,40 @@ import { settings as SETTINGS_FIXTURE } from './fixtures/jetpack-settings';
describe( 'getJetpackSetting()', () => {
test( 'should return a certain setting for a known site', () => {
const stateIn = {
- jetpack: {
- settings: SETTINGS_FIXTURE,
- },
+ jetpack: {
+ settings: SETTINGS_FIXTURE,
},
- siteId = 12345678,
- setting = 'setting_1';
+ };
+ const siteId = 12345678;
+ const setting = 'setting_1';
const output = getJetpackSetting( stateIn, siteId, setting );
expect( output ).to.eql( SETTINGS_FIXTURE[ siteId ][ setting ] );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- settings: {
- 654321: SETTINGS_FIXTURE[ 12345678 ],
- },
+ jetpack: {
+ settings: {
+ 654321: SETTINGS_FIXTURE[ 12345678 ],
},
},
- siteId = 12345678,
- setting = 'setting_1';
+ };
+ const siteId = 12345678;
+ const setting = 'setting_1';
const output = getJetpackSetting( stateIn, siteId, setting );
expect( output ).to.be.null;
} );
test( 'should return null for an unknown setting', () => {
const stateIn = {
- jetpack: {
- settings: {
- 654321: SETTINGS_FIXTURE[ 12345678 ],
- },
+ jetpack: {
+ settings: {
+ 654321: SETTINGS_FIXTURE[ 12345678 ],
},
},
- siteId = 12345678,
- setting = 'unexisting_setting';
+ };
+ const siteId = 12345678;
+ const setting = 'unexisting_setting';
const output = getJetpackSetting( stateIn, siteId, setting );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/get-jetpack-settings.js b/client/state/selectors/test/get-jetpack-settings.js
index d16efabb0e610..f0eca3873d9f6 100644
--- a/client/state/selectors/test/get-jetpack-settings.js
+++ b/client/state/selectors/test/get-jetpack-settings.js
@@ -7,24 +7,24 @@ import { settings as SETTINGS_FIXTURE } from './fixtures/jetpack-settings';
describe( 'getJetpackSettings()', () => {
test( 'should return settings for all modules for a known site', () => {
const stateIn = {
- jetpack: {
- settings: SETTINGS_FIXTURE,
- },
+ jetpack: {
+ settings: SETTINGS_FIXTURE,
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = getJetpackSettings( stateIn, siteId );
expect( output ).toEqual( SETTINGS_FIXTURE[ siteId ] );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- settings: {
- 654321: SETTINGS_FIXTURE,
- },
+ jetpack: {
+ settings: {
+ 654321: SETTINGS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = getJetpackSettings( stateIn, siteId );
expect( output ).toBeNull();
} );
diff --git a/client/state/selectors/test/get-jetpack-user-connection.js b/client/state/selectors/test/get-jetpack-user-connection.js
index 976b332a214e1..98bc00014cdfe 100644
--- a/client/state/selectors/test/get-jetpack-user-connection.js
+++ b/client/state/selectors/test/get-jetpack-user-connection.js
@@ -12,26 +12,26 @@ import { dataItems } from './fixtures/jetpack-connection';
describe( 'getJetpackUserConnection()', () => {
test( 'should return user connection data for a known site', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = getJetpackUserConnection( stateIn, siteId );
expect( output ).to.eql( dataItems[ siteId ] );
} );
test( 'should return null for an unknown site', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = getJetpackUserConnection( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-activating-jetpack-module.js b/client/state/selectors/test/is-activating-jetpack-module.js
index 5752a958f6f76..95b99b89feb9c 100644
--- a/client/state/selectors/test/is-activating-jetpack-module.js
+++ b/client/state/selectors/test/is-activating-jetpack-module.js
@@ -12,39 +12,39 @@ import { requests as REQUESTS_FIXTURE } from './fixtures/jetpack-modules';
describe( 'isActivatingJetpackModule()', () => {
test( 'should return true if module is currently being activated', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isActivatingJetpackModule( stateIn, siteId, 'module-b' );
expect( output ).to.be.true;
} );
test( 'should return false if module is currently not being activated', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isActivatingJetpackModule( stateIn, siteId, 'module-a' );
expect( output ).to.be.false;
} );
test( 'should return null if that module is not known', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isActivatingJetpackModule( stateIn, siteId, 'module-z' );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-deactivating-jetpack-module.js b/client/state/selectors/test/is-deactivating-jetpack-module.js
index 892c3814dc619..7fe47ed86a5af 100644
--- a/client/state/selectors/test/is-deactivating-jetpack-module.js
+++ b/client/state/selectors/test/is-deactivating-jetpack-module.js
@@ -12,39 +12,39 @@ import { requests as REQUESTS_FIXTURE } from './fixtures/jetpack-modules';
describe( 'isDeactivatingJetpackModule()', () => {
test( 'should return true if module is currently being deactivated', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isDeactivatingJetpackModule( stateIn, siteId, 'module-a' );
expect( output ).to.be.true;
} );
test( 'should return false if module is currently not being deactivated', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isDeactivatingJetpackModule( stateIn, siteId, 'module-b' );
expect( output ).to.be.false;
} );
test( 'should return null if that module is not known', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isDeactivatingJetpackModule( stateIn, siteId, 'module-z' );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-fetching-jetpack-modules.js b/client/state/selectors/test/is-fetching-jetpack-modules.js
index b40433421248d..bcea300678da6 100644
--- a/client/state/selectors/test/is-fetching-jetpack-modules.js
+++ b/client/state/selectors/test/is-fetching-jetpack-modules.js
@@ -12,39 +12,39 @@ import { requests as REQUESTS_FIXTURE } from './fixtures/jetpack-modules';
describe( 'isFetchingJetpackModules()', () => {
test( 'should return true if the list of modules is being fetched', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isFetchingJetpackModules( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the list of modules is currently not being fetched', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 654321;
+ };
+ const siteId = 654321;
const output = isFetchingJetpackModules( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if that site is not known', () => {
const stateIn = {
- jetpack: {
- modules: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 888888;
+ };
+ const siteId = 888888;
const output = isFetchingJetpackModules( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-jetpack-module-active.js b/client/state/selectors/test/is-jetpack-module-active.js
index 119affdd2a275..bd5c449aae752 100644
--- a/client/state/selectors/test/is-jetpack-module-active.js
+++ b/client/state/selectors/test/is-jetpack-module-active.js
@@ -12,39 +12,39 @@ import { modules as MODULES_FIXTURE } from './fixtures/jetpack-modules';
describe( 'isJetpackModuleActive()', () => {
test( 'should return true if the module is currently active', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: MODULES_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: MODULES_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isJetpackModuleActive( stateIn, siteId, 'module-b' );
expect( output ).to.be.true;
} );
test( 'should return false if the module is currently not active', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: MODULES_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: MODULES_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isJetpackModuleActive( stateIn, siteId, 'module-a' );
expect( output ).to.be.false;
} );
test( 'should return null if that module is not known', () => {
const stateIn = {
- jetpack: {
- modules: {
- items: MODULES_FIXTURE,
- },
+ jetpack: {
+ modules: {
+ items: MODULES_FIXTURE,
},
},
- siteId = 123456;
+ };
+ const siteId = 123456;
const output = isJetpackModuleActive( stateIn, siteId, 'module-z' );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-jetpack-site-connected.js b/client/state/selectors/test/is-jetpack-site-connected.js
index 9d0ce7b70e8a9..a212f0b9db639 100644
--- a/client/state/selectors/test/is-jetpack-site-connected.js
+++ b/client/state/selectors/test/is-jetpack-site-connected.js
@@ -12,39 +12,39 @@ import { items as ITEMS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'isJetpackSiteConnected()', () => {
test( 'should return true if the site is connected', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isJetpackSiteConnected( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the site is not connected', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isJetpackSiteConnected( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the site is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isJetpackSiteConnected( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-jetpack-site-in-development-mode.js b/client/state/selectors/test/is-jetpack-site-in-development-mode.js
index bdb6b79911325..e5539df28066e 100644
--- a/client/state/selectors/test/is-jetpack-site-in-development-mode.js
+++ b/client/state/selectors/test/is-jetpack-site-in-development-mode.js
@@ -12,52 +12,52 @@ import { items as ITEMS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'isJetpackSiteInDevelopmentMode()', () => {
test( 'should return true if the site is in development mode', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isJetpackSiteInDevelopmentMode( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the site is not in development mode', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isJetpackSiteInDevelopmentMode( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return false if the site is not in development mode with isActive: 0', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 987654321;
+ };
+ const siteId = 987654321;
const output = isJetpackSiteInDevelopmentMode( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the site is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isJetpackSiteInDevelopmentMode( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-jetpack-site-in-staging-mode.js b/client/state/selectors/test/is-jetpack-site-in-staging-mode.js
index 2a15f102a0d97..5745cd9a5704b 100644
--- a/client/state/selectors/test/is-jetpack-site-in-staging-mode.js
+++ b/client/state/selectors/test/is-jetpack-site-in-staging-mode.js
@@ -12,39 +12,39 @@ import { items as ITEMS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'isJetpackSiteInStagingMode()', () => {
test( 'should return true if the site is in staging mode', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isJetpackSiteInStagingMode( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the site is not in staging mode', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isJetpackSiteInStagingMode( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the site is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- items: ITEMS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ items: ITEMS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isJetpackSiteInStagingMode( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-jetpack-user-connection-owner.js b/client/state/selectors/test/is-jetpack-user-connection-owner.js
index e08902ab0e308..5462aa0b0ab5b 100644
--- a/client/state/selectors/test/is-jetpack-user-connection-owner.js
+++ b/client/state/selectors/test/is-jetpack-user-connection-owner.js
@@ -12,39 +12,39 @@ import { dataItems } from './fixtures/jetpack-connection';
describe( 'isJetpackUserConnectionOwner()', () => {
test( "should return true if the user is the owner of the site's connection", () => {
const stateIn = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isJetpackUserConnectionOwner( stateIn, siteId );
expect( output ).to.be.true;
} );
test( "should return false if the user is not the owner of the site's connection", () => {
const stateIn = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isJetpackUserConnectionOwner( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the information is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataItems,
- },
+ jetpack: {
+ connection: {
+ dataItems,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isJetpackUserConnectionOwner( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-requesting-jetpack-connection-status.js b/client/state/selectors/test/is-requesting-jetpack-connection-status.js
index f92f4980aeeee..4ed64ce31ecbe 100644
--- a/client/state/selectors/test/is-requesting-jetpack-connection-status.js
+++ b/client/state/selectors/test/is-requesting-jetpack-connection-status.js
@@ -12,39 +12,39 @@ import { requests as REQUESTS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'isRequestingJetpackConnectionStatus()', () => {
test( 'should return true if the connection status is being fetched', () => {
const stateIn = {
- jetpack: {
- connection: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isRequestingJetpackConnectionStatus( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the connection status is not being fetched', () => {
const stateIn = {
- jetpack: {
- connection: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isRequestingJetpackConnectionStatus( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the site is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- requests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ requests: REQUESTS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isRequestingJetpackConnectionStatus( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/selectors/test/is-requesting-jetpack-user-connection.js b/client/state/selectors/test/is-requesting-jetpack-user-connection.js
index 41977aa46953f..08fce3d5bfa2b 100644
--- a/client/state/selectors/test/is-requesting-jetpack-user-connection.js
+++ b/client/state/selectors/test/is-requesting-jetpack-user-connection.js
@@ -12,39 +12,39 @@ import { requests as REQUESTS_FIXTURE } from './fixtures/jetpack-connection';
describe( 'isRequestingJetpackUserConnection()', () => {
test( 'should return true if the user connection data is being fetched', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataRequests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ dataRequests: REQUESTS_FIXTURE,
},
},
- siteId = 87654321;
+ };
+ const siteId = 87654321;
const output = isRequestingJetpackUserConnection( stateIn, siteId );
expect( output ).to.be.true;
} );
test( 'should return false if the user connection data is not being fetched', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataRequests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ dataRequests: REQUESTS_FIXTURE,
},
},
- siteId = 12345678;
+ };
+ const siteId = 12345678;
const output = isRequestingJetpackUserConnection( stateIn, siteId );
expect( output ).to.be.false;
} );
test( 'should return null if the site is not known yet', () => {
const stateIn = {
- jetpack: {
- connection: {
- dataRequests: REQUESTS_FIXTURE,
- },
+ jetpack: {
+ connection: {
+ dataRequests: REQUESTS_FIXTURE,
},
},
- siteId = 88888888;
+ };
+ const siteId = 88888888;
const output = isRequestingJetpackUserConnection( stateIn, siteId );
expect( output ).to.be.null;
} );
diff --git a/client/state/sharing/publicize/test/reducer.js b/client/state/sharing/publicize/test/reducer.js
index 4c0ece9f53a0f..87f2c66641c43 100644
--- a/client/state/sharing/publicize/test/reducer.js
+++ b/client/state/sharing/publicize/test/reducer.js
@@ -212,17 +212,17 @@ describe( 'reducer', () => {
describe( 'PUBLICIZE_CONNECTION_CREATE', () => {
test( 'should add new connection', () => {
- const existingConnection = { ID: 1, site_ID: 2916284 },
- newConnection = { ID: 2, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: existingConnection,
- } ),
- {
- type: PUBLICIZE_CONNECTION_CREATE,
- connection: newConnection,
- }
- );
+ const existingConnection = { ID: 1, site_ID: 2916284 };
+ const newConnection = { ID: 2, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: existingConnection,
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_CREATE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: existingConnection,
@@ -231,16 +231,16 @@ describe( 'reducer', () => {
} );
test( 'should update existing connections', () => {
- const newConnection = { ID: 1, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: { ID: 1, site_ID: 77203074 },
- } ),
- {
- type: PUBLICIZE_CONNECTION_CREATE,
- connection: newConnection,
- }
- );
+ const newConnection = { ID: 1, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: { ID: 1, site_ID: 77203074 },
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_CREATE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: newConnection,
@@ -272,17 +272,17 @@ describe( 'reducer', () => {
describe( 'PUBLICIZE_CONNECTION_RECEIVE', () => {
test( 'should add new connection', () => {
- const existingConnection = { ID: 1, site_ID: 2916284 },
- newConnection = { ID: 2, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: existingConnection,
- } ),
- {
- type: PUBLICIZE_CONNECTION_RECEIVE,
- connection: newConnection,
- }
- );
+ const existingConnection = { ID: 1, site_ID: 2916284 };
+ const newConnection = { ID: 2, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: existingConnection,
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_RECEIVE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: existingConnection,
@@ -291,16 +291,16 @@ describe( 'reducer', () => {
} );
test( 'should update existing connections', () => {
- const newConnection = { ID: 1, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: { ID: 1, site_ID: 77203074 },
- } ),
- {
- type: PUBLICIZE_CONNECTION_RECEIVE,
- connection: newConnection,
- }
- );
+ const newConnection = { ID: 1, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: { ID: 1, site_ID: 77203074 },
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_RECEIVE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: newConnection,
@@ -310,17 +310,17 @@ describe( 'reducer', () => {
describe( 'PUBLICIZE_CONNECTION_UPDATE', () => {
test( 'should add new connection', () => {
- const existingConnection = { ID: 1, site_ID: 2916284 },
- newConnection = { ID: 2, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: existingConnection,
- } ),
- {
- type: PUBLICIZE_CONNECTION_UPDATE,
- connection: newConnection,
- }
- );
+ const existingConnection = { ID: 1, site_ID: 2916284 };
+ const newConnection = { ID: 2, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: existingConnection,
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_UPDATE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: existingConnection,
@@ -329,16 +329,16 @@ describe( 'reducer', () => {
} );
test( 'should update existing connections', () => {
- const newConnection = { ID: 1, site_ID: 2916284 },
- state = connections(
- deepFreeze( {
- 1: { ID: 1, site_ID: 77203074 },
- } ),
- {
- type: PUBLICIZE_CONNECTION_UPDATE,
- connection: newConnection,
- }
- );
+ const newConnection = { ID: 1, site_ID: 2916284 };
+ const state = connections(
+ deepFreeze( {
+ 1: { ID: 1, site_ID: 77203074 },
+ } ),
+ {
+ type: PUBLICIZE_CONNECTION_UPDATE,
+ connection: newConnection,
+ }
+ );
expect( state ).to.eql( {
1: newConnection,
diff --git a/client/state/sharing/services/test/reducer.js b/client/state/sharing/services/test/reducer.js
index c07bf7775d88f..b76196056e94a 100644
--- a/client/state/sharing/services/test/reducer.js
+++ b/client/state/sharing/services/test/reducer.js
@@ -82,15 +82,15 @@ describe( 'reducer', () => {
describe( 'persistence', () => {
test( 'persists state', () => {
- const original = deepFreeze( originalKeyringServices ),
- services = items( original, { type: SERIALIZE } );
+ const original = deepFreeze( originalKeyringServices );
+ const services = items( original, { type: SERIALIZE } );
expect( services ).to.eql( original );
} );
test( 'loads valid persisted state', () => {
- const original = deepFreeze( originalKeyringServices ),
- services = items( original, { type: DESERIALIZE } );
+ const original = deepFreeze( originalKeyringServices );
+ const services = items( original, { type: DESERIALIZE } );
expect( services ).to.eql( original );
} );
diff --git a/client/state/signup/verticals/test/actions.js b/client/state/signup/verticals/test/actions.js
index 56347b619a361..1747a037f449a 100644
--- a/client/state/signup/verticals/test/actions.js
+++ b/client/state/signup/verticals/test/actions.js
@@ -6,9 +6,9 @@ import { requestVerticals, setVerticals } from '../actions';
describe( 'state/signup/verticals/actions', () => {
test( 'requestVerticals', () => {
- const search = 'Foo',
- siteType = 'Business',
- limit = 7;
+ const search = 'Foo';
+ const siteType = 'Business';
+ const limit = 7;
expect( requestVerticals( search, siteType, limit ) ).toEqual( {
type: SIGNUP_VERTICALS_REQUEST,
diff --git a/client/state/sites/domains/test/actions.js b/client/state/sites/domains/test/actions.js
index becb5344e85b7..bd739dec67511 100644
--- a/client/state/sites/domains/test/actions.js
+++ b/client/state/sites/domains/test/actions.js
@@ -30,7 +30,8 @@ import { useSandbox } from 'calypso/test-helpers/use-sinon';
jest.mock( 'lib/user', () => () => {} );
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/sites/plans/test/actions.js b/client/state/sites/plans/test/actions.js
index cb2ff37015c4a..a4fc7105af565 100644
--- a/client/state/sites/plans/test/actions.js
+++ b/client/state/sites/plans/test/actions.js
@@ -10,8 +10,8 @@ import {
describe( 'actions', () => {
describe( '#fetchSitePlansCompleted()', () => {
test( 'should return an action object with an array of plans', () => {
- const siteId = 2916284,
- action = fetchSitePlansCompleted( siteId, {} );
+ const siteId = 2916284;
+ const action = fetchSitePlansCompleted( siteId, {} );
expect( action ).toEqual( {
type: SITE_PLANS_FETCH_COMPLETED,
diff --git a/client/state/sites/plans/test/reducer.js b/client/state/sites/plans/test/reducer.js
index 27d76ebe2dc2c..2b6130f66724b 100644
--- a/client/state/sites/plans/test/reducer.js
+++ b/client/state/sites/plans/test/reducer.js
@@ -26,8 +26,8 @@ describe( 'reducer', () => {
} );
test( 'should return an empty state when original state and action are empty', () => {
- const original = Object.freeze( {} ),
- state = plans( original, {} );
+ const original = Object.freeze( {} );
+ const state = plans( original, {} );
expect( state ).to.eql( original );
} );
@@ -43,17 +43,17 @@ describe( 'reducer', () => {
test( 'should return the original state when action is unknown', () => {
const original = Object.freeze( {
- 11111111: {
- data: [],
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: 'MAKE_COFFEE',
- siteId: 11111111,
- } );
+ 11111111: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: 'MAKE_COFFEE',
+ siteId: 11111111,
+ } );
expect( state ).to.eql( original );
} );
@@ -76,18 +76,18 @@ describe( 'reducer', () => {
test( 'should return the original state with an error and requesting disabled when fetching failed', () => {
const original = Object.freeze( {
- 11111111: {
- data: [],
- error: null,
- hasLoadedFromServer: true,
- isRequesting: true,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_FETCH_FAILED,
- siteId: 11111111,
- error: 'Unable to fetch site plans',
- } );
+ 11111111: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: true,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_FETCH_FAILED,
+ siteId: 11111111,
+ error: 'Unable to fetch site plans',
+ } );
expect( state ).to.eql( {
11111111: {
@@ -118,17 +118,17 @@ describe( 'reducer', () => {
test( 'should accumulate plans for different sites', () => {
const original = Object.freeze( {
- 11111111: {
- data: [],
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_FETCH,
- siteId: 55555555,
- } );
+ 11111111: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_FETCH,
+ siteId: 55555555,
+ } );
expect( state ).to.eql( {
11111111: {
@@ -148,17 +148,17 @@ describe( 'reducer', () => {
test( 'should override previous plans of the same site', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site plans',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_FETCH,
- siteId: 11111111,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site plans',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_FETCH,
+ siteId: 11111111,
+ } );
expect( state ).to.eql( {
11111111: {
@@ -172,17 +172,17 @@ describe( 'reducer', () => {
test( 'should return the original state with updating enabled when trial cancelation is triggered', () => {
const original = Object.freeze( {
- 11111111: {
- data: [],
- error: null,
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_TRIAL_CANCEL,
- siteId: 11111111,
- } );
+ 11111111: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_TRIAL_CANCEL,
+ siteId: 11111111,
+ } );
expect( state ).to.eql( {
11111111: {
@@ -196,18 +196,18 @@ describe( 'reducer', () => {
test( 'should return the original state with an error and requesting disabled when trial cancelation failed', () => {
const original = Object.freeze( {
- 11111111: {
- data: [],
- error: null,
- hasLoadedFromServer: true,
- isRequesting: true,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_TRIAL_CANCEL_FAILED,
- siteId: 11111111,
- error: 'Unable to cancel plan trial',
- } );
+ 11111111: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: true,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_TRIAL_CANCEL_FAILED,
+ siteId: 11111111,
+ error: 'Unable to cancel plan trial',
+ } );
expect( state ).to.eql( {
11111111: {
@@ -247,40 +247,40 @@ describe( 'reducer', () => {
test( 'should return the original state when removal is triggered for an unknown site', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site plans',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_REMOVE,
- siteId: 22222222,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site plans',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_REMOVE,
+ siteId: 22222222,
+ } );
expect( state ).to.eql( original );
} );
test( 'should remove plans for a given site when removal is triggered', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site plans',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- 22222222: {
- data: [],
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = plans( original, {
- type: SITE_PLANS_REMOVE,
- siteId: 11111111,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site plans',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ 22222222: {
+ data: [],
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = plans( original, {
+ type: SITE_PLANS_REMOVE,
+ siteId: 11111111,
+ } );
expect( state ).to.eql( {
22222222: {
diff --git a/client/state/sites/products/test/actions.js b/client/state/sites/products/test/actions.js
index f039e5371c5b6..86dc3610ba78b 100644
--- a/client/state/sites/products/test/actions.js
+++ b/client/state/sites/products/test/actions.js
@@ -7,8 +7,8 @@ import { SITE_PRODUCTS_FETCH_COMPLETED } from 'calypso/state/action-types';
describe( 'actions', () => {
describe( '#fetchSiteProductsCompleted()', () => {
test( 'should return an action object with an array of products', () => {
- const siteId = 2916284,
- action = fetchSiteProductsCompleted( siteId, {} );
+ const siteId = 2916284;
+ const action = fetchSiteProductsCompleted( siteId, {} );
expect( action ).toEqual( {
type: SITE_PRODUCTS_FETCH_COMPLETED,
diff --git a/client/state/sites/products/test/reducer.js b/client/state/sites/products/test/reducer.js
index 694b065fe0969..29e4eee5c49fe 100644
--- a/client/state/sites/products/test/reducer.js
+++ b/client/state/sites/products/test/reducer.js
@@ -23,8 +23,8 @@ describe( 'reducer', () => {
} );
test( 'should return an empty state when original state and action are empty', () => {
- const original = Object.freeze( {} ),
- state = products( original, {} );
+ const original = Object.freeze( {} );
+ const state = products( original, {} );
expect( state ).to.eql( original );
} );
@@ -40,17 +40,17 @@ describe( 'reducer', () => {
test( 'should return the original state when action is unknown', () => {
const original = Object.freeze( {
- 11111111: {
- data: {},
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = products( original, {
- type: 'MAKE_COFFEE',
- siteId: 11111111,
- } );
+ 11111111: {
+ data: {},
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = products( original, {
+ type: 'MAKE_COFFEE',
+ siteId: 11111111,
+ } );
expect( state ).to.eql( original );
} );
@@ -73,18 +73,18 @@ describe( 'reducer', () => {
test( 'should return the original state with an error and requesting disabled when fetching failed', () => {
const original = Object.freeze( {
- 11111111: {
- data: {},
- error: null,
- hasLoadedFromServer: true,
- isRequesting: true,
- },
- } ),
- state = products( original, {
- type: SITE_PRODUCTS_FETCH_FAILED,
- siteId: 11111111,
- error: 'Unable to fetch site products',
- } );
+ 11111111: {
+ data: {},
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: true,
+ },
+ } );
+ const state = products( original, {
+ type: SITE_PRODUCTS_FETCH_FAILED,
+ siteId: 11111111,
+ error: 'Unable to fetch site products',
+ } );
expect( state ).to.eql( {
11111111: {
@@ -115,17 +115,17 @@ describe( 'reducer', () => {
test( 'should accumulate products for different sites', () => {
const original = Object.freeze( {
- 11111111: {
- data: {},
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = products( original, {
- type: SITE_PRODUCTS_FETCH,
- siteId: 55555555,
- } );
+ 11111111: {
+ data: {},
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = products( original, {
+ type: SITE_PRODUCTS_FETCH,
+ siteId: 55555555,
+ } );
expect( state ).to.eql( {
11111111: {
@@ -145,17 +145,17 @@ describe( 'reducer', () => {
test( 'should override previous products of the same site', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site products',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- } ),
- state = products( original, {
- type: SITE_PRODUCTS_FETCH,
- siteId: 11111111,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site products',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ } );
+ const state = products( original, {
+ type: SITE_PRODUCTS_FETCH,
+ siteId: 11111111,
+ } );
expect( state ).to.eql( {
11111111: {
@@ -178,40 +178,40 @@ describe( 'reducer', () => {
test( 'should return the original state when removal is triggered for an unknown site', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site products',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- } ),
- state = products( original, {
- type: SITE_PRODUCTS_REMOVE,
- siteId: 22222222,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site products',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ } );
+ const state = products( original, {
+ type: SITE_PRODUCTS_REMOVE,
+ siteId: 22222222,
+ } );
expect( state ).to.eql( original );
} );
test( 'should remove products for a given site when removal is triggered', () => {
const original = Object.freeze( {
- 11111111: {
- data: null,
- error: 'Unable to fetch site products',
- hasLoadedFromServer: false,
- isRequesting: false,
- },
- 22222222: {
- data: {},
- error: null,
- hasLoadedFromServer: true,
- isRequesting: false,
- },
- } ),
- state = products( original, {
- type: SITE_PRODUCTS_REMOVE,
- siteId: 11111111,
- } );
+ 11111111: {
+ data: null,
+ error: 'Unable to fetch site products',
+ hasLoadedFromServer: false,
+ isRequesting: false,
+ },
+ 22222222: {
+ data: {},
+ error: null,
+ hasLoadedFromServer: true,
+ isRequesting: false,
+ },
+ } );
+ const state = products( original, {
+ type: SITE_PRODUCTS_REMOVE,
+ siteId: 11111111,
+ } );
expect( state ).to.eql( {
22222222: {
diff --git a/client/state/sites/selectors/has-jetpack-site-custom-domain.js b/client/state/sites/selectors/has-jetpack-site-custom-domain.js
index 9fa6f07303372..cec2ee9346ef1 100644
--- a/client/state/sites/selectors/has-jetpack-site-custom-domain.js
+++ b/client/state/sites/selectors/has-jetpack-site-custom-domain.js
@@ -20,8 +20,8 @@ export default function hasJetpackSiteCustomDomain( state, siteId ) {
return null;
}
- const domain = getSiteDomain( state, siteId ),
- unmappedUrl = getSiteOption( state, siteId, 'unmapped_url' );
+ const domain = getSiteDomain( state, siteId );
+ const unmappedUrl = getSiteOption( state, siteId, 'unmapped_url' );
if ( ! domain || ! unmappedUrl ) {
return null;
diff --git a/client/state/sites/selectors/is-jetpack-site-secondary-network-site.js b/client/state/sites/selectors/is-jetpack-site-secondary-network-site.js
index c2676c65f4bbc..495da7eb635f1 100644
--- a/client/state/sites/selectors/is-jetpack-site-secondary-network-site.js
+++ b/client/state/sites/selectors/is-jetpack-site-secondary-network-site.js
@@ -25,8 +25,8 @@ export default function isJetpackSiteSecondaryNetworkSite( state, siteId ) {
return false;
}
- const unmappedUrl = getSiteOption( state, siteId, 'unmapped_url' ),
- mainNetworkSite = getSiteOption( state, siteId, 'main_network_site' );
+ const unmappedUrl = getSiteOption( state, siteId, 'unmapped_url' );
+ const mainNetworkSite = getSiteOption( state, siteId, 'main_network_site' );
if ( ! unmappedUrl || ! mainNetworkSite ) {
return false;
diff --git a/client/state/sites/test/actions.js b/client/state/sites/test/actions.js
index 8dc8ab24a5faa..60e44bdf0ba5d 100644
--- a/client/state/sites/test/actions.js
+++ b/client/state/sites/test/actions.js
@@ -34,7 +34,8 @@ import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
const mySitesPath =
'/rest/v1.1/me/sites?site_visibility=all&include_domain_only=true&site_activity=active';
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/sites/vouchers/test/actions.js b/client/state/sites/vouchers/test/actions.js
index 8aea4869f760f..0f12cefc1b780 100644
--- a/client/state/sites/vouchers/test/actions.js
+++ b/client/state/sites/vouchers/test/actions.js
@@ -40,7 +40,8 @@ import useNock from 'calypso/test-helpers/use-nock';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/client/state/stored-cards/test/actions.js b/client/state/stored-cards/test/actions.js
index cb3f249483464..f91d0536e6bce 100644
--- a/client/state/stored-cards/test/actions.js
+++ b/client/state/stored-cards/test/actions.js
@@ -35,9 +35,9 @@ describe( 'actions', () => {
describe( '#addStoredCard', () => {
const cardData = {
- token: 'pg_1234',
- },
- item = { stored_details_id: 123 };
+ token: 'pg_1234',
+ };
+ const item = { stored_details_id: 123 };
let sandbox;
useSandbox( ( newSandbox ) => ( sandbox = newSandbox ) );
diff --git a/client/state/test/initial-state.js b/client/state/test/initial-state.js
index eeed8fbb84ae9..3f52293c5cd6f 100644
--- a/client/state/test/initial-state.js
+++ b/client/state/test/initial-state.js
@@ -64,7 +64,9 @@ describe( 'initial-state', () => {
describe( 'getInitialState', () => {
describe( 'persist-redux disabled', () => {
describe( 'with recently persisted data and initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789': {
@@ -120,7 +122,9 @@ describe( 'initial-state', () => {
describe( 'persist-redux enabled', () => {
describe( 'switched user', () => {
describe( 'with recently persisted data and initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789': {
@@ -176,7 +180,9 @@ describe( 'initial-state', () => {
} );
describe( 'with recently persisted data and initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789': {
@@ -239,7 +245,9 @@ describe( 'initial-state', () => {
} );
describe( 'with stale persisted data and initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789': {
@@ -302,7 +310,9 @@ describe( 'initial-state', () => {
} );
describe( 'with recently persisted data and no initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789': {
@@ -356,7 +366,9 @@ describe( 'initial-state', () => {
} );
describe( 'with invalid persisted data and no initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const userId = userFactory().get().ID + 1;
const savedState = {
@@ -414,7 +426,9 @@ describe( 'initial-state', () => {
describe( 'getStateFromCache', () => {
describe( 'with persisted data and no initial server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = {
'redux-state-123456789:reader': {
@@ -455,7 +469,9 @@ describe( 'initial-state', () => {
} );
describe( 'with initial server data and no persisted data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const savedState = null;
@@ -495,7 +511,9 @@ describe( 'initial-state', () => {
} );
describe( 'with fresher server data than persisted data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const oldDate = new Date();
oldDate.setDate( oldDate.getDate() - 1 );
@@ -543,7 +561,9 @@ describe( 'initial-state', () => {
} );
describe( 'with fresher persisted data than server data', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const newerDate = new Date();
newerDate.setDate( newerDate.getDate() + 1 );
@@ -591,7 +611,9 @@ describe( 'initial-state', () => {
} );
describe( 'with empty persisted signup state for logged in user, and persisted state for logged out user', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const _timestamp = Date.now();
const storedState = {
@@ -647,7 +669,9 @@ describe( 'initial-state', () => {
} );
describe( 'with existing persisted signup state for logged in user, and persisted state for logged out user', () => {
- let state, consoleErrorSpy, getStoredItemSpy;
+ let state;
+ let consoleErrorSpy;
+ let getStoredItemSpy;
const _timestamp = Date.now();
const storedState = {
@@ -717,7 +741,9 @@ describe( 'initial-state', () => {
} );
describe( '#persistOnChange()', () => {
- let store, clock, setStoredItemSpy;
+ let store;
+ let clock;
+ let setStoredItemSpy;
const dataReducer = ( state = null, { data } ) => {
if ( data && data !== state ) {
diff --git a/client/state/themes/utils.js b/client/state/themes/utils.js
index 1b8c5b676787d..620bbf5ba98bb 100644
--- a/client/state/themes/utils.js
+++ b/client/state/themes/utils.js
@@ -162,7 +162,8 @@ export function getSerializedThemesQuery( query = {}, siteId ) {
* @returns {object} Deserialized themes query details
*/
export function getDeserializedThemesQueryDetails( serializedQuery ) {
- let siteId, query;
+ let siteId;
+ let query;
const matches = serializedQuery.match( REGEXP_SERIALIZED_QUERY );
if ( matches ) {
diff --git a/client/state/wordads/approve/test/actions.js b/client/state/wordads/approve/test/actions.js
index 1e32f2433aed4..a34cc5d693918 100644
--- a/client/state/wordads/approve/test/actions.js
+++ b/client/state/wordads/approve/test/actions.js
@@ -18,7 +18,8 @@ import useNock from 'calypso/test-helpers/use-nock';
import { useSandbox } from 'calypso/test-helpers/use-sinon';
describe( 'actions', () => {
- let sandbox, spy;
+ let sandbox;
+ let spy;
useSandbox( ( newSandbox ) => {
sandbox = newSandbox;
diff --git a/packages/babel-plugin-i18n-calypso/src/index.js b/packages/babel-plugin-i18n-calypso/src/index.js
index 9c5d4148516e7..0b713ac67d14c 100644
--- a/packages/babel-plugin-i18n-calypso/src/index.js
+++ b/packages/babel-plugin-i18n-calypso/src/index.js
@@ -219,10 +219,10 @@ function mergeStrings( source, target ) {
}
module.exports = function () {
- let strings = {},
- nplurals = 2,
- baseData,
- functions = { ...DEFAULT_FUNCTIONS_ARGUMENTS_ORDER };
+ let strings = {};
+ let nplurals = 2;
+ let baseData;
+ let functions = { ...DEFAULT_FUNCTIONS_ARGUMENTS_ORDER };
return {
visitor: {
diff --git a/packages/calypso-analytics/src/tracks.ts b/packages/calypso-analytics/src/tracks.ts
index c852ab6a07fce..2b76a6dbe5069 100644
--- a/packages/calypso-analytics/src/tracks.ts
+++ b/packages/calypso-analytics/src/tracks.ts
@@ -77,7 +77,8 @@ function checkForBlockedTracks(): Promise< void > {
// Calling this function from `initialize` ensures current user is set.
// This detects stats blocking, and identifies by `getCurrentUser()`, URL, or cookie.
return _loadTracksResult.catch( () => {
- let _ut, _ui;
+ let _ut;
+ let _ui;
const currentUser = getCurrentUser();
if ( currentUser && currentUser.ID ) {
_ut = 'wpcom:user_id';
diff --git a/packages/eslint-config-wpcalypso/package.json b/packages/eslint-config-wpcalypso/package.json
index c159c78a0c9e0..b8209950b7ec6 100644
--- a/packages/eslint-config-wpcalypso/package.json
+++ b/packages/eslint-config-wpcalypso/package.json
@@ -32,4 +32,4 @@
"dependencies": {
"eslint-plugin-react-hooks": "^4.0.5"
}
-}
\ No newline at end of file
+}
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-ellipsis.js b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-ellipsis.js
index 7171d26c91090..b65b9c412499d 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-ellipsis.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-ellipsis.js
@@ -9,8 +9,8 @@
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
//------------------------------------------------------------------------------
// Rule Definition
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-mismatched-placeholders.js b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-mismatched-placeholders.js
index 0bbd4d9f3e6bb..1bd3cdbf72554 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-mismatched-placeholders.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-mismatched-placeholders.js
@@ -16,8 +16,8 @@ const RX_PLACEHOLDERS = /(?:\x25\x25)|(\x25(?:(?:[1-9]\d*)\$|\((?:[^\)]+)\))?(?:
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
//------------------------------------------------------------------------------
// Rule Definition
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-named-placeholders.js b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-named-placeholders.js
index 5cd0299c2c613..ed7c7fcf88825 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-named-placeholders.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-named-placeholders.js
@@ -16,8 +16,8 @@ const RX_PLACEHOLDERS = /(?:\x25\x25)|(\x25(?:(?:[1-9]\d*)\$|\((?:[^\)]+)\))?(?:
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
function hasUnqualifiedPlaceholders( string ) {
const placeholders = string.match( RX_PLACEHOLDERS ) || [];
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-collapsible-whitespace.js b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-collapsible-whitespace.js
index 59c7b3fc64034..1cbd582cd8d33 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-collapsible-whitespace.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-collapsible-whitespace.js
@@ -9,8 +9,8 @@
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
//------------------------------------------------------------------------------
// Rule Definition
@@ -25,7 +25,9 @@ const rule = ( module.exports = function ( context ) {
node.arguments.forEach( function ( arg ) {
const string = getTextContentFromNode( arg );
- let problem, problemString, problemsByCharCode;
+ let problem;
+ let problemString;
+ let problemsByCharCode;
if ( ! string ) {
return;
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-placeholders-only.js b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-placeholders-only.js
index 6abc46fbef48e..458bd191141e8 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-placeholders-only.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/i18n-no-placeholders-only.js
@@ -17,8 +17,8 @@ const RX_INTERPOLATED_COMPONENTS = /(\{\{\/?\s*\w+\s*\/?\}\})/g;
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
//------------------------------------------------------------------------------
// Rule Definition
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/post-message-no-wildcard-targets.js b/packages/eslint-plugin-wpcalypso/lib/rules/post-message-no-wildcard-targets.js
index eca0e783ce260..4f32e7c279dc1 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/post-message-no-wildcard-targets.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/post-message-no-wildcard-targets.js
@@ -9,8 +9,8 @@
// Helper Functions
//------------------------------------------------------------------------------
-const getCallee = require( '../util/get-callee' ),
- getTextContentFromNode = require( '../util/get-text-content-from-node' );
+const getCallee = require( '../util/get-callee' );
+const getTextContentFromNode = require( '../util/get-text-content-from-node' );
//------------------------------------------------------------------------------
// Rule Definition
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-ellipsis.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-ellipsis.js
index a9c5be3177732..eb02afc4b40af 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-ellipsis.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-ellipsis.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-ellipsis' ),
- config = { env: { es6: true } }, // support for string templates
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-ellipsis' );
+const config = { env: { es6: true } }; // support for string templates
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-mismatched-placeholders.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-mismatched-placeholders.js
index 0c4ac1337aead..715b60a473cd2 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-mismatched-placeholders.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-mismatched-placeholders.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-mismatched-placeholders' ),
- config = { env: { es6: true } }, // support for string templates
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-mismatched-placeholders' );
+const config = { env: { es6: true } }; // support for string templates
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-named-placeholders.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-named-placeholders.js
index 85a3f43369bc9..42cdbeddbfe69 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-named-placeholders.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-named-placeholders.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-named-placeholders' ),
- config = { env: { es6: true } }, // support for string templates
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-named-placeholders' );
+const config = { env: { es6: true } }; // support for string templates
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-collapsible-whitespace.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-collapsible-whitespace.js
index fe770ebc8cf19..e67aaf83e17b3 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-collapsible-whitespace.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-collapsible-whitespace.js
@@ -9,10 +9,10 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../i18n-no-collapsible-whitespace' ),
- config = { env: { es6: true } }, // support for string templates
- formatMessage = require( '../../../test-utils/format-message' ),
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../i18n-no-collapsible-whitespace' );
+const config = { env: { es6: true } }; // support for string templates
+const formatMessage = require( '../../../test-utils/format-message' );
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Constants
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-placeholders-only.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-placeholders-only.js
index 03df9f702a38c..602162ef0e0af 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-placeholders-only.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-placeholders-only.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-no-placeholders-only' ),
- config = { env: { es6: true } }, // support for string templates
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-no-placeholders-only' );
+const config = { env: { es6: true } }; // support for string templates
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-this-translate.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-this-translate.js
index ff19b559bec38..bfc0513327ee3 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-this-translate.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-this-translate.js
@@ -9,8 +9,8 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-no-this-translate' ),
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-no-this-translate' );
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-variables.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-variables.js
index e1de015c4b6c8..694ff639d7bc4 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-variables.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/i18n-no-variables.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/i18n-no-variables' ),
- config = { env: { es6: true } }, // support for string templates
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/i18n-no-variables' );
+const config = { env: { es6: true } }; // support for string templates
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/import-docblock.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/import-docblock.js
index 1cdde8ad52cbe..cba61f45d6850 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/import-docblock.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/import-docblock.js
@@ -9,8 +9,8 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/import-docblock' ),
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/import-docblock' );
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/jsx-gridicon-size.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/jsx-gridicon-size.js
index 334ea420252c5..d49d5005d1074 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/jsx-gridicon-size.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/jsx-gridicon-size.js
@@ -9,8 +9,8 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/jsx-gridicon-size' ),
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/jsx-gridicon-size' );
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/post-message-no-wildcard-targets.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/post-message-no-wildcard-targets.js
index c092dc7a2798b..da8da92a67071 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/post-message-no-wildcard-targets.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/post-message-no-wildcard-targets.js
@@ -9,9 +9,9 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/post-message-no-wildcard-targets' ),
- config = { env: { es6: true } },
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/post-message-no-wildcard-targets' );
+const config = { env: { es6: true } };
+const RuleTester = require( 'eslint' ).RuleTester;
//------------------------------------------------------------------------------
// Tests
diff --git a/packages/eslint-plugin-wpcalypso/lib/rules/test/redux-no-bound-selectors.js b/packages/eslint-plugin-wpcalypso/lib/rules/test/redux-no-bound-selectors.js
index 7771b0dd928cf..805d4971cbdfd 100644
--- a/packages/eslint-plugin-wpcalypso/lib/rules/test/redux-no-bound-selectors.js
+++ b/packages/eslint-plugin-wpcalypso/lib/rules/test/redux-no-bound-selectors.js
@@ -9,8 +9,8 @@
// Requirements
//------------------------------------------------------------------------------
-const rule = require( '../../../lib/rules/redux-no-bound-selectors' ),
- RuleTester = require( 'eslint' ).RuleTester;
+const rule = require( '../../../lib/rules/redux-no-bound-selectors' );
+const RuleTester = require( 'eslint' ).RuleTester;
const REF = ' See wp-calypso#14024';
const BIND_ERROR_MESSAGE = "Don't bind functions within `connect`." + REF;
diff --git a/packages/eslint-plugin-wpcalypso/lib/util/get-text-content-from-node.js b/packages/eslint-plugin-wpcalypso/lib/util/get-text-content-from-node.js
index 2a092a78aa8f3..ce50d8c608742 100644
--- a/packages/eslint-plugin-wpcalypso/lib/util/get-text-content-from-node.js
+++ b/packages/eslint-plugin-wpcalypso/lib/util/get-text-content-from-node.js
@@ -23,7 +23,8 @@ function getTextContentFromNode( node ) {
// Literal strings => node.value
// We don't need to handle TeplateLiterals with multiple quasis, because
// we don't support expressions in literals.
- let left, right;
+ let left;
+ let right;
if ( node.type === 'BinaryExpression' && node.operator === '+' ) {
left = getTextContentFromNode( node.left );
diff --git a/packages/i18n-calypso-cli/formatters/multiline.js b/packages/i18n-calypso-cli/formatters/multiline.js
index 67fdf43999c1a..407cc385cf495 100644
--- a/packages/i18n-calypso-cli/formatters/multiline.js
+++ b/packages/i18n-calypso-cli/formatters/multiline.js
@@ -17,7 +17,9 @@ const SEPARATORS = [ ' ', '/', ',', ';' ];
module.exports = function multiline( literal, startAt ) {
const maxPosition = MAX_COLUMNS - 1; // MAX_COLUMNS minus the last character needed for closing string (a ");
- let nextSpaceIndex, i, char;
+ let nextSpaceIndex;
+ let i;
+ let char;
if ( typeof startAt === 'string' ) {
startAt = -startAt.length;
diff --git a/packages/i18n-calypso/test/index.js b/packages/i18n-calypso/test/index.js
index b9369f5a79af5..46c951f79609b 100644
--- a/packages/i18n-calypso/test/index.js
+++ b/packages/i18n-calypso/test/index.js
@@ -171,18 +171,18 @@ describe( 'I18n', function () {
describe( 'with mixed components', function () {
it( 'should handle sprintf and component interpolation together', function () {
- const input = React.createElement( 'input' ),
- expectedResultString = 'foo bar',
- placeholder = 'bar',
- translatedComponent = translate( 'foo {{ input /}} %(placeholder)s', {
- components: {
- input: input,
- },
- args: {
- placeholder: placeholder,
- },
- } ),
- instance = React.createElement( 'span', null, translatedComponent );
+ const input = React.createElement( 'input' );
+ const expectedResultString = 'foo bar';
+ const placeholder = 'bar';
+ const translatedComponent = translate( 'foo {{ input /}} %(placeholder)s', {
+ components: {
+ input: input,
+ },
+ args: {
+ placeholder: placeholder,
+ },
+ } );
+ const instance = React.createElement( 'span', null, translatedComponent );
expect( stripReactAttributes( ReactDomServer.renderToStaticMarkup( instance ) ) ).toBe(
expectedResultString
diff --git a/packages/popup-monitor/src/index.js b/packages/popup-monitor/src/index.js
index dd3320a1fe845..7c209f4381cde 100644
--- a/packages/popup-monitor/src/index.js
+++ b/packages/popup-monitor/src/index.js
@@ -55,8 +55,8 @@ PopupMonitor.prototype.open = function ( url, name, specs ) {
* @public
*/
PopupMonitor.prototype.getScreenCenterSpecs = function ( width, height ) {
- const screenTop = typeof window.screenTop !== 'undefined' ? window.screenTop : window.screenY,
- screenLeft = typeof window.screenLeft !== 'undefined' ? window.screenLeft : window.screenX;
+ const screenTop = typeof window.screenTop !== 'undefined' ? window.screenTop : window.screenY;
+ const screenLeft = typeof window.screenLeft !== 'undefined' ? window.screenLeft : window.screenX;
return [
'width=' + width,
diff --git a/packages/webpack-extensive-lodash-replacement-plugin/index.js b/packages/webpack-extensive-lodash-replacement-plugin/index.js
index 562b7d3bcc870..c8d6b99c048fc 100644
--- a/packages/webpack-extensive-lodash-replacement-plugin/index.js
+++ b/packages/webpack-extensive-lodash-replacement-plugin/index.js
@@ -38,7 +38,8 @@ class ExtensiveLodashReplacementPlugin {
}
async initBaseLodashData() {
- let baseLodash, baseLodashVersion;
+ let baseLodash;
+ let baseLodashVersion;
try {
baseLodash = await getModuleForPath( this.moduleResolver, this.baseDir, 'lodash' );
diff --git a/packages/wpcom.js/src/lib/site.media.js b/packages/wpcom.js/src/lib/site.media.js
index 2fce0b5038209..3f57fdbd5d88f 100644
--- a/packages/wpcom.js/src/lib/site.media.js
+++ b/packages/wpcom.js/src/lib/site.media.js
@@ -21,7 +21,10 @@ function buildFormData( files ) {
const isArray = Array.isArray( files );
files = isArray ? files : [ files ];
- let i, f, k, param;
+ let i;
+ let f;
+ let k;
+ let param;
for ( i = 0; i < files.length; i++ ) {
f = files[ i ];
@@ -188,7 +191,10 @@ Media.prototype.addUrls = function ( query, media, fn ) {
const body = { media_urls: [] };
// process formData
- let i, m, url, k;
+ let i;
+ let m;
+ let url;
+ let k;
media = Array.isArray( media ) ? media : [ media ];
for ( i = 0; i < media.length; i++ ) {
diff --git a/packages/wpcom.js/src/lib/util/pinghub.js b/packages/wpcom.js/src/lib/util/pinghub.js
index 63df8b1594900..090f4fd55801d 100644
--- a/packages/wpcom.js/src/lib/util/pinghub.js
+++ b/packages/wpcom.js/src/lib/util/pinghub.js
@@ -30,13 +30,13 @@ export default function Pinghub( wpcom ) {
*/
Pinghub.prototype.connect = function ( path, fn ) {
debug( 'connect', path, fn );
- let pinghub = this,
- params = {
- action: 'connect',
- path: '/pinghub' + path,
- },
- errorCallback = function () {}, // we want an xhr, not a promise
- xhr = ( this.conns[ path ] = this.wpcom.req.get( params, errorCallback ) );
+ let pinghub = this;
+ let params = {
+ action: 'connect',
+ path: '/pinghub' + path,
+ };
+ let errorCallback = function () {}; // we want an xhr, not a promise
+ let xhr = ( this.conns[ path ] = this.wpcom.req.get( params, errorCallback ) );
xhr.onload = function ( e ) {
debug( 'onload', path, e );
fn( null, e );
@@ -57,10 +57,10 @@ Pinghub.prototype.connect = function ( path, fn ) {
Pinghub.prototype.disconnect = function ( path ) {
debug( 'disconnect', path );
let params = {
- action: 'disconnect',
- path: '/pinghub' + path,
- },
- errorCallback = function () {}; // no promises
+ action: 'disconnect',
+ path: '/pinghub' + path,
+ };
+ let errorCallback = function () {}; // no promises
this.wpcom.req.get( params, errorCallback );
};
diff --git a/test/e2e/lib/data-helper.js b/test/e2e/lib/data-helper.js
index f2b4783307c58..2339c251d679f 100644
--- a/test/e2e/lib/data-helper.js
+++ b/test/e2e/lib/data-helper.js
@@ -154,8 +154,8 @@ export function getAllAccountsWithFeatures( features = [] ) {
allAccounts = config.get( 'accounts' );
}
- const mustHaveFeatures = [],
- mustNotHaveFeatures = [];
+ const mustHaveFeatures = [];
+ const mustNotHaveFeatures = [];
features.forEach( function ( feature ) {
if ( feature.indexOf( '-' ) === 0 ) {
mustNotHaveFeatures.push( feature.substring( 1 ) );
diff --git a/test/e2e/lib/flows/login-flow.js b/test/e2e/lib/flows/login-flow.js
index 4d2bd6d0312d3..8f5ba0fe4ed54 100644
--- a/test/e2e/lib/flows/login-flow.js
+++ b/test/e2e/lib/flows/login-flow.js
@@ -77,8 +77,8 @@ export default class LoginFlow {
console.log( 'Logging in as ' + this.account.username );
- let loginURL = this.account.loginURL,
- loginPage;
+ let loginURL = this.account.loginURL;
+ let loginPage;
if ( host !== 'WPCOM' && this.account.legacyAccountName !== 'jetpackConnectUser' ) {
loginURL = `http://${ dataHelper.getJetpackSiteName() }/wp-admin`;
diff --git a/test/e2e/lib/mocha-hooks.js b/test/e2e/lib/mocha-hooks.js
index 1905b69b4ddc3..4a8e4bf0c5eb9 100644
--- a/test/e2e/lib/mocha-hooks.js
+++ b/test/e2e/lib/mocha-hooks.js
@@ -18,9 +18,9 @@ import * as videoRecorder from '../lib/video-recorder';
const afterHookTimeoutMS = config.get( 'afterHookTimeoutMS' );
let allPassed = true; // For SauceLabs status
-before( function() {
- if( process.env.LIVEBRANCHES === 'true' ){
- const isCalypsoLiveURL = config.get( 'calypsoBaseURL').includes( 'calypso.live' );
+before( function () {
+ if ( process.env.LIVEBRANCHES === 'true' ) {
+ const isCalypsoLiveURL = config.get( 'calypsoBaseURL' ).includes( 'calypso.live' );
assert.strictEqual( isCalypsoLiveURL, true );
}
} );
diff --git a/test/e2e/lib/pages/media-page.js b/test/e2e/lib/pages/media-page.js
index 5036d3f86214f..368417bb2f99a 100644
--- a/test/e2e/lib/pages/media-page.js
+++ b/test/e2e/lib/pages/media-page.js
@@ -82,9 +82,7 @@ export default class MediaPage extends AsyncBaseContainer {
}
async uploadFile( file ) {
- const fileNameInputSelector = By.css(
- '.media-library__upload-button input[type="file"]'
- );
+ const fileNameInputSelector = By.css( '.media-library__upload-button input[type="file"]' );
const driver = this.driver;
await driverHelper.waitTillPresentAndDisplayed(
@@ -104,14 +102,25 @@ export default class MediaPage extends AsyncBaseContainer {
}
async deleteMedia( file ) {
- if( await driverHelper.elementIsNotPresent( this.driver, By.css( '.media-library__list-item.is-selected' ) ) ) {
+ if (
+ await driverHelper.elementIsNotPresent(
+ this.driver,
+ By.css( '.media-library__list-item.is-selected' )
+ )
+ ) {
this.selectFirstImage();
}
- await driverHelper.clickWhenClickable( this.driver, By.css( '.editor-media-modal__delete') );
- return await driverHelper.clickWhenClickable( this.driver, By.css( '.dialog__backdrop button[data-e2e-button="accept"]') );
+ await driverHelper.clickWhenClickable( this.driver, By.css( '.editor-media-modal__delete' ) );
+ return await driverHelper.clickWhenClickable(
+ this.driver,
+ By.css( '.dialog__backdrop button[data-e2e-button="accept"]' )
+ );
}
async clickCancel() {
- return await driverHelper.clickWhenClickable( this.driver, By.css( '.editor-media-modal button[data-e2e-button="cancel"]'));
+ return await driverHelper.clickWhenClickable(
+ this.driver,
+ By.css( '.editor-media-modal button[data-e2e-button="cancel"]' )
+ );
}
}
diff --git a/test/e2e/specs/wp-log-in-out-spec.js b/test/e2e/specs/wp-log-in-out-spec.js
index 44abadeaa815f..80b5614227540 100644
--- a/test/e2e/specs/wp-log-in-out-spec.js
+++ b/test/e2e/specs/wp-log-in-out-spec.js
@@ -108,7 +108,9 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
! dataHelper.isRunningOnLiveBranch()
) {
describe( 'Can Log in on a 2fa account @secure-auth', function () {
- let loginFlow, twoFALoginPage, twoFACode;
+ let loginFlow;
+ let twoFALoginPage;
+ let twoFACode;
before( async function () {
return await driverManager.ensureNotLoggedIn( driver );
@@ -158,7 +160,8 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
! dataHelper.isRunningOnLiveBranch()
) {
describe( 'Can Log in on with 2fa push account @secure-auth', function () {
- let loginFlow, twoFALoginPage;
+ let loginFlow;
+ let twoFALoginPage;
before( async function () {
await driverManager.ensureNotLoggedIn( driver );
@@ -192,7 +195,8 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
! dataHelper.isRunningOnLiveBranch()
) {
describe( 'Can Log in on a 2fa account @secure-auth', function () {
- let loginFlow, twoFALoginPage;
+ let loginFlow;
+ let twoFALoginPage;
before( async function () {
await driverManager.ensureNotLoggedIn( driver );
@@ -231,7 +235,10 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
} );
describe( 'Can request a magic link email by entering the email of an account which does not have a password defined', function () {
- let magicLoginLink, loginFlow, magicLinkEmail, emailClient;
+ let magicLoginLink;
+ let loginFlow;
+ let magicLinkEmail;
+ let emailClient;
before( async function () {
loginFlow = new LoginFlow( driver, [ '+passwordless', '-2fa' ] );
emailClient = new EmailClient( get( loginFlow.account, 'mailosaur.inboxId' ) );
@@ -289,7 +296,10 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
} );
describe( 'Can request a magic link email by entering the email of an account which does not have a password defined', function () {
- let magicLoginLink, loginFlow, magicLinkEmail, emailClient;
+ let magicLoginLink;
+ let loginFlow;
+ let magicLinkEmail;
+ let emailClient;
before( async function () {
loginFlow = new LoginFlow( driver, [ '+passwordless', '+2fa-sms' ] );
emailClient = new EmailClient( get( loginFlow.account, 'mailosaur.inboxId' ) );
@@ -310,7 +320,9 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
} );
describe( 'Can use the magic link and the code received via sms to log in', function () {
- let magicLoginPage, twoFALoginPage, twoFACode;
+ let magicLoginPage;
+ let twoFALoginPage;
+ let twoFACode;
before( async function () {
await driver.get( magicLoginLink );
magicLoginPage = new MagicLoginPage( driver );
@@ -378,7 +390,10 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
} );
describe( 'Can request a magic link email by entering the email of an account which does not have a password defined', function () {
- let magicLoginLink, loginFlow, magicLinkEmail, emailClient;
+ let magicLoginLink;
+ let loginFlow;
+ let magicLinkEmail;
+ let emailClient;
before( async function () {
loginFlow = new LoginFlow( driver, [ '+passwordless', '+2fa-sms' ] );
emailClient = new EmailClient( get( loginFlow.account, 'mailosaur.inboxId' ) );
@@ -399,7 +414,8 @@ describe( `[${ host }] Authentication: (${ screenSize })`, function () {
} );
describe( 'Can use the magic link and the code received via sms to log in', function () {
- let magicLoginPage, twoFALoginPage;
+ let magicLoginPage;
+ let twoFALoginPage;
before( async function () {
driver.get( magicLoginLink );
magicLoginPage = new MagicLoginPage( driver );
diff --git a/test/e2e/specs/wp-plan-purchase-spec.js b/test/e2e/specs/wp-plan-purchase-spec.js
index 3581aad43ea4d..fe7a28d9cb75f 100644
--- a/test/e2e/specs/wp-plan-purchase-spec.js
+++ b/test/e2e/specs/wp-plan-purchase-spec.js
@@ -76,7 +76,8 @@ describe( `[${ host }] Plans: (${ screenSize })`, function () {
} );
describe( 'Viewing a specific plan with coupon: @parallel @jetpack', function () {
- let originalCartAmount, loginFlow;
+ let originalCartAmount;
+ let loginFlow;
before( async function () {
return await driverManager.ensureNotLoggedIn( driver );