Skip to content

Commit 4c424fb

Browse files
committed
chore: run Biome lint/format on TogglePassword
1 parent 4388398 commit 4c424fb

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

src/TogglePassword/assets/dist/controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ class default_1 extends Controller {
3030
button.classList.add(...this.buttonClassesValue);
3131
button.setAttribute('tabindex', '-1');
3232
button.addEventListener('click', this.toggle.bind(this));
33-
button.innerHTML = this.visibleIcon + ' ' + this.visibleLabelValue;
33+
button.innerHTML = `${this.visibleIcon} ${this.visibleLabelValue}`;
3434
return button;
3535
}
3636
toggle(event) {
3737
this.isDisplayed = !this.isDisplayed;
3838
const toggleButtonElement = event.currentTarget;
3939
toggleButtonElement.innerHTML = this.isDisplayed
40-
? this.hiddenIcon + ' ' + this.hiddenLabelValue
41-
: this.visibleIcon + ' ' + this.visibleLabelValue;
40+
? `${this.hiddenIcon} ${this.hiddenLabelValue}`
41+
: `${this.visibleIcon} ${this.visibleLabelValue}`;
4242
this.element.setAttribute('type', this.isDisplayed ? 'text' : 'password');
4343
this.dispatchEvent(this.isDisplayed ? 'show' : 'hide', { element: this.element, button: toggleButtonElement });
4444
}

src/TogglePassword/assets/src/controller.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* file that was distributed with this source code.
88
*/
99

10-
'use strict';
11-
1210
import { Controller } from '@hotwired/stimulus';
1311

1412
export default class extends Controller<HTMLInputElement> {
@@ -57,7 +55,7 @@ export default class extends Controller<HTMLInputElement> {
5755
button.classList.add(...this.buttonClassesValue);
5856
button.setAttribute('tabindex', '-1');
5957
button.addEventListener('click', this.toggle.bind(this));
60-
button.innerHTML = this.visibleIcon + ' ' + this.visibleLabelValue;
58+
button.innerHTML = `${this.visibleIcon} ${this.visibleLabelValue}`;
6159

6260
return button;
6361
}
@@ -69,8 +67,8 @@ export default class extends Controller<HTMLInputElement> {
6967
this.isDisplayed = !this.isDisplayed;
7068
const toggleButtonElement: HTMLButtonElement = event.currentTarget;
7169
toggleButtonElement.innerHTML = this.isDisplayed
72-
? this.hiddenIcon + ' ' + this.hiddenLabelValue
73-
: this.visibleIcon + ' ' + this.visibleLabelValue;
70+
? `${this.hiddenIcon} ${this.hiddenLabelValue}`
71+
: `${this.visibleIcon} ${this.visibleLabelValue}`;
7472
this.element.setAttribute('type', this.isDisplayed ? 'text' : 'password');
7573
this.dispatchEvent(this.isDisplayed ? 'show' : 'hide', { element: this.element, button: toggleButtonElement });
7674
}

src/TogglePassword/assets/test/controller.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
* file that was distributed with this source code.
88
*/
99

10-
'use strict';
11-
1210
import { Application, Controller } from '@hotwired/stimulus';
1311
import { getByTestId, waitFor, getByText } from '@testing-library/dom';
1412
import user from '@testing-library/user-event';
@@ -31,7 +29,7 @@ const startStimulus = () => {
3129
}
3230

3331
describe('TogglePasswordController', () => {
34-
let container;
32+
let container: HTMLElement;
3533

3634
beforeEach(() => {
3735
container = mountDOM(`

src/TogglePassword/composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"name": "symfony/ux-toggle-password",
33
"type": "symfony-bundle",
44
"description": "Toggle visibility of password inputs for Symfony Forms",
5-
"keywords": [
6-
"symfony-ux"
7-
],
5+
"keywords": ["symfony-ux"],
86
"homepage": "https://symfony.com",
97
"license": "MIT",
108
"authors": [

0 commit comments

Comments
 (0)