Fix ESLINT errors

Created on 29 December 2023, about 1 year ago
Updated 16 May 2024, 8 months ago

Problem/Motivation

Now that we have the Gitlab CI running, the job failed on ESLINT with the following:

/builds/project/fragments/web/modules/custom/fragments/js/fragment-form.js
   6:2   warning  Unexpected unnamed function                                                                                                     func-names
   7:3   error    'use strict' is unnecessary inside of modules                                                                                   strict
  16:5   warning  Unexpected unnamed method 'attach'                                                                                              func-names
  16:5   error    Expected method shorthand                                                                                                       object-shorthand
  17:7   error    Unexpected var, use let or const instead                                                                                        no-var
  19:15  error    Replace `.find('.fragment-form-publishing-status')` with `⏎········.find('.fragment-form-publishing-status')⏎········`          prettier/prettier
  19:74  warning  Unexpected unnamed function                                                                                                     func-names
  19:84  error    'context' is already declared in the upper scope on line 16 column 23                                                           no-shadow
  20:1   error    Insert `··`                                                                                                                     prettier/prettier
  20:9   error    Unexpected var, use let or const instead                                                                                        no-var
  21:9   error    Insert `··`                                                                                                                     prettier/prettier
  21:9   error    Unexpected var, use let or const instead                                                                                        no-var
  23:1   error    Insert `··`                                                                                                                     prettier/prettier
  24:11  error    Insert `··`                                                                                                                     prettier/prettier
  25:1   error    Insert `··`                                                                                                                     prettier/prettier
  27:9   error    Insert `··`                                                                                                                     prettier/prettier
  28:1   error    Insert `··`                                                                                                                     prettier/prettier
  30:15  error    Replace `.find('.fragment-form-authoring-information')` with `⏎········.find('.fragment-form-authoring-information')⏎········`  prettier/prettier
  30:78  warning  Unexpected unnamed function                                                                                                     func-names
  30:88  error    'context' is already declared in the upper scope on line 16 column 23                                                           no-shadow
  31:1   error    Insert `··`                                                                                                                     prettier/prettier
  31:9   error    Unexpected var, use let or const instead                                                                                        no-var
  32:9   error    Insert `··`                                                                                                                     prettier/prettier
  32:9   error    Unexpected var, use let or const instead                                                                                        no-var
  34:1   error    Insert `··`                                                                                                                     prettier/prettier
  35:11  error    Insert `··`                                                                                                                     prettier/prettier
  36:9   error    Insert `··`                                                                                                                     prettier/prettier
  37:1   error    Insert `··`                                                                                                                     prettier/prettier
  38:6   error    Insert `,`                                                                                                                      prettier/prettier
✖ 29 problems (25 errors, 4 warnings)
  23 errors and 0 warnings potentially fixable with the `--fix` option
📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024