Skip to content

Commit c7079b9

Browse files
committed
Stylelint + ESlint
1 parent 8741ef2 commit c7079b9

8 files changed

Lines changed: 30 additions & 27 deletions

assets/tags-widget.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import './tags-widget.scss';
22

3-
import {Application, Controller} from '@hotwired/stimulus';
3+
import { Application, Controller } from '@hotwired/stimulus';
44
import TomSelect from 'tom-select';
55

66
const application = Application.start();
77
application.debug = process.env.NODE_ENV === 'development';
88
application.register('codefog--tags-widget', class extends Controller {
9-
static targets = ['input']
9+
static targets = ['input'];
1010

1111
static values = {
1212
config: {
1313
type: Object,
1414
default: {},
15-
}
16-
}
15+
},
16+
};
1717

1818
connect() {
19-
this.tomSelect = new TomSelect(this.inputTarget, this.#getOptions())
19+
this.tomSelect = new TomSelect(this.inputTarget, this.#getOptions());
2020
}
2121

2222
disconnect() {
23-
this.tomSelect.destroy()
23+
this.tomSelect.destroy();
2424
}
2525

2626
add(event) {
27-
this.tomSelect.addItem(event.target.value)
27+
this.tomSelect.addItem(event.target.value);
2828
}
2929

3030
remove(event) {
31-
this.tomSelect.removeItem(event.target.value)
31+
this.tomSelect.removeItem(event.target.value);
3232
}
3333

3434
#getOptions() {
@@ -42,12 +42,12 @@ application.register('codefog--tags-widget', class extends Controller {
4242
render: {
4343
option_create: (data, escape) => `<div class="create">${config.addLabel} <strong>${escape(data.input)}</strong>&hellip;</div>`,
4444
item: (data, escape) => `<div>${escape(data.text)}<button type="button" class="cfg-tags-widget__remove" value="${data.value}" aria-label="${config.removeLabel} ${escape(data.text)}" data-action="click->codefog--tags-widget#remove:prevent">${config.removeLabel}</button></div>`,
45-
no_results: (data,escape) => `<div class="no-results">${config.noResultsLabel}</div>`,
46-
}
45+
no_results: () => `<div class="no-results">${config.noResultsLabel}</div>`,
46+
},
4747
};
4848

4949
if (config.allowCreate) {
50-
options.create = input => ({ value: input, text: input });
50+
options.create = (input) => ({ value: input, text: input });
5151
}
5252

5353
if (config.maxItems) {

assets/tags-widget.scss

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $select-padding-dropdown-item-y: 3px;
1313
$select-padding-x: 6px;
1414
$select-padding-y: 5px;
1515

16-
@import "~tom-select/dist/scss/tom-select";
16+
@import '~tom-select/dist/scss/tom-select';
1717

1818
.cfg-tags-widget {
1919
margin-top: 3px;
@@ -37,7 +37,7 @@ $select-padding-y: 5px;
3737
cursor: pointer;
3838
transition: background 0.2s ease;
3939

40-
html[data-color-scheme=dark] & {
40+
html[data-color-scheme='dark'] & {
4141
background-image: url('./add--dark.svg');
4242
}
4343

@@ -55,14 +55,17 @@ $select-padding-y: 5px;
5555
position: relative;
5656
display: inline-block;
5757
width: var(--choices-button-dimension, 8px);
58-
margin: 0 calc(var(--choices-button-offset, 8px) * -.5) 0 var(--choices-button-offset, 8px);
58+
margin: 0 calc(var(--choices-button-offset, 8px) * -0.5) 0 var(--choices-button-offset, 8px);
5959
padding-bottom: 2px;
6060
padding-left: calc(var(--choices-button-offset, 8px) * 2);
6161
border: 0;
6262
border-left: 1px solid var(--choices-border);
6363
border-radius: var(--choices-button-border-radius, 0);
6464
background-color: transparent;
65-
background-image: var(--choices-icon-cross, url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg=="));
65+
background-image: var(
66+
--choices-icon-cross,
67+
url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==')
68+
);
6669
background-position: center;
6770
background-repeat: no-repeat;
6871
background-size: var(--choices-button-dimension, 8px);
@@ -72,16 +75,16 @@ $select-padding-y: 5px;
7275
text-indent: -9999px;
7376
appearance: none;
7477

75-
html:not([data-color-scheme=dark]) & {
76-
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMjIyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==)
78+
html:not([data-color-scheme='dark']) & {
79+
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjEiIGhlaWdodD0iMjEiIHZpZXdCb3g9IjAgMCAyMSAyMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMjIyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yLjU5Mi4wNDRsMTguMzY0IDE4LjM2NC0yLjU0OCAyLjU0OEwuMDQ0IDIuNTkyeiIvPjxwYXRoIGQ9Ik0wIDE4LjM2NEwxOC4zNjQgMGwyLjU0OCAyLjU0OEwyLjU0OCAyMC45MTJ6Ii8+PC9nPjwvc3ZnPg==');
7780
}
7881

7982
&:is(:hover, :focus) {
8083
--choices-button-opacity: var(--choices-button-opacity-hover, 1);
8184
}
8285

8386
&:focus {
84-
box-shadow: 0 0 0 2px var(--choices-highlight-color, #005F75)
87+
box-shadow: 0 0 0 2px var(--choices-highlight-color, #005f75);
8588
}
8689
}
8790

@@ -94,7 +97,7 @@ $select-padding-y: 5px;
9497
padding-left: 3px;
9598

9699
input {
97-
margin: -3px 4px 0 4px !important;
100+
margin: -3px 4px 0 !important;
98101
}
99102
}
100103

@@ -121,7 +124,7 @@ $select-padding-y: 5px;
121124
background-position: 6px center;
122125

123126
&.active,
124-
html[data-color-scheme=dark] & {
127+
html[data-color-scheme='dark'] & {
125128
background-image: url('./add--dark.svg');
126129
}
127130
}

public/entrypoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"/bundles/codefogtags/tags-widget.c2ea0e46.css"
66
],
77
"js": [
8-
"/bundles/codefogtags/tags-widget.70907cda.js"
8+
"/bundles/codefogtags/tags-widget.92015867.js"
99
]
1010
}
1111
}

public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"tags-widget.css": "/bundles/codefogtags/tags-widget.c2ea0e46.css",
3-
"tags-widget.js": "/bundles/codefogtags/tags-widget.70907cda.js",
3+
"tags-widget.js": "/bundles/codefogtags/tags-widget.92015867.js",
44
"images/add--dark.svg": "/bundles/codefogtags/images/add--dark.642bad3d.svg",
55
"images/add.svg": "/bundles/codefogtags/images/add.a31d1889.svg",
66
"tags-widget.c2ea0e46.css.map": "/bundles/codefogtags/tags-widget.c2ea0e46.css.map",
7-
"tags-widget.70907cda.js.map": "/bundles/codefogtags/tags-widget.70907cda.js.map"
7+
"tags-widget.92015867.js.map": "/bundles/codefogtags/tags-widget.92015867.js.map"
88
}

public/tags-widget.70907cda.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/tags-widget.92015867.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/tags-widget.c2ea0e46.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)