Pass ESLint validations: Field Example

Created on 27 January 2024, about 1 year ago
Updated 20 July 2024, 7 months ago

Problem/Motivation

At 📌 [Meta] Pass Eslint validations Active we are aiming to have all the eslint validation checks passing for the Examples module.

On this issue, we'll be focused on the field_example sub-module

Initial errors detected by 27/01/2024

modules/field_example/field_example.js
   9:2   warning  Unexpected unnamed function                                                                          func-names
  10:1   error    Delete `⏎`                                                                                           prettier/prettier
  11:3   error    'use strict' is unnecessary inside of modules                                                        strict
  14:5   warning  Unexpected unnamed method 'attach'                                                                   func-names
  14:5   error    Expected method shorthand                                                                            object-shorthand
  15:56  warning  Unexpected unnamed function                                                                          func-names
  16:9   error    Unexpected var, use let or const instead                                                             no-var
  16:13  error    Identifier 'edit_field' is not in camel case                                                         camelcase
  17:9   error    Unexpected var, use let or const instead                                                             no-var
  17:29  error    Replace `.closest('div').parent()` with `⏎··········.closest('div')⏎··········.parent()⏎··········`  prettier/prettier
  21:30  warning  Unexpected unnamed function                                                                          func-names
  22:11  error    Identifier 'edit_field' is not in camel case                                                         camelcase
  23:21  error    Identifier 'edit_field' is not in camel case                                                         camelcase
  25:6   error    Insert `,`                                                                                           prettier/prettier
modules/field_example/field_example.links.menu.yml
  2:1   error  Expected indentation of 2 spaces but found 1 spaces       yml/indent
  2:8   error  Multiple spaces found before 'Field Example'              no-multi-spaces
  3:1   error  Expected indentation of 2 spaces but found 1 spaces       yml/indent
  3:13  error  Multiple spaces found before 'field_example.description'  no-multi-spaces

Proposed resolution

  1. Check the parent issue for detailed instructions about how to run eslint locally
  2. Run eslint against the submodule: field_example
  3. Fix the issues found and make a MR with the fixes.
📌 Task
Status

Fixed

Version

4.0

Component

Field Example

Created by

🇪🇸Spain jlbellido

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