aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Miller <[email protected]>2020-05-27 12:35:39 -0400
committerJason Miller <[email protected]>2020-05-27 12:35:39 -0400
commit59cc3d1bc3b85d347baa8883b6206ba88a6071c0 (patch)
tree01b4f434889b19b9b4e448e0155c49b4a876aee9
parent3bce9a164db0340cf1cc1b355274f6d419499528 (diff)
Use eslint-config-developit
-rw-r--r--package.json3
-rw-r--r--src/index.ts7
2 files changed, 6 insertions, 4 deletions
diff --git a/package.json b/package.json
index f2298f8..08b12d2 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
],
"eslintConfig": {
"extends": [
- "eslint:recommended",
+ "developit",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
@@ -73,6 +73,7 @@
"chai": "^4.2.0",
"documentation": "^13.0.0",
"eslint": "^7.1.0",
+ "eslint-config-developit": "^1.2.0",
"esm": "^3.2.25",
"microbundle": "^0.12.0",
"mocha": "^7.2.0",
diff --git a/src/index.ts b/src/index.ts
index e1503e2..f8e7e64 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -14,13 +14,13 @@ type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerLis
export interface Emitter {
on(type: EventType, handler: Handler): void;
- on(type: "*", handler: WildcardHandler): void;
+ on(type: '*', handler: WildcardHandler): void;
off(type: EventType, handler: Handler): void;
- off(type: "*", handler: WildcardHandler): void;
+ off(type: '*', handler: WildcardHandler): void;
emit<T = any>(type: EventType, event?: T): void;
- emit(type: "*", event?: any): void;
+ emit(type: '*', event?: any): void;
}
/** Mitt: Tiny (~200b) functional event emitter / pubsub.
@@ -31,6 +31,7 @@ export default function mitt(all?: EventHandlerMap): Emitter {
all = all || new Map();
return {
+
/**
* Register an event handler for the given type.
* @param {string|symbol} type Type of event to listen for, or `"*"` for all events