From: Jérôme Benoit Date: Tue, 15 Aug 2023 14:29:34 +0000 (+0200) Subject: build: fix prettier configuration X-Git-Tag: v2.6.26~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0eee77cb17eaf5188806e781fb644810dd1e3b53;p=poolifier.git build: fix prettier configuration Signed-off-by: Jérôme Benoit --- 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) }) ```