Comply with Drupal coding standards (1) (ESLint)

Created on 9 September 2023, 10 months ago
Updated 18 October 2023, 9 months ago

Problem/Motivation

Fix the following eslint error report by https://git.drupalcode.org/project/openid_connect_daccount/-/jobs/79695

$ $CI_PROJECT_DIR/$_WEB_ROOT/core/node_modules/.bin/eslint --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$CI_PROJECT_DIR/$_WEB_ROOT/core --ext=.js,.yml . || true/builds/project/openid_connect_daccount/web/modules/custom/openid_connect_daccount/js/openid_connect_daccount_common.js
   1:2   warning  Unexpected unnamed function                                                                                                      func-names
   2:3   error    'use strict' is unnecessary inside of modules                                                                                    strict
   5:5   warning  Unexpected unnamed method 'attach'                                                                                               func-names
   5:5   error    Expected method shorthand                                                                                                        object-shorthand
   5:23  warning  'context' is defined but never used                                                                                              no-unused-vars
   5:32  warning  'settings' is defined but never used                                                                                             no-unused-vars
   6:13  error    Identifier 'dummy_email_enable' is not in camel case                                                                             camelcase
   6:58  error    Replace `'edit-settings-dummy-email-enable'` with `⏎········'edit-settings-dummy-email-enable',⏎······`                          prettier/prettier
   7:13  error    Identifier 'dummy_email_domain' is not in camel case                                                                             camelcase
   7:57  error    Replace `'div.js-form-item-settings-dummy-email-domain'` with `⏎········'div.js-form-item-settings-dummy-email-domain',⏎······`  prettier/prettier
  10:9   error    Identifier 'dummy_email_domain' is not in camel case                                                                             camelcase
  10:44  error    Identifier 'dummy_email_enable' is not in camel case                                                                             camelcase
  10:70  error    Replace `·?·'block'` with `⏎··········?·'block'⏎·········`                                                                       prettier/prettier
  13:7   error    Identifier 'dummy_email_enable' is not in camel case                                                                             camelcase
  13:43  error    Replace `'change',·toggleDummyEmailDomainField` with `⏎········'change',⏎········toggleDummyEmailDomainField,⏎······`            prettier/prettier
✖ 15 problems (11 errors, 4 warnings)
  6 errors and 0 warnings potentially fixable with the `--fix` option.
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States yas California 🇺🇸

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

Comments & Activities

Production build 0.69.0 2024