Skip to content

Commit

Permalink
Fix eslint bug related to spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jul 28, 2018
1 parent 4f59c05 commit ab8c382
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"extends": "wordpress"
"extends": "wordpress",
"rules": {
"space-in-parens": [
"error",
"always", {
"exceptions": [
"empty"
]
}
]
}
}
12 changes: 6 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module.exports = function( grunt ) {
// Get a list of all the files and directories to exclude from the distribution.
const releaseFiles = ignoreParse( '.distignore', {
invert: true,
});
} );

grunt.initConfig({
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),

dist_dir: 'dist',
Expand Down Expand Up @@ -87,10 +87,10 @@ module.exports = function( grunt ) {
trunk: {
options: Object.assign( deployConfig, {
deploy_tag: false,
})
} )
}
},
});
} );

grunt.registerTask( 'check-diff', function() {
const done = this.async(); // This won't work with the ES6 fat arrow syntax.
Expand All @@ -102,8 +102,8 @@ module.exports = function( grunt ) {
}

done();
});
});
} );
} );

grunt.registerTask(
'build', [
Expand Down
6 changes: 3 additions & 3 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jQuery( document ).ready( function( $ ) {

$( this ).on( 'change', function() {
$( target ).toggle( ! $( this ).is( ':checked' ) );
});
});
} );
} );

});
} );
16 changes: 8 additions & 8 deletions assets/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
if ( 'function' === typeof ga ) { // Universal Google Analytics is available
ga( 'send', 'event', eventCategory, eventAction, eventTitle );
} else if ( 'undefined' !== typeof _gaq ) { // Classic Google Analytics is available
_gaq.push([ '_trackEvent', eventCategory, eventAction, eventTitle ]);
_gaq.push( [ '_trackEvent', eventCategory, eventAction, eventTitle ] );
}
if ( 'undefined' !== typeof _paq ) { // Matomo (formerly Piwik) is available
_paq.push([ 'trackEvent', eventCategory, eventAction, eventTitle ]);
_paq.push( [ 'trackEvent', eventCategory, eventAction, eventTitle ] );
}
};

function trackAnalyticsEvent( formId, eventName ) {
formId = parseInt( formId );

if ( ! formId || ! window.cf7_extras.events[ eventName ]) {
if ( ! formId || ! window.cf7_extras.events[ eventName ] ) {
return false;
}

Expand All @@ -31,7 +31,7 @@
function getFormConfig( formId ) {
formId = parseInt( formId );

if ( window.cf7_extras.forms && window.cf7_extras.forms[ formId ]) {
if ( window.cf7_extras.forms && window.cf7_extras.forms[ formId ] ) {
return window.cf7_extras.forms[ formId ];
}

Expand All @@ -45,7 +45,7 @@
formConfig = getFormConfig( form.contactFormId );
trackAnalyticsEvent( 'Contact Form', 'Sent', formConfig.title );
}
});
} );

$( document ).on( 'wpcf7:mailfailed', function( event, form ) {
var formConfig;
Expand All @@ -54,7 +54,7 @@
formConfig = getFormConfig( form.contactFormId );
trackAnalyticsEvent( 'Contact Form', 'Error', formConfig.title );
}
});
} );

$( document ).on( 'wpcf7:spam', function( event, form ) {
var formConfig;
Expand All @@ -63,7 +63,7 @@
formConfig = getFormConfig( form.contactFormId );
trackAnalyticsEvent( 'Contact Form', 'Spam', formConfig.title );
}
});
} );

$( document ).on( 'wpcf7:submit', function( event, form ) {
var formConfig;
Expand All @@ -80,5 +80,5 @@
window.location = formConfig.redirect_url;
}
}
});
} );
}( jQuery ) );

0 comments on commit ab8c382

Please sign in to comment.