From: Jérôme Benoit Date: Fri, 12 Jan 2024 18:22:38 +0000 (+0100) Subject: refactor: refine prettier configuration X-Git-Tag: v3.1.19~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cb9249cf1a1433ed24abac37187cca3de6a9d012;p=poolifier.git refactor: refine prettier configuration Signed-off-by: Jérôme Benoit --- 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) }) ```