Fix coding standards in js

Created on 7 August 2023, over 1 year ago
Updated 22 August 2023, over 1 year ago

Problem/Motivation

/var/www/html/modules/contrib/phone_number/js/phone-number-form-element.js
5	Unexpected unnamed function. (func-names)
6	'use strict' is unnecessary inside of modules. (strict)
6	Expected newline after "use strict" directive. (lines-around-directive)
8	Unexpected unnamed method 'attach'. (func-names)
8	Expected method shorthand. (object-shorthand)
8	'settings' is defined but never used. (no-unused-vars)
9	Insert `⏎········` (prettier/prettier)
9	Unexpected unnamed function. (func-names)
10	Insert `··` (prettier/prettier)
10	Unexpected var, use let or const instead. (no-var)
11	Insert `··` (prettier/prettier)
11	Unexpected var, use let or const instead. (no-var)
12	Insert `··` (prettier/prettier)
13	Replace `········$input.wrap('<div·class="country-select"></div>').before('<div·class="phone-number-flag"></div><span·class="arrow"></span><div·class="prefix"></div>'` with `··········$input⏎············.wrap('<div·class="country-select"></div>')⏎·····...
14	Insert `··` (prettier/prettier)
14	'setCountry' was used before it was defined. (no-use-before-define)
15	Insert `··` (prettier/prettier)
15	Unexpected unnamed function. (func-names)
15	'e' is defined but never used. (no-unused-vars)
16	Insert `··` (prettier/prettier)
17	Insert `··` (prettier/prettier)
18	Insert `··` (prettier/prettier)
20	Insert `··` (prettier/prettier)
20	'setCountry' was used before it was defined. (no-use-before-define)
21	Insert `··` (prettier/prettier)
23	Insert `··` (prettier/prettier)
24	Replace `$input.parents('.country-select').find('.phone-number-flag')` with `··$input⏎··············.parents('.country-select')⏎··············.find('.phone-number-flag')⏎··············` (prettier/prettier)
25	Replace `$input.parents('.country-select').find('.phone-number-flag')` with `··$input⏎··············.parents('.country-select')⏎··············.find('.phone-number-flag')⏎··············` (prettier/prettier)
26	Insert `··` (prettier/prettier)
28	Replace `··········` with `············` (prettier/prettier)
28	All 'var' declarations must be at the top of the function scope. (vars-on-top)
28	Unexpected var, use let or const instead. (no-var)
28	Use object destructuring. (prefer-destructuring)
29	Insert `··` (prettier/prettier)
29	All 'var' declarations must be at the top of the function scope. (vars-on-top)
29	Unexpected var, use let or const instead. (no-var)
30	Replace `············` with `··············` (prettier/prettier)
31	Insert `··` (prettier/prettier)
31	All 'var' declarations must be at the top of the function scope. (vars-on-top)
31	Unexpected var, use let or const instead. (no-var)
32	Replace `··············$input.parents('.country-select').find('.prefix')` with `················$input⏎··················.parents('.country-select')⏎··················.find('.prefix')⏎··················` (prettier/prettier)
32	Unexpected string concatenation. (prefer-template)
33	Insert `··············}⏎` (prettier/prettier)
35	Replace `⏎······}` with `,⏎······` (prettier/prettier)
37	Insert `,` (prettier/prettier)
/var/www/html/modules/contrib/phone_number/modules/sms_phone_number/js/sms-phone-number-form-element.js
5	Unexpected unnamed function. (func-names)
6	'use strict' is unnecessary inside of modules. (strict)
6	Expected newline after "use strict" directive. (lines-around-directive)
8	Unexpected unnamed method 'attach'. (func-names)
8	Expected method shorthand. (object-shorthand)
9	Replace `'field-setup',·'.sms-phone-number-field·.local-number',·context` with `⏎········'field-setup',⏎········'.sms-phone-number-field·.local-number',⏎········context,⏎······` (prettier/prettier)
9	Unexpected unnamed function. (func-names)
10	Unexpected var, use let or const instead. (no-var)
11	Unexpected var, use let or const instead. (no-var)
12	Unexpected unnamed function. (func-names)
12	'e' is defined but never used. (no-unused-vars)
15	Replace `.parents('.sms-phone-number-field').find('.send-button')` with `⏎··············.parents('.sms-phone-number-field')⏎··············.find('.send-button')⏎··············` (prettier/prettier)
16	Replace `.parents('.sms-phone-number-field').find('.verified')` with `⏎··············.parents('.sms-phone-number-field')⏎··············.find('.verified')⏎··············` (prettier/prettier)
21	Insert `⏎········` (prettier/prettier)
21	Unexpected unnamed function. (func-names)
22	Replace `········` with `··········` (prettier/prettier)
22	Unexpected var, use let or const instead. (no-var)
23	Insert `··` (prettier/prettier)
23	Unexpected unnamed function. (func-names)
23	'e' is defined but never used. (no-unused-vars)
24	Replace `··········` with `············` (prettier/prettier)
25	Insert `··` (prettier/prettier)
26	Replace `$input.parents('.sms-phone-number-field').find('.send-button')` with `··$input⏎················.parents('.sms-phone-number-field')⏎················.find('.send-button')⏎················` (prettier/prettier)
26	'$input' is not defined. (no-undef)
27	Replace `$input.parents('.sms-phone-number-field').find('.verified')` with `··$input⏎················.parents('.sms-phone-number-field')⏎················.find('.verified')⏎················` (prettier/prettier)
27	'$input' is not defined. (no-undef)
28	Insert `··` (prettier/prettier)
29	Insert `··` (prettier/prettier)
30	Replace `······}` with `········},⏎······` (prettier/prettier)
31	Replace `'field-setup',·'.sms-phone-number-field·.send-button',·context` with `⏎········'field-setup',⏎········'.sms-phone-number-field·.send-button',⏎········context,⏎······` (prettier/prettier)
31	Unexpected unnamed function. (func-names)
32	Unexpected var, use let or const instead. (no-var)
36	["smsPhoneNumberVerificationPrompt"] is better written in dot notation. (dot-notation)
37	Replace `'#'·+·settings['smsPhoneNumberVerificationPrompt']·+·'·.verification'` with `⏎··········'#'·+·settings['smsPhoneNumberVerificationPrompt']·+·'·.verification',⏎········` (prettier/prettier)
37	Unexpected string concatenation. (prefer-template)
37	["smsPhoneNumberVerificationPrompt"] is better written in dot notation. (dot-notation)
38	Replace `'#'·+·settings['smsPhoneNumberVerificationPrompt']·+·'·.verification·input[type="text"]'` with `⏎··········'#'·+⏎············settings['smsPhoneNumberVerificationPrompt']·+⏎············'·.verification·input[type="text"]',⏎········` (prettier/pr...
38	Unexpected string concatenation. (prefer-template)
38	["smsPhoneNumberVerificationPrompt"] is better written in dot notation. (dot-notation)
41	["smsPhoneNumberHideVerificationPrompt"] is better written in dot notation. (dot-notation)
42	Replace `'#'·+·settings['smsPhoneNumberHideVerificationPrompt']·+·'·.verification'` with `⏎··········'#'·+⏎············settings['smsPhoneNumberHideVerificationPrompt']·+⏎············'·.verification',⏎········` (prettier/prettier)
42	Unexpected string concatenation. (prefer-template)
42	["smsPhoneNumberHideVerificationPrompt"] is better written in dot notation. (dot-notation)
45	["smsPhoneNumberVerified"] is better written in dot notation. (dot-notation)
46	Replace `'#'·+·settings['smsPhoneNumberVerified']·+·'·.send-button'` with `⏎··········'#'·+·settings['smsPhoneNumberVerified']·+·'·.send-button',⏎········` (prettier/prettier)
46	Unexpected string concatenation. (prefer-template)
46	["smsPhoneNumberVerified"] is better written in dot notation. (dot-notation)
47	Unexpected string concatenation. (prefer-template)
47	["smsPhoneNumberVerified"] is better written in dot notation. (dot-notation)
47	Replace `'show'` with `⏎··········'show',⏎········` (prettier/prettier)
49	Insert `,` (prettier/prettier)

Steps to reproduce

Run coding standards with drupal ci

Proposed resolution

Fix the code

Remaining tasks

Provide the fix

User interface changes

-

API changes

-

Data model changes

-

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium tim-diels Belgium 🇧🇪

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024