From 0eee77cb17eaf5188806e781fb644810dd1e3b53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 15 Aug 2023 16:29:34 +0200 Subject: [PATCH] build: fix prettier configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .prettierignore | 9 +++++++++ .prettierrc.json | 6 ++++++ CHANGELOG.md | 6 +++--- README.md | 8 ++++---- 4 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .prettierrc.json diff --git a/.prettierignore b/.prettierignore index bd5535a6..b1c05a97 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,10 @@ +.nyc_output/ +benchmarks/internal/results/ +coverage/ +docs/**/*.html +docs/**/*.css +docs/**/*.js +lib/ +outputs/ pnpm-lock.yaml +reports/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..80901f79 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "singleQuote": true, + "trailingComma": "none" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 77bd77a6..83e82708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -729,15 +729,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ```js // Before -const DynamicThreadPool = require("poolifier/lib/dynamic"); +const DynamicThreadPool = require('poolifier/lib/dynamic') // After -const { DynamicThreadPool } = require("poolifier/lib/dynamic"); +const { DynamicThreadPool } = require('poolifier/lib/dynamic') ``` But you should always prefer just using ```js -const { DynamicThreadPool } = require("poolifier"); +const { DynamicThreadPool } = require('poolifier') ``` #### New type definitions for input data and response diff --git a/README.md b/README.md index abeb9f9f..98afab20 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ const { 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 easy switch from one to another pool .execute() - .then(res => { + .then((res) => { console.info(res) }) - .catch(err => { + .catch((err) => { console.error(err) }) ``` -- 2.34.1