chore(deps): update dependency eslint to v9 (v2) (#1424)

* chore(deps): update dependency eslint to v9

* flat config

* license header

* rebuild

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>

Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/9355815682

Co-authored-by: FabianLars <FabianLars@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-06-03 19:05:58 +00:00
committed by tauri-bot
parent ea99ee357d
commit d06be03760
3 changed files with 6 additions and 15 deletions

View File

@@ -122,7 +122,6 @@ class EventEmitter {
once(eventName, listener) {
const wrapper = (arg) => {
this.removeListener(eventName, wrapper);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
listener(arg);
};
return this.addListener(eventName, wrapper);
@@ -148,9 +147,8 @@ class EventEmitter {
* @since 2.0.0
*/
removeAllListeners(event) {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (event) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
delete this.eventListeners[event];
}
else {
@@ -170,9 +168,8 @@ class EventEmitter {
*/
emit(eventName, arg) {
if (eventName in this.eventListeners) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
const listeners = this.eventListeners[eventName];
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
for (const listener of listeners)
listener(arg);
return true;

View File

@@ -120,7 +120,6 @@ class EventEmitter {
once(eventName, listener) {
const wrapper = (arg) => {
this.removeListener(eventName, wrapper);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
listener(arg);
};
return this.addListener(eventName, wrapper);
@@ -146,9 +145,8 @@ class EventEmitter {
* @since 2.0.0
*/
removeAllListeners(event) {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (event) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
delete this.eventListeners[event];
}
else {
@@ -168,9 +166,8 @@ class EventEmitter {
*/
emit(eventName, arg) {
if (eventName in this.eventListeners) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
const listeners = this.eventListeners[eventName];
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
for (const listener of listeners)
listener(arg);
return true;

View File

@@ -171,7 +171,6 @@ class EventEmitter<E extends Record<string, any>> {
): this {
const wrapper = (arg: E[typeof eventName]): void => {
this.removeListener(eventName, wrapper);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
listener(arg);
};
return this.addListener(eventName, wrapper);
@@ -204,9 +203,8 @@ class EventEmitter<E extends Record<string, any>> {
* @since 2.0.0
*/
removeAllListeners<N extends keyof E>(event?: N): this {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
if (event) {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
delete this.eventListeners[event];
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -226,9 +224,8 @@ class EventEmitter<E extends Record<string, any>> {
*/
emit<N extends keyof E>(eventName: N, arg: E[typeof eventName]): boolean {
if (eventName in this.eventListeners) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,security/detect-object-injection
// eslint-disable-next-line security/detect-object-injection
const listeners = this.eventListeners[eventName];
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
for (const listener of listeners) listener(arg);
return true;
}