Skip to content

Commit eadf47b

Browse files
Copilotpattonwebz
andcommitted
Fix linting issues: add translations and fix spacing/console errors
Co-authored-by: pattonwebz <3902039+pattonwebz@users.noreply.github.com>
1 parent 9c49dfa commit eadf47b

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/admin/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable no-unused-vars */
22

3+
import { __ } from '@wordpress/i18n';
34
import {
45
clearAllTabsAndPanelState, initFixButtonEventHandlers,
56
initSummaryTabKeyboardAndClickHandlers,
@@ -842,7 +843,8 @@ const fillDashboardWidget = () => {
842843
}
843844
} )
844845
.catch( ( e ) => {
845-
console.error( 'EDAC: Failed to load scan statistics:', e );
846+
// eslint-disable-next-line no-console
847+
console.error( __( 'EDAC: Failed to load scan statistics:', 'accessibility-checker' ), e );
846848
// Hide the dashboard widget on error
847849
const wrapper = document.querySelector(
848850
'.edac-summary.edac-modal-container'

src/frontendHighlighterApp/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,23 +485,26 @@ class AccessibilityCheckerHighlight {
485485
//issueElement.focus();
486486

487487
if ( ! this.checkVisibility( tooltip ) || ! this.checkVisibility( element ) ) {
488-
this.currentIssueStatus = 'The element is not visible. Try disabling styles.';
488+
this.currentIssueStatus = __( 'The element is not visible. Try disabling styles.', 'accessibility-checker' );
489489
if ( window.edacDebug ) {
490-
console.log( `EDAC: Element with id ${id} is not visible!` );
490+
// eslint-disable-next-line no-console
491+
console.log( __( 'EDAC: Element with id %s is not visible!', 'accessibility-checker' ).replace( '%s', `${ id }` ) );
491492
}
492493
} else {
493494
this.currentIssueStatus = null;
494495
}
495496
} else {
496-
this.currentIssueStatus = 'The element is not focusable. Try disabling styles.';
497+
this.currentIssueStatus = __( 'The element is not focusable. Try disabling styles.', 'accessibility-checker' );
497498
if ( window.edacDebug ) {
498-
console.log( `EDAC: Element with id ${id} is not focusable!` );
499+
// eslint-disable-next-line no-console
500+
console.log( __( 'EDAC: Element with id %s is not focusable!', 'accessibility-checker' ).replace( '%s', `${ id }` ) );
499501
}
500502
}
501503
} else {
502-
this.currentIssueStatus = 'The element was not found on the page.';
504+
this.currentIssueStatus = __( 'The element was not found on the page.', 'accessibility-checker' );
503505
if ( window.edacDebug ) {
504-
console.log( `EDAC: Element with id ${id} not found in the document!` );
506+
// eslint-disable-next-line no-console
507+
console.log( __( 'EDAC: Element with id %s not found in the document!', 'accessibility-checker' ).replace( '%s', `${ id }` ) );
505508
}
506509
}
507510

src/pageScanner/checks/table-has-headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
// Enhanced logic to account for colspan, rowspan, and ARIA header relationships
99
const hasAriaHeaders = node.querySelector( '[headers]' );
1010
const hasAriaLabelledBy = node.querySelector( '[aria-labelledby]' );
11-
11+
1212
// If table uses ARIA headers/labelledby relationships, it's considered valid
1313
if ( hasAriaHeaders || hasAriaLabelledBy ) {
1414
return true;

0 commit comments

Comments
 (0)