Fix issues reported by eslint

Created on 3 December 2024, 4 months ago

Problem/Motivation

With ๐Ÿ“Œ Integration with Gitlab CI Active in place, we can start checking for eslint. There is a report now for the issues we can fix.

*****************************************************************************************************************************
These are the current ESLint errors and warnings 
*****************************************************************************************************************************
$ $CI_PROJECT_DIR/$_WEB_ROOT/core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$CI_PROJECT_DIR/$_WEB_ROOT/core --ext=.js,.yml $_ESLINT_EXTRA . || true
/builds/project/mask/web/modules/custom/mask/js/mask.js
   2:1   error  Delete `โŽ`                                                                                                                                                             prettier/prettier
   8:3   error  for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array  no-restricted-syntax
   8:3   error  The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype                                                             guard-for-in
   8:8   error  All 'var' declarations must be at the top of the function scope                                                                                                        vars-on-top
   8:8   error  Unexpected var, use let or const instead                                                                                                                               no-var
   9:5   error  All 'var' declarations must be at the top of the function scope                                                                                                        vars-on-top
   9:5   error  Unexpected var, use let or const instead                                                                                                                               no-var
  17:58  error  'maskElements' was used before it was defined                                                                                                                          no-use-before-define
  18:6   error  Insert `,`                                                                                                                                                             prettier/prettier
  23:11  error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  26:23  error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  28:16  error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  29:23  error  Insert `โŽยทยทยทยทยทยทยท`                                                                                                                                                      prettier/prettier
  29:24  error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  30:22  error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  31:51  error  Insert `,`                                                                                                                                                             prettier/prettier
  35:5   error  Identifier 'mask_element' is not in camel case                                                                                                                         camelcase
  37:35  error  Delete `ยท`                                                                                                                                                             prettier/prettier
โœ– 18 problems (18 errors, 0 warnings)
  7 errors and 0 warnings potentially fixable with the `--fix` option.                                 

Steps to reproduce

See https://git.drupalcode.org/project/mask/-/jobs/3576796

Proposed resolution

-

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

๐Ÿ“Œ Task
Status

Active

Version

2.1

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

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