diff --git a/eslint.config.mjs b/eslint.config.mjs index 752c49bbd..21d4e3524 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -135,7 +135,7 @@ export default defineConfig([ "no-use-before-define": "error", - "no-unused-private-class-members": "off", // https://github.com/eclipse-thingweb/node-wot/issues/1430 + "no-unused-private-class-members": "error", "no-prototype-builtins": "off", "no-case-declarations": "off", diff --git a/packages/core/src/consumed-thing.ts b/packages/core/src/consumed-thing.ts index 0feb684b5..7676ddc15 100644 --- a/packages/core/src/consumed-thing.ts +++ b/packages/core/src/consumed-thing.ts @@ -65,38 +65,20 @@ export interface ClientAndForm { } class ConsumedThingProperty extends ThingProperty implements ThingProperty, BaseSchema { - #name: string; - #thing: ConsumedThing; - - constructor(name: string, thing: ConsumedThing) { + constructor() { super(); - - this.#name = name; - this.#thing = thing; } } class ConsumedThingAction extends ThingAction implements ThingAction { - #name: string; - #thing: ConsumedThing; - - constructor(name: string, thing: ConsumedThing) { + constructor() { super(); - - this.#name = name; - this.#thing = thing; } } class ConsumedThingEvent extends ThingEvent { - #name: string; - #thing: ConsumedThing; - - constructor(name: string, thing: ConsumedThing) { + constructor() { super(); - - this.#name = name; - this.#thing = thing; } } @@ -398,15 +380,15 @@ export default class ConsumedThing extends Thing implements IConsumedThing { extendInteractions(): void { for (const [propertyName, property] of Object.entries(this.properties)) { - const newProp = Helpers.extend(property, new ConsumedThingProperty(propertyName, this)); + const newProp = Helpers.extend(property, new ConsumedThingProperty()); this.properties[propertyName] = newProp; } for (const [actionName, action] of Object.entries(this.actions)) { - const newAction = Helpers.extend(action, new ConsumedThingAction(actionName, this)); + const newAction = Helpers.extend(action, new ConsumedThingAction()); this.actions[actionName] = newAction; } for (const [eventName, event] of Object.entries(this.events)) { - const newEvent = Helpers.extend(event, new ConsumedThingEvent(eventName, this)); + const newEvent = Helpers.extend(event, new ConsumedThingEvent()); this.events[eventName] = newEvent; } }