Skip to content

Commit 2063105

Browse files
kraftbjmatticbot
authored andcommitted
Fix JS linting errors in Super Cache and remove .eslintignore #40571 (#47979)
Co-authored-by: yaswanth.kumar <yaswanth.kumar@automationanywhere.com> Co-authored-by: Brandon Kraft <public@brandonkraft.com> Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/24104123495 Upstream-Ref: Automattic/jetpack@ca90ae2
1 parent e7bedbb commit 2063105

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This is an alpha version! The changes listed here are not final.
2525
- Fix a PHP warning when the newest cached pages list is unavailable.
2626
- Fix TS errors detected by tsgo.
2727
- Fix `str_starts_with()` PHP 8.1+ deprecation when `$wp_cache_home_path` is null in `get_current_url_supercache_dir()`.
28+
- Remove `.eslintignore` and fix JS linting errors in `delete-cache-button.js`.
2829

2930
## [3.0.3] - 2025-11-11
3031
### Added

inc/delete-cache-button.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global wpsc_ajax */
12
( function ( $ ) {
23
$( document ).ready( function () {
34
$( '#wp-admin-bar-delete-cache' ).on( 'click', function () {
@@ -16,12 +17,17 @@
1617
// send the nonce along with the request
1718
nonce: wpsc_ajax.nonce,
1819
},
19-
success: function ( msg ) {
20-
wpsc_ajax.admin == 1 && console.log( 'Deleted entire cache' );
21-
wpsc_ajax.admin == 0 && console.log( 'Deleted cache for this page and reloading' );
20+
success: function () {
21+
if ( wpsc_ajax.admin === '1' ) {
22+
// eslint-disable-next-line no-console
23+
console.log( 'Deleted entire cache' );
24+
} else {
25+
// eslint-disable-next-line no-console
26+
console.log( 'Deleted cache for this page and reloading' );
27+
}
2228
window.location.reload();
2329
},
24-
complete: function ( msg ) {
30+
complete: function () {
2531
$( '#wp-admin-bar-delete-cache' ).fadeIn( 'slow' );
2632
},
2733
} );

0 commit comments

Comments
 (0)