Fix eslint violations

Created on 1 January 2024, over 1 year ago
Updated 31 July 2024, 9 months ago

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

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇷🇺Russia zniki.ru

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024