fix: #3614938 Resolve ESLint findings

Summary

Updates comment_notify.js to current Drupal JavaScript formatting, method shorthand, and jQuery event binding standards without changing the checkbox behavior.

Why these changes were needed

Original code ESLint rule Why it failed Resolution
"use strict"; strict ESLint already treats the file as strict, making the directive unnecessary. Removed the redundant directive.
attach: function (context) object-shorthand Drupal JavaScript standards require object method shorthand. Changed it to attach(context).
.bind("change", handler) no-jquery/no-bind Drupal prohibits the legacy jQuery .bind() event API. Replaced it with the equivalent .on("change", handler).
Double-quoted JavaScript strings prettier/prettier The current Prettier configuration requires single quotes. Changed the affected strings to single quotes.
Computed show or hide call formatting prettier/prettier The expression did not match the configured line wrapping. Applied the required multiline formatting.
Missing statement terminator prettier/prettier The formatted computed method call requires a semicolon. Added the semicolon.

Behavioral safety

  • The Drupal behavior still attaches with the supplied context.
  • Both element selectors are unchanged.
  • jQuery implements .bind() through .on() for this use case, so the event behavior is equivalent.
  • The event callback remains a normal function so this.checked continues to reference the changed checkbox.
  • The initial .trigger("change") behavior remains in place.
  • No once() behavior was introduced, preserving existing AJAX reattachment behavior.
  • Mouse and keyboard activation continue to use the native checkbox change event.

Validation

Closes #3614938

AI-Generated: Yes (OpenAI Codex inspected CI, implemented and reviewed the focused changes, ran local validation, and assisted with this merge request description. A human reviewed the behavior before merge.)

Edited by David Valdez

Merge request reports

Loading