Problem/Motivation

Source: https://git.drupalcode.org/project/pathauto/-/jobs/552977

Command:

 ../../../core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=../../../core --ext=.js,.yml .
 

Result:

/builds/project/pathauto/web/modules/custom/pathauto/config/install/pathauto.settings.yml
  15:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
  16:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
  17:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
  18:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
  19:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
  20:1  error  Expected indentation of 2 spaces but found 1 spaces  yml/indent
/builds/project/pathauto/web/modules/custom/pathauto/pathauto.info.yml
   7:1  error  Expected indentation of 2 spaces but found 0 spaces  yml/indent
   8:1  error  Expected indentation of 2 spaces but found 0 spaces  yml/indent
  13:1  error  Expected indentation of 2 spaces but found 0 spaces  yml/indent
/builds/project/pathauto/web/modules/custom/pathauto/pathauto.js
   1:2   warning  Unexpected unnamed function                                                                                                                                                                func-names
   2:3   error    'use strict' is unnecessary inside of modules                                                                                                                                              strict
   2:3   error    Expected newline after "use strict" directive                                                                                                                                              lines-around-directive
   4:5   warning  Unexpected unnamed method 'attach'                                                                                                                                                         func-names
   4:5   error    Expected method shorthand                                                                                                                                                                  object-shorthand
   5:17  error    Replace `.find('.path-form')` with `⏎········.find('.path-form')⏎········`                                                                                                                 prettier/prettier
   5:54  warning  Unexpected unnamed function                                                                                                                                                                func-names
   5:64  error    'context' is already declared in the upper scope on line 4 column 23                                                                                                                       no-shadow
   6:1   error    Insert `··`                                                                                                                                                                                prettier/prettier
   6:9   error    Unexpected var, use let or const instead                                                                                                                                                   no-var
   7:9   error    Replace `var·automatic·=·$('.js-form-item-path-0-pathauto·input',·context` with `··var·automatic·=·$(⏎············'.js-form-item-path-0-pathauto·input',⏎············context,⏎··········`  prettier/prettier
   7:9   error    Unexpected var, use let or const instead                                                                                                                                                   no-var
   9:9   error    Insert `··`                                                                                                                                                                                prettier/prettier
  10:1   error    Insert `··`                                                                                                                                                                                prettier/prettier
  11:9   error    Replace `}⏎·······` with `··}`                                                                                                                                                             prettier/prettier
  12:14  error    Unnecessary 'else' after 'return'                                                                                                                                                          no-else-return
  13:1   error    Replace `··········return·Drupal.t('Alias:·@alias',·{'@alias':·path` with `············return·Drupal.t('Alias:·@alias',·{·'@alias':·path·`                                                 prettier/prettier
  14:7   error    Replace `··}⏎·······` with `····}`                                                                                                                                                         prettier/prettier
  16:1   error    Insert `··`                                                                                                                                                                                prettier/prettier
  17:9   error    Insert `··`                                                                                                                                                                                prettier/prettier
  18:1   error    Insert `··`                                                                                                                                                                                prettier/prettier
  19:6   error    Insert `,`                                                                                                                                                                                 prettier/prettier
✖ 31 problems (28 errors, 3 warnings)
  27 errors and 0 warnings potentially fixable with the `--fix` option.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork pathauto-3411805

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

Nikolay Shapovalov created an issue. See original summary.

nikolay shapovalov’s picture

Status: Active » Needs work

Need to fix 3 violations:

pathauto/pathauto.js
  1:2   warning  Unexpected unnamed function                                           func-names
  6:27  warning  Unexpected unnamed function                                           func-names
  6:37  error    'context' is already declared in the upper scope on line 3 column 12  no-shadow
nikolay shapovalov’s picture

Status: Needs work » Needs review

Ready for review.

d-xpert’s picture

Status: Needs review » Reviewed & tested by the community

Changes looks good ,
All Eslint errors seems to be addressed for now.

rajeshreeputra’s picture

Changes looks good.

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

berdir’s picture

Status: Reviewed & tested by the community » Needs work

As commented, I don't see why services.yml needs to change. If anything we should try to use autowire to reduce bloat but that seems like a separate issue and won't work for all services.

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

mably’s picture

Status: Needs work » Needs review

Changed to services.yml have been rolled back.

Changes to JS file have been a bit refactored to reduce usage of jQuery.

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

I reviewed the ESLINT results in the GitLab CI pipeline and confirmed that the errors no longer exist.
Here is the link for reference:
ESLINT: https://git.drupalcode.org/issue/pathauto-3411805/-/jobs/8388784

I'm moving this now to "RTBC".

Thank you!

mably’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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