diff --git a/.eslintrc.json b/.eslintrc.json index 5317d52..c59ca79 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,13 @@ { - "extends": "wordpress" + "extends": "wordpress", + "rules": { + "space-in-parens": [ + "error", + "always", { + "exceptions": [ + "empty" + ] + } + ] + } } diff --git a/Gruntfile.js b/Gruntfile.js index 8d172b8..e0c645c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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', @@ -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. @@ -102,8 +102,8 @@ module.exports = function( grunt ) { } done(); - }); - }); + } ); + } ); grunt.registerTask( 'build', [ diff --git a/assets/js/admin.js b/assets/js/admin.js index b530e1b..d8686e7 100644 --- a/assets/js/admin.js +++ b/assets/js/admin.js @@ -7,7 +7,7 @@ jQuery( document ).ready( function( $ ) { $( this ).on( 'change', function() { $( target ).toggle( ! $( this ).is( ':checked' ) ); - }); - }); + } ); + } ); -}); +} ); diff --git a/assets/js/controls.js b/assets/js/controls.js index 6d89844..12e27e5 100644 --- a/assets/js/controls.js +++ b/assets/js/controls.js @@ -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; } @@ -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 ]; } @@ -45,7 +45,7 @@ formConfig = getFormConfig( form.contactFormId ); trackAnalyticsEvent( 'Contact Form', 'Sent', formConfig.title ); } - }); + } ); $( document ).on( 'wpcf7:mailfailed', function( event, form ) { var formConfig; @@ -54,7 +54,7 @@ formConfig = getFormConfig( form.contactFormId ); trackAnalyticsEvent( 'Contact Form', 'Error', formConfig.title ); } - }); + } ); $( document ).on( 'wpcf7:spam', function( event, form ) { var formConfig; @@ -63,7 +63,7 @@ formConfig = getFormConfig( form.contactFormId ); trackAnalyticsEvent( 'Contact Form', 'Spam', formConfig.title ); } - }); + } ); $( document ).on( 'wpcf7:submit', function( event, form ) { var formConfig; @@ -80,5 +80,5 @@ window.location = formConfig.redirect_url; } } - }); + } ); }( jQuery ) );