As of Drupal 8 all JS needs to follow our JavaScript coding standards. For this we use ESLint to check most of our standards.
Here is the summary of running ESLint on this module JS:
✖ 4 problems (4 errors, 0 warnings)

Attached is the full list of errors found by ESLint and the patch that fixes them.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, fix-eslint-errors.patch, failed testing.

nod_’s picture

Status: Needs work » Needs review

Don't know why the PHP fails but it's unrelated to this patch.

Lucasljj queued fix-eslint-errors.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, fix-eslint-errors.patch, failed testing.

Grimreaper’s picture

Status: Needs work » Reviewed & tested by the community

Hello,

The test failed because the 8.x-1.x branch on Drupal.org is not functionnal see #2442425: install a contrib module error

The real pathauto 8.x-1.x is there https://github.com/md-systems/pathauto

And I just check your patch against the last code base and it is applyable and it fixes the ESLint errors.

Thanks for the patch Drupal heroes ;)

Dave Reid queued fix-eslint-errors.patch for re-testing.

Dave Reid’s picture

Status: Reviewed & tested by the community » Needs work

Needs a re-roll.

sdstyles’s picture

Status: Needs work » Needs review
FileSize
1.27 KB

Status: Needs review » Needs work

The last submitted patch, 8: fix-eslint-errors-2490316-8.patch, failed testing.

The last submitted patch, 8: fix-eslint-errors-2490316-8.patch, failed testing.

juampynr’s picture

  1. +++ b/pathauto.js
    @@ -1,22 +1,24 @@
    +        var path = $('.form-item-path-alias input').val();
    

    Why context was removed here and in the next line?

  2. +++ b/pathauto.js
    @@ -1,22 +1,24 @@
    +        if (path) {
    

    I think that this is incorrect. It should be else if. Is ESLint changing this automatically?

sdstyles’s picture

@juampynr you are right this should be fixed, last time I just reroll the patch, now I fixed issues and re-checked script with eslint.

alexdmccabe’s picture

Status: Needs review » Closed (duplicate)

It looks like these changes were already applied as a part of #2683367.