Problem/Motivation

At #3417482: [Meta] Pass Eslint validations 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.

Issue fork examples-3417499

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jlbellido created an issue. See original summary.

apaderno made their first commit to this issue’s fork.

avpaderno’s picture

Title: Pass Eslint validations: Field example » Pass ESLint validations: Field Example

avpaderno’s picture

Status: Active » Needs review

  • apaderno committed d110232a on 4.0.x
    Issue #3417499: Fix ESLint errors for the Field Example module
    
avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.