Skip to content

Commit

Permalink
Merge pull request #188 from foretagsplatsen/dependabot/npm_and_yarn/…
Browse files Browse the repository at this point in the history
…foretagsplatsen/eslint-plugin-12.0.0

15549487: Bump @foretagsplatsen/eslint-plugin from 9.0.0 to 12.0.0
  • Loading branch information
DamienCassou authored Oct 2, 2024
2 parents 09a2c82 + 9607840 commit e73c12f
Show file tree
Hide file tree
Showing 5 changed files with 1,503 additions and 125 deletions.
16 changes: 16 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ export default [
],
},
],
"import/no-anonymous-default-export": "off",
"jsdoc/check-alignment": "off",
"jsdoc/check-param-names": "off",
"jsdoc/check-tag-names": "off",
"jsdoc/check-types": "off",
"jsdoc/match-description": "off",
"jsdoc/no-undefined-types": "off",
"jsdoc/require-hyphen-before-param-description": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/tag-lines": "off",
"no-magic-numbers": "off",
},
},
{
Expand All @@ -32,6 +47,7 @@ export default [
ignoreExports: ["**/*.test.js"],
},
],
"sonarjs/no-duplicate-string": "off",
},
},
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test:open": "vitest --ui"
},
"devDependencies": {
"@foretagsplatsen/eslint-plugin": "^9.0.0",
"@foretagsplatsen/eslint-plugin": "^12.0.0",
"@vitest/coverage-v8": "^2.0.2",
"@vitest/ui": "^2.0.2",
"eslint": "^9.9.1",
Expand Down
14 changes: 7 additions & 7 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export default function event(spec, my) {
* Remove itself from event, if bound.
*/
that.unbind = function () {
if (that.isBound()) {
event.unregister(that);
event = undefined;
}
if (!that.isBound()) return;

event.unregister(that);
event = undefined;
};

/**
Expand All @@ -78,9 +78,9 @@ export default function event(spec, my) {
* @param params
*/
that.execute = function (params) {
if (callback) {
callback.apply(that, params);
}
if (!callback) return;

callback.apply(that, params);
};

/**
Expand Down
4 changes: 2 additions & 2 deletions test/events.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from "vitest";
import event from "../src/event.js";
import eventCategory from "../src/eventCategory.js";
import events from "../src/eventManager.js";
import { expect, describe, it, vi } from "vitest";
import events from "../src/eventManager.js"; // eslint-disable-line consistent-default-export-name/default-import-match-filename -- too busy to do that now

describe("events", () => {
it("bind callback to event", () => {
Expand Down
Loading

0 comments on commit e73c12f

Please sign in to comment.