Problem/Motivation

ESLint tests are failing in the Gitlab CI process.

Steps to reproduce

View the test report:
https://git.drupalcode.org/issue/restrict_ip-3401974/-/pipelines/50527

Proposed resolution

Review the issues identified and resolve them in code.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

raywalters created an issue. See original summary.

raywalters’s picture

This is now passing ESLint and ready for review. https://git.drupalcode.org/issue/restrict_ip-3405330/-/pipelines/64579

raywalters’s picture

Status: Active » Needs review
pilot3’s picture

Looks great! The eslint tests now pass on the pipeline.

pilot3’s picture

Status: Needs review » Reviewed & tested by the community

anybody made their first commit to this issue’s fork.

anybody’s picture

Assigned: raywalters » Unassigned
Status: Reviewed & tested by the community » Needs work

@raywalters and @pilot3: eslint is still unhappy:

/builds/project/restrict_ip/web/modules/custom/restrict_ip/js/mail_fix.js
  9:3  error  .ready is not allowed  no-jquery/no-ready
✖ 1 problem (1 error, 0 warnings)
sandip’s picture

Assigned: Unassigned » sandip

Working on it.

sandip’s picture

Assigned: sandip » Unassigned
Status: Needs work » Needs review

Eslint pipeline is green now :)

anybody’s picture

Title: Fix ESLint errors from gitlab ci » Fix ESLint errors from gitlab ci by removing jQuery dependency
Version: 4.0.0-beta1 » 4.x-dev
Status: Needs review » Needs work

Thanks @sandip poddar, but just muting ESLint is not a fix. Please fix the issues instead.

sandip’s picture

Assigned: Unassigned » sandip
sandip’s picture

@anybody can you please guide me should i remove jquery from the codebase and can we use Drupal Behaviors here? As in the code it is mentioned we cannot use Drupal behaviors also.

/* jslint white:true, multivar, this, browser:true */

// eslint-disable-next-line func-names
(function ($) {
  // We do not use Drupal.behaviors, as the Drupal object
  // is not available due to drupal.js having been removed

  // eslint-disable-next-line no-jquery/no-ready, func-names
  $(document).ready(function () {
    const mailDiv = $('#restrict_ip_contact_mail');
    const contactMail = mailDiv.text().replace('[at]', '@');
    mailDiv.html(`<a href="mailto:${contactMail}">${contactMail}</a>`);
  });
})(jQuery);

smustgrave’s picture

Status: Needs work » Closed (duplicate)