Fix eslint and stylelint issue

Created on 10 November 2023, about 1 year ago
Updated 3 February 2024, 10 months ago

Problem/Motivation

The eslint step is failing gitlab. We should unskip it and fix it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @alexpott
  • First commit to issue fork.
  • Merge request !10Resolve #3400804 "Fix eslint and stylint" β†’ (Merged) created by megachriz
  • Pipeline finished with Success
    about 1 year ago
    Total: 137s
    #48771
  • Status changed to Needs work about 1 year ago
  • πŸ‡³πŸ‡±Netherlands megachriz

    I'm not so familiar yet with the coding standards on JavaScript. I'm also not that strong on JavaScript.

    I don't know yet how I should fix the following warning:

    warning  Unexpected unnamed function  func-name
    

    For example, that warning is given about the following line:

    $(Drupal.blockFloatStack()).each(function() {
    

    So it looks like eslint doesn't allow anonymous functions? But I see them used in Drupal's code base as well. For example in core/modules/media/js/type_form.js on line 48:

    .each(function () {
    

    And in core/misc/autocomplete.js on line 226:

    $autocomplete.autocomplete(autocomplete.options).each(function () {
    

    So what do I need to do here to pass eslint?

  • Pipeline finished with Success
    about 1 year ago
    Total: 136s
    #48778
  • Pipeline finished with Success
    about 1 year ago
    Total: 139s
    #48821
  • Status changed to Needs review about 1 year ago
  • πŸ‡³πŸ‡±Netherlands megachriz

    Okay, I see now that it still gives the warning about "Unexpected unnamed function", but GitLab CI does mark eslint as passed anyway. Then this can move to "Needs review".

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I've merged in πŸ“Œ Add javascript test coverage Fixed

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Pipeline finished with Skipped
    10 months ago
    #80296
  • Status changed to Fixed 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024