From cb9249cf1a1433ed24abac37187cca3de6a9d012 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 12 Jan 2024 19:22:38 +0100 Subject: [PATCH] refactor: refine prettier configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .prettierrc.json | 3 ++- README.md | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index 80901f79..61b6c17b 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,6 +1,7 @@ { "$schema": "https://json.schemastore.org/prettierrc", - "semi": false, + "arrowParens": "avoid", "singleQuote": true, + "semi": false, "trailingComma": "none" } diff --git a/README.md b/README.md index 8cea8d62..843eab8c 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ import { DynamicThreadPool, FixedThreadPool, PoolEvents, availableParallelism } // a fixed worker_threads pool const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', { - errorHandler: (e) => console.error(e), + errorHandler: e => console.error(e), onlineHandler: () => console.info('worker is online') }) @@ -119,7 +119,7 @@ pool.emitter?.on(PoolEvents.busy, () => console.info('Pool is busy')) // or a dynamic worker_threads pool const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', { - errorHandler: (e) => console.error(e), + errorHandler: e => console.error(e), onlineHandler: () => console.info('worker is online') }) @@ -131,10 +131,10 @@ pool.emitter?.on(PoolEvents.busy, () => console.info('Pool is busy')) // so you can easily switch from one to another pool .execute() - .then((res) => { + .then(res => { console.info(res) }) - .catch((err) => { + .catch(err => { console.error(err) }) ``` -- 2.34.1