Skip to content

Commit 88ef41e

Browse files
committed
fix(code): smells removed (lint updated)
1 parent d96f3b4 commit 88ef41e

File tree

8 files changed

+67
-66
lines changed

8 files changed

+67
-66
lines changed

package-lock.json

Lines changed: 51 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
"@typescript-eslint/parser": "8.8.0",
5252
"barrelsby": "2.8.1",
5353
"eslint": "8.57.0",
54-
"@stylistic/eslint-plugin": "2.8.0",
54+
"@stylistic/eslint-plugin": "2.9.0",
5555
"eslint-plugin-array-func": "4.0.0",
56-
"eslint-plugin-import": "2.30.0",
56+
"eslint-plugin-import": "2.31.0",
5757
"eslint-plugin-jest": "28.8.3",
58-
"eslint-plugin-jsdoc": "50.3.1",
58+
"eslint-plugin-jsdoc": "50.4.1",
5959
"eslint-plugin-tsdoc": "0.3.0",
60-
"eslint-plugin-unicorn": "55.0.0",
60+
"eslint-plugin-unicorn": "56.0.0",
6161
"husky": "9.0.11",
6262
"interacto-nono": "0.5.0",
6363
"jest": "29.7.0",

src/impl/animation/DwellSpringAnimation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class DwellSpringAnimation {
6060
}
6161
} else {
6262
clearInterval(this.interval);
63-
this.interval = window.setInterval(() => {
63+
this.interval = globalThis.window.setInterval(() => {
6464
clearInterval(this.interval);
6565
this.displaySpring = true;
6666
this.positionSpring = {

src/impl/fsm/TimeoutTransition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class TimeoutTransition extends TransitionBase<Event> {
6868
return;
6969
}
7070

71-
this.timeoutThread = window.setTimeout(() => {
71+
this.timeoutThread = globalThis.window.setTimeout(() => {
7272
try {
7373
this.timeouted = true;
7474
this.src.fsm.onTimeout();

src/impl/util/ArrayUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
export function remove<T>(array: Array<T>, elt: T): void {
2222
const index = array.indexOf(elt);
23-
if (index > -1) {
23+
if (index !== -1) {
2424
array.splice(index, 1);
2525
}
2626
}

test/interaction/ScrollDataImpl.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("using a scroll data", () => {
2323
data = new ScrollDataImpl();
2424
evt = new UIEvent("mousedown");
2525

26-
const newWindow = {...window};
26+
const newWindow = {...globalThis.window};
2727
Object.defineProperties(newWindow, {
2828
"scrollX": {
2929
get(): number {
@@ -36,7 +36,7 @@ describe("using a scroll data", () => {
3636
}
3737
}
3838
});
39-
jest.spyOn(global, "window", "get")
39+
jest.spyOn(globalThis.global, "window", "get")
4040
.mockReturnValue(newWindow);
4141
});
4242

test/interaction/StubEvents.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function createTouchEvent(type: "touchend" | "touchmove" | "touchstart",
5757
const clientXvalue = clientX ?? 0;
5858
const clientYvalue = clientY ?? 0;
5959
const evt = new TouchEvent(type, {
60-
"view": window,
60+
"view": globalThis.window,
6161
"bubbles": true,
6262
"cancelable": false,
6363
"detail": 1,
@@ -147,7 +147,7 @@ export function createMouseEvent(type: "auxclick" | "click" | "mousedown" | "mou
147147
const clientXvalue = clientX ?? 0;
148148
const clientYvalue = clientY ?? 0;
149149
return new MouseEvent(type, {
150-
"view": window,
150+
"view": globalThis.window,
151151
"bubbles": true,
152152
"cancelable": false,
153153
"detail": 1,
@@ -177,7 +177,7 @@ export function createWheelEvent(type: "wheel",
177177
const deltaYValue = deltaY ?? 0;
178178
const deltaZValue = deltaZ ?? 0;
179179
return new WheelEvent(type, {
180-
"view": window,
180+
"view": globalThis.window,
181181
"bubbles": true,
182182
"cancelable": false,
183183
"detail": 1,
@@ -202,7 +202,7 @@ export function createKeyEvent(type: "keydown" | "keyup", key = "", code = ""):
202202
return new KeyboardEvent(type, {
203203
"cancelable": false,
204204
"bubbles": true,
205-
"view": window,
205+
"view": globalThis.window,
206206
code,
207207
key,
208208
"repeat": false
@@ -214,7 +214,7 @@ export function createUIEvent(type: EventType): UIEvent {
214214
"detail": 0,
215215
"bubbles": true,
216216
"cancelable": false,
217-
"view": window
217+
"view": globalThis.window
218218
});
219219
}
220220

test/logging/Logger.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe("using a logger", () => {
145145
"setRequestHeader": jest.fn()
146146
};
147147

148-
jest.spyOn(window, "XMLHttpRequest").mockImplementation(() => xhrMock as XMLHttpRequest);
148+
jest.spyOn(globalThis.window, "XMLHttpRequest").mockImplementation(() => xhrMock as XMLHttpRequest);
149149

150150
logger.writeConsole = false;
151151
logger.serverAddress = "localhost";
@@ -252,7 +252,7 @@ describe("using a logger", () => {
252252
"setRequestHeader": jest.fn()
253253
};
254254

255-
jest.spyOn(window, "XMLHttpRequest").mockImplementation(() => xhrMock as XMLHttpRequest);
255+
jest.spyOn(globalThis.window, "XMLHttpRequest").mockImplementation(() => xhrMock as XMLHttpRequest);
256256
logger.writeConsole = false;
257257
logger.serverAddress = "yolo";
258258
logger.logBindingStart("foo3");

0 commit comments

Comments
 (0)