Skip to content

Commit

Permalink
fixed some warnings, and calmed eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohn committed Nov 5, 2024
1 parent 10c6d71 commit 9786cbf
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/css/dselect.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/dselect.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/dselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function dselect(el, option = {}) {
const disabled = option2.selected ? " disabled" : "";
const disabledvalue = option2.getAttribute("disabled");
const btnClass = itemClass === "" ? "" : " " + itemClass;
disableitem = "";
let disableitem = "";
if (disabledvalue !== null) {
disableitem = "disabled='true'";
} else {
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";


export default [
{
ignores: ['.idea/*']
},
{languageOptions: { globals: {...globals.browser, ...globals.node} }},
pluginJs.configs.recommended,
];
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@skem9/dselect",
"version": "1.1.11",
"version": "1.1.2",
"description": "Dropdown select box for bootstrap 5 with search, multiple, tag and image support",
"repository": {
"type": "git",
"url": "git+https://yohn@github.com/Yohn/dselect.git"
},
"type":"commonjs",
"type": "commonjs",
"keywords": [
"dropdown-select",
"bootstrap-select",
Expand Down Expand Up @@ -55,6 +55,7 @@
"autoprefixer": "^10.4.20",
"bootstrap": "^5.3.3",
"esbuild": "^0.12.29",
"eslint": "^9.14.0",
"fs-extra": "^10.1.0",
"gulp": "^5.0.0",
"gulp-rename": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion source/css/dselect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ $dselect-clear-icon-width: .625rem;
.input-group-lg > .dselect-wrapper > .form-select,
.input-group-sm > .dselect-wrapper > .form-select {
padding-right: $form-select-padding-x + $form-select-indicator-padding;
}
}
8 changes: 5 additions & 3 deletions source/js/dselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function dselectSearch(event, input, classElement, classToggler, creatable, loca
if (filterText.toLowerCase().indexOf(filterValue) > -1) {
item.classList.remove("d-none");
let header = item;
while (header = header.previousElementSibling) {
// wrapped in a second () to calm eslint.
while ((header = header.previousElementSibling)) {
if (header.classList.contains("dropdown-header")) {
header.classList.remove("d-none");
break;
Expand All @@ -56,7 +57,8 @@ function dselectSearch(event, input, classElement, classToggler, creatable, loca
if (filterText.toLowerCase().indexOf(filterValue) > -1) {
header.classList.remove("d-none");
let item = header;
while (item = item.nextElementSibling) {
// wrapped in a second () to calm eslint.
while ((item = item.nextElementSibling)) {
if (item.classList.contains("dropdown-header")) {
break;
}
Expand Down Expand Up @@ -178,7 +180,7 @@ function dselect(el, option = {}) {
const disabled = option2.selected ? " disabled" : "";
const disabledvalue = option2.getAttribute("disabled");
const btnClass = itemClass === "" ? "" : " " + itemClass;
disableitem = "";
let disableitem = "";
if (disabledvalue !== null) {
disableitem = "disabled='true'";
} else {
Expand Down

0 comments on commit 9786cbf

Please sign in to comment.