Skip to content

Commit d595b09

Browse files
committed
Enable a couple of additional eslint-plugin-unicorn rules
- `no-useless-collection-argument` which required no code changes, see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md - `prefer-classlist-toggle` which required one change (done automatically with `gulp lint --fix`), see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-classlist-toggle.md
1 parent fa28ca1 commit d595b09

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export default [
139139
"unicorn/no-unnecessary-array-flat-depth": "error",
140140
"unicorn/no-unnecessary-array-splice-count": "error",
141141
"unicorn/no-unnecessary-slice-end": "error",
142+
"unicorn/no-useless-collection-argument": "error",
142143
"unicorn/no-useless-promise-resolve-reject": "error",
143144
"unicorn/no-useless-spread": "error",
144145
"unicorn/prefer-array-find": "error",
@@ -147,6 +148,7 @@ export default [
147148
"unicorn/prefer-array-index-of": "error",
148149
"unicorn/prefer-array-some": "error",
149150
"unicorn/prefer-at": "error",
151+
"unicorn/prefer-classlist-toggle": "error",
150152
"unicorn/prefer-date-now": "error",
151153
"unicorn/prefer-dom-node-append": "error",
152154
"unicorn/prefer-dom-node-remove": "error",

web/debugger.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,10 @@ class Stepper {
333333
});
334334

335335
showBoxesCheckbox.addEventListener("change", () => {
336-
if (showBoxesCheckbox.checked) {
337-
this.pageContainer.classList.add("showDebugBoxes");
338-
} else {
339-
this.pageContainer.classList.remove("showDebugBoxes");
340-
}
336+
this.pageContainer.classList.toggle(
337+
"showDebugBoxes",
338+
showBoxesCheckbox.checked
339+
);
341340
});
342341
}
343342

0 commit comments

Comments
 (0)