Fix eslint and stylelint issue

Created on 10 November 2023, 8 months ago
Updated 3 February 2024, 5 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
    8 months ago
    Total: 137s
    #48771
  • Status changed to Needs work 8 months 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
    8 months ago
    Total: 136s
    #48778
  • Pipeline finished with Success
    8 months ago
    Total: 139s
    #48821
  • Status changed to Needs review 8 months 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
    5 months ago
    #80296
  • Status changed to Fixed 5 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024